Admin Production ni-theme
Current Publication

Bw_HPF

LabWindows/CVI

Bw_HPF

Advanced Analysis Library Only

AnalysisLibErrType Bw_HPF (double inputArray[], ssize_t numberOfElements, double samplingFrequency, double cutoffFrequency, int order, double outputArray[]);

Purpose

Filters the input array using a Butterworth highpass digital filter. Bw_HPF 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 highpass Butterworth filter. */
double x[256], y[256], fs, fc;
ssize_t n; int status, order;
n = 256;
fs = 1000.0;
fc = 200.0;
order = 5;
Uniform (n, 17, x);
status = Bw_HPF (x, n, fs, fc, order, y);

Parameters

Input
Name Type Description
inputArray double [] 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.
cutoffFrequency double Cutoff frequency of the filter in Hertz. This value must be 0 < cutoffFrequency < 0.5 * samplingFrequency.
order int Filter order. This value must be greater than 0.

Default Value: 5.
Output
Name Type Description
outputArray double [] 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 3.1 and later

Example

Refer to apps\sigproc\sigproc.cws for an example of using the Bw_HPF function.