You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi ruohoruotsi, Thanks for your work on this library.
I found the Butterworth class's output a1 and a2 of SOS are awayls change sign compare to matlab results.
Such as if c++ output a1=0.1,a2=-0.2 then matlab's a1=-0.1, a2=0.2.
Is there something that I missing? If the output of Butterworth.bandPass() gives digital filter Biquad coefficients then is it should be the
same as matlab's results?
order = 4;
Fs=100;
fp1=0.5;
fs1=10;
% design digital Butter-Worth-Filter in SOS form
[z,p,k]=butter(order,[fp1*2/Fs,fs1*2/Fs],'bandpass');
[bsos,bk] = zp2sos(z,p,k);
Then you can see coeffs[i].a1 == -bsos[i+1, 5] and coeffs[i].a2 == -bsos[i+1, 6]. i from 0 to length of coeffs.
The text was updated successfully, but these errors were encountered:
As you can tell I haven't been active here much, but there seem to be some small bugs popping up that I need to fix/improve. I'll have a look this weekend.
Also, please feel free to make a PR from your fork, I appreciate your contributions and code contributions 🙇 🙏
I have added some features in my fork of this project.
They are:
Added sos2tf() function to convert SOS to Transfer Function coefficients like matlab's SOS2TF.
Added conv() function to do convolution.
Added CMake as building system, and move tests to 'tests/' subdirectory. Because I do not use SConstruct so I didn't change it, but changed the doc to cmake.
Added some cross-compile support for arm64 target, but they are specific to my development environment, so I don't know if I should include them in PR.
I will try to make a PR, if there are something wrong, please tell me. : )
Hi ruohoruotsi, Thanks for your work on this library.
I found the Butterworth class's output a1 and a2 of SOS are awayls change sign compare to matlab results.
Such as if c++ output a1=0.1,a2=-0.2 then matlab's a1=-0.1, a2=0.2.
Is there something that I missing? If the output of Butterworth.bandPass() gives digital filter Biquad coefficients then is it should be the
same as matlab's results?
Thanks for your help.
C++ Test code like below:
Matlab test code like:
Then you can see
coeffs[i].a1 == -bsos[i+1, 5]
andcoeffs[i].a2 == -bsos[i+1, 6]
. i from 0 to length of coeffs.The text was updated successfully, but these errors were encountered: