-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lowpass filter response with example application #18
Comments
Hello, as far as I unterstand the source code (https://github.com/mathnet/mathnet-filtering/blob/master/src/Filtering/OnlineFilter.cs, https://github.com/mathnet/mathnet-filtering/blob/master/src/Filtering/FIR/FirCoefficients.cs) there seems to be an issue with CreateLowpass(ImpulseResponse mode, double sampleRate, double cutoffRate, int order) since the update from version 0.5 (which I'm still using) to 0.6, still existing in 0.7: In case of passed mode ImpulseResponse.Finite the following code is executed: So from my point of view the order parameter from CreateLowpass(...) gets now passed as dcGain to FirCoefficients.LowPass(...) instead of halforder which results in incorrect coefficients. Kind regards. |
Dear @SOCMarcel, |
Dear @cdrnet, |
Can we get a fix for this? |
As mentioned in mathnet#18 there is now additional parameter in FirCoefficients that is missing here. For compatibility reasons I have set Gain to 1.
Hello,
Using the following example (with release 0.7.0 from NuGet), the low pass filter has a unexpected response.
` double fs = 1000; //sampling rate
double fw = 5; //signal frequency
double fn = 50; //noise frequency
double n = 5; //number of periods to show
double A = 1; //signal amplitude
double N = 0.1; //noise amplitude
int size = (int)(n * fs / fw); //sample size
The original signal (plus noise) is on the following chart:
The lowpass filter response is below:
The bandpass filter response is below:
The bandpass with narrow band is below:
All the signals involved in this test application are below:
Any advice regarding the response of the lowpass filter is appreciated.
Attached is the Source Code and VS2019 example application for your reference.
Thanks
FilterExample.zip
The text was updated successfully, but these errors were encountered: