# IIRCascadeFiltering

Advanced Analysis Library Only

AnalysisLibErrType IIRCascadeFiltering (const double XArray[], int numXElements, IRFilterPtr filterInformation, double YArray[]);

## Purpose

Filters the input sequence using the cascade IIR filter specified by the filterInformation structure. Each of the IIR cascaded stages is second order for lowpass and highpass filters, and fourth order for bandpass and bandstop filters.

filterInformation is the pointer to the filter structure that contains the filter coefficients and the internal filter information. You must allocate this structure by calling AllocIIRFilterPtr and then call one of the cascade IIR design functions—Bw_CascadeCoef, Ch_CascadeCoef, Elp_CascadeCoef, InvCh_CascadeCoef, or Bessel_CascadeCoef—before you call IIRCascadeFiltering.

The filterInformation structure contains the internal filter state information for the filtering operation so you can call IIRCascadeFiltering in a loop to continually filter new input array data and produce new output filtered data.

If you finish filtering one set of input data and want to filter a completely new data set, call ResetIIRFilter before you call IIRCascadeFiltering with the new data. ResetIIRFilter causes the internal filter state information to clear before the next filtering operation.

## Parameters

Input
Name | Type | Description
XArray | const double-precision | Array that contains the raw data to filter.
numXElements | integer | The number of points in both the input XArray and output YArray.
filterInformation | IIRFilterPtr | Pointer to the filter structure that contains the filter coefficients and the internal filter information. You must allocate this structure by calling AllocIIRFilterPtr and then calling one of the cascade IIR design functions—Bw_CascadeCoef, Ch_CascadeCoef, Elp_CascadeCoef, InvCh_CascadeCoef, Bessel_CascadeCoef—before calling this function.
Output
Name | Type | Description
YArray | double-precision array | Array that contains the output of the IIR filtering operation. The size of this array must be at least numXElements.

## 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.