I'm trying to use the IIR filters from the Math.NET filtering library, but regardless of what I'm trying to do they all seem unstable.
Here's what I'm trying to do:
Coefficients = MathNet.Filtering.IIR.IirCoefficients.LowPass(samplingRate, cutoff, Bandwidth)
The generated coefficients are:
First off all I have no idea what Bandwidth is, I think it is supposed to be the bandwidth between the corner frequencies so in the case of a LowPass filter I think Bandwidth = cutoff, at least thats what I'm using right now.
I have a stochastic signa which is sampled with 10 kHz. I acquire a buffer of 1000 samples per sampling (so I get 1000 samples every 100 ms).
I'd like to low pass filter this signal using the calculated coefficients, but when I do this:
var filter = New MathNet.Filtering.IIR.OnlineIirFilter(Coefficients);
var filtered= filter.ProcessSamples(Buffer);
the filtered variable contains something unresembling the filtered signal.
Any idea what's causing the filter to become unstable? No matter what cutoff frequency I use it is always unstable