I'm trying to use MathNet filters to apply a band pass filter to a signal; I'm using the MathNet.Filtering.OnlineFiter.CreateBandpass(..)
method, to be precise.
The problem is, I'm not getting the expected results and I'm getting confused by the method's parameters. I've got a signal sampled at 1Khz, and I want to remove everything outside the 4 to 6 Hz range. What is the correct way to call the method CreateBandpass(..)
?
Edit
This is the code, as requested in a comment:
OnlineFilter bandPass = CreateBandpass(ImpulseResponse.Finite, samplingRate, 3, 7);
postProcessedData = bandPass.ProcessSamples(preProcessedData);
The source is a sinewave at exactly 5 Hz with some relatively high frequency noise (like 30-70 hz); the amplitude of the signal is around 20 peak-peak, centred at 0 (so -10 to +10). The filtered signal is a sinewave at 5 Hz with no noise and an amplitude, peak-peak, of 2.1
P.S.
This happens too with a test wave, by the way. If a generate a pure sinewave (whatever the frequency) and filter it around its frequency, I obtain a sinewave of the same frequency and a totally unrelated amplitude. On the other hand if I FFT (still using MathNet) the wave and remove the components I'm not interested into, I can then rebuild the wave at the expected amplitude and totally clean from noise.