Filter

<series> output = <series>.filter(<string>Filter Type, <number>Cutoff Frequency)

<series> output = <series>.filter(<string>Filter Type, <number>Low Cutoff Frequency>, <number>High Cutoff Frequency)

The filter function applies a finite impulse response (FIR) filter to the input data.  This function can be called with either two arguments or three arguments.  For a High Pass Filter, use two arguments with “HP” Filter Type. For a Low Pass Filter, use two arguments with “LP” as Filter Type.  For a Band Pass Filter, or a Band Stop Filter, use three arguments with “BP” or “BS” as Filter Type, respectively.  The FIR filter kernel width is 101, and a Blackman window is used to smooth non-linearity at the edge of the filter kernel.

Examples:

var mySeriesLPF = mySeries.filter(“LP”, 500); // attenuate frequencies greater than 500 Hz

var mySeriesHPF = mySeries.filter(“HP”, 500); // attenuate frequencies less that 500 Hz

var mySeriesBPF = mySeries.filter(“BP”, 250, 750); // attenuate frequencies

var mySeriesBSF = mySeries.filter(“BS”, 250, 750);