CxEquiRpl_HPFiltering
Advanced Analysis Library Only
AnalysisLibErrType CxEquiRpl_HPFiltering (NIComplexNumber inputArray[], ssize_t numberOfElements, int numberOfCoeffs, double samplingFrequency, double passBand, double f2, NIComplexNumber outputArray[]);
Purpose
Filter the complex array using a optimal highpass FIR linear phase filter with equi-ripple characteristics.
Example Code
/* Design a 25-point highpass FIR filter and filter the complex incoming signal. */
complexnum x[256], y[280];
double input[256];
double fs, f1, f2;
int n, ncoef, i;
fs = 1000.0; // sampling frequency
f1 = 300.0; // pass band [0, 300]
f2 = 400.0; // stop band [400, fs/2]
n = 256; // input signal length
ncoef = 25; //filter length
WhiteNoise (n, 1, 17, input);
for(i = 0; i < n; i++){
x[i].real = input[i];
x[i].imaginary = input[i];
}
CxEquiRpl_HPFiltering(x, n, ncoef, fs, f1, f2, y);
Parameters
Input | ||
Name | Type | Description |
inputArray | NIComplexNumber [] | Array containing the raw data to filter. |
numberOfElements | ssize_t | Number of elements in the input array inputArray. |
numberOfCoeffs | int | Length of the FIR filter. numberOfCoeffs must be greater than 2. The algorithm introduces a large error when designing a highpass filter for an even number of ncoef. To avoid this error, the CxEquiRpl_HPFiltering adjusts the ncoef to the next higher odd value if ncoef is even. |
samplingFrequency | double | Sampling frequency in Hertz. |
f1 | double | Highest frequency of the stop band. The stop band is [0, f1]. |
f2 | double | Lowest frequency of the pass band. The pass band is [f2, samplingFreq/2]. |
Output | ||
Name | Type | Description |
outputArray | NIComplexNumber [] | Filtered data. This array must be at least ![]() ![]() |
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 2012 and later