Ksr_HPF
Advanced Analysis Library Only
AnalysisLibErrType Ksr_HPF (double samplingFrequency, double cutoffFrequency, int numberOfCoef, double coefficientArray[], double beta);
Purpose
Designs a digital highpass FIR linear phase filter using a Kaiser window. Ksr_HPF generates only the filter coefficients; it does not actually perform data filtering.
For more information, refer to Discrete-Time Signal Processing by Oppenheim and Schafer, cited in the Bibliography.
Example Code
/* Design a 55-point highpass FIR linear phase filter using a Kaiser window with beta = 4.5. Filter the incoming signal with the designed filter. */
double x[256], coef[55], y[310], fs, fc, beta;
n, m;
fs = 1000.0; /* sampling frequency */
fc = 200.0; /* desired cutoff frequency */
n = 55; /* filter length */
beta = 4.5;
m = 256;
Ksr_HPF (fs, fc, n, coef, beta);
Convolve (coef, n, x, m, y); /* Convolve the filter with the signal. **/
Parameters
Input | ||||||||||||||
Name | Type | Description | ||||||||||||
samplingFrequency | double | Sampling frequency in Hertz. | ||||||||||||
cutoffFrequency | double | Cutoff frequency in Hertz. | ||||||||||||
numberOfCoef | int | Length of the window FIR filter. numberOfCoef must be odd for this filter. |
||||||||||||
beta | double | The window shape used in the Kaiser window function. A larger beta results a narrower window. The following table lists some beta values and their equivalent windows.
|
||||||||||||
Output | ||||||||||||||
Name | Type | Description | ||||||||||||
coefficientArray | double [] | Calculated output window FIR filter 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. |
Additional Information
Library: Advanced Analysis Library
Include file: analysis.h
LabWindows/CVI compatibility: LabWindows/CVI 3.1 and later