0

I have created the following code:

Double[] ArrayOfData = new Double[Size] { 0.5, 1.5, ... , 1.0 };
var lowPass = MathNet.Filtering.IIR.IirCoefficients.LowPass(0, 0, 0);

MathNet.Filtering.IIR.OnlineIirFilter filter = new MathNet.Filtering.IIR.OnlineIirFilter(lowPass);

filter.ProcessSamples(ArrayOfData);

The problem that I am running into is that the low pass filter does not seem to do anything. I have tried different values than 0,0,0 for the lowpass but it doesn't seem to have any effect.

If anyone has some knowledge on the MathNet Filtering api, could you show a simple example or explain what I am doing incorrectly?

The nuget info can be found: http://filtering.mathdotnet.com/

It is the MathNet.Filtering - core package link that I am using.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Maderas
  • 231
  • 2
  • 14

1 Answers1

4

First of all, please note that the ProcessSamples method returns the filtered data; ArrayOfData is left unmodified. You thus need to obtain the method output to be able to look at the results:

var processed = filter.ProcessSamples(ArrayOfData);

Second, the parameter combination (0, 0, 0) is invalid. Arguments are samplingRate (samples per unit), cutoff (cutoff frequency in samples per unit), and width (bandwidth in samples per unit), and as far as I know these arguments all need to be larger than zero.

Anders Gustafsson
  • 15,837
  • 8
  • 56
  • 114