Advanced Analysis Library Only
AnalysisLibErrType Wind_HPF (double samplingFreq, double cutoffFreq, int numberOfCoef, double coefficientArray[], int windowType);
![]() |
Note This function is obsolete. National Instruments recommends that you use WindFIR_Filter instead. |
Designs a digital highpass FIR linear phase filter using a windowing technique. Five windows are available. Wind_HPF generates only the filter coefficients; it does not actually perform data filtering.
The attenuation value determines the approximate peak value of the sidelobes. Transition bandwidth determines a frequency range over which the filter response changes from the pass band to the stop band or from the stop band to the pass band. For more information, refer to Discrete-Time Signal Processing by Oppenheim and Schafer, cited in the Bibliography.
/* Design a 55-point highpass FIR linear phase filter that can achieve at least a 44 dB attenuation and filter the incoming signal with the designed filter. */
double x[256], coef[55], y[310], fs, fc;
n, m, windType;
fs = 1000.0; /* sampling frequency */
fc = 200.0; /* desired cutoff frequency */
n = 55; /* filter length */
windType = 3; /* using Hanning window */
m = 256;
Wind_HPF (fs, fc, n, coef, windType);
Convolve (coef, n, x, m, y); /* Convolve the filter with the signal. */
Input | ||||||||||||||||||||||||||
Name | Type | Description | ||||||||||||||||||||||||
samplingFreq | double-precision | Sampling frequency in Hertz. | ||||||||||||||||||||||||
cutoffFreq | double-precision | Cutoff frequency of the filter in Hertz. | ||||||||||||||||||||||||
numberOfCoef | integer | Length of the window FIR filter. numberOfCoef must be odd for this filter. |
||||||||||||||||||||||||
windowType | integer | Window type. windowType selects one of the five windows as shown in the following table.
|
||||||||||||||||||||||||
Output | ||||||||||||||||||||||||||
Name | Type | Description | ||||||||||||||||||||||||
coefficientArray | double-precision array | Calculated output window FIR filter coefficients. |
Name | Type | Description |
status | AnalysisLibErrType | A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants. |