WindFIR_Filter

Advanced Analysis Library Only

AnalysisLibErrType WindFIR_Filter (int filterType, double samplingFrequency, double lowerCutoffFreq, double upperCutoffFreq, int numberOfCoefficients, int windowType, double windowParameter, double coefficients[]);

Purpose

Generates windowed FIR filter coefficients. This function computes only FIR coefficients. You can call a convolution function on the computed coefficients and the signal to perform actual data filtering.

Parameters

Input
Name Type Description
filterType integer The type of filter. filterType must be one of the following values:
  • LOWPASS (0)
  • HIGHPASS (1)
  • BANDPASS (2)
  • BANDSTOP (3)
samplingFrequency double-precision Sampling frequency, in Hz.
lowerCutoffFreq double-precision The cutoff frequency for LOWPASS or HIGHPASS filters, or the low cutoff frequency for BANDPASS or BANDSTOP filters, in Hz.
upperCutoffFreq double-precision The high cutoff frequency for BANDPASS or BANDSTOP filters. This parameter is not referenced if filterType is LOWPASS or HIGHPASS.
numberOfCoefficients integer The total number of FIR filter coefficients.
windowType integer The type of window to apply. windowType must be one of the following values:
  • RECTANGLE (0)
  • HANNING (1)
  • HAMMING (2)
  • BLKHARRIS (3)
  • EXBLKMAN (4)
  • BLKMAN (5)
  • FLATTOP (6)
  • BH4TERM (7)
  • BH7TERM (8)
  • LOWSIDELB (9)
  • BLKMANNUTTALL (11)
  • TRIANGLE (30)
  • KAISER (60)
  • DOLCHEBYSHEV (61)
  • GAUSSIAN (62)
windowParameter double-precision The window parameter. This parameter is referenced only if windowType is one of the following values:
  • KAISER: para is beta.
  • GAUSSIAN: para is the standard deviation. If para < 0, the function uses 0.2 for para instead.
  • DOLCHEBYSHEV: para is the ratio of the mainlobe to the sidelobe, in dB. If para < 0, the function uses 60dB for para instead.
Output
Name Type Description
coefficients double-precision array The computed windowed FIR coefficients.

Return Value

Name Type Description
status AnalysisLibErrType A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants.