DataLab is a compact statistics package aimed at exploratory data analysis. Please visit the DataLab Web site for more information....

Script Command Filtercoeffs

Script Command: FilterCoeffs (Width, [a1, a2, ..., ai], [b1, b2, ..., bi])

The command FilterCoeffs allows to set the filter coefficients of the des LTI filters. The parameter Width defines the width of the filter window, the coefficients ai and bi have to be specified in square brackets (for each group of coefficients separately). If less than Width coefficients are declared the remaining undeclared coefficients will be replaced by zero values; surplus coefficients are ignored.


filtercoeffs (5, [0.2,0.2,0.2,0.2,0.2], [0])
defines a simple moving average filter; the coefficients bi are not requires and are set to zero values.

filtercoeffs (9, [1,2,3,4,5.5,-23.2,1,2,1], [1,1,1,1,1,1,1,1,1])
specifies a recursive filter which creates an oscillating function.


Hint: The filter coefficients will be changed by the command "filter" if one of the pre-defined filter types are applied. The only filter which does not change the coefficients is the IIR filter type. In order to avoid unwanted (and unexpected) effects, the filter coefficients should be declared immediately before calling the command "filter".

Last Update: 2013-Feb-13