Admin Production ni-theme
Current Publication

CxElp_BPF

LabWindows/CVI

CxElp_BPF

Advanced Analysis Library Only

AnalysisLibErrType CxElp_BPF (NIComplexNumber inputArray[], ssize_t numberOfElements, double samplingFrequency, double lowerCutoffFreq, double upperCutoffFreq, double rippledb, double stopBandAttendb, int order, NIComplexNumber outputArray[]);

Purpose

Filters the complex input array using an elliptic bandpass digital filter. CxElp_BPF can perform the operation in place; that is, the input and output arrays can be the same.

Example Code

/* Generate a random signal and filter it using a fifth-order bandpass elliptic filter. The pass band is from 200.0 to 300.0. */
NIComplexNumber x[256];
double input[256];
double fs, fl, fh, ripple, atten;
ssize_t n;
int order;
int status;
int i;

n = 256;
fs = 1000.0;
fl = 200.0;
fh = 300.0;
order = 5;
ripple = 0.2;
atten = 60.0;
WhiteNoise (n, 1, 17, input);
for(i = 0; i < n; i++){

x[i].real = input[i];
x[i].imaginary = input[i];

}
status = CxElp_BPF (x, n, fs, fl, fh, ripple, atten, order, NULL);

Parameters

Input
Name Type Description
inputArray NIComplexNumber [] Array containing the raw data to filter.
numberOfElements ssize_t Number of elements in both the input and output array.
samplingFrequency double The frequency in Hertz at which you want to sample inputArray. This value must be greater than 0.
lowerCutoffFreq double Lower cutoff frequency in Hertz. This value must be 0 < lowerCutoffFreq < upperCutoffFreq < 0.5 * samplingFrequency.
upperCutoffFreq double Upper cutoff frequency in Hertz. This value must be 0 < lowerCutoffFreq < upperCutoffFreq < 0.5 * samplingFrequency.
ripple_db double The amplitude of the stop band ripple in decibels. This value must be greater than 0.

Default Value: 0.1 db.
stopBandAtten_db double Stop band attenuation in decibels. This value must be greater than 0.

Default Value: 40.0 db.
order int Filter order. This value must be greater than 0.

Default Value: 5.
Output
Name Type Description
outputArray NIComplexNumber [] Filtered data.

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