# AllocIIRFilterPtr

Advanced Analysis Library Only

IIRFilterPtr AllocIIRFilterPtr (int type, int order);

## Purpose

Allocates and initializes the filterInformation structure. This function returns a pointer to the filter structure for use with the IIR cascade filter coefficient design calls.

You input the type of the filter, such as lowpass, highpass, bandpass, or bandstop, and the order. AllocIIRFilterPtr allocates the filter structure and the internal coefficient arrays and internal filter state array.

## Parameters

Input
Name | Type | Description
type | integer | Controls the filter type of IIR filter coefficients. lowpass = 0 (default) highpass = 1 bandpass = 2 bandstop = 3
order | integer | The order of the IIR filter. The default value is 3.

## Return Value

Name | Type | Description
filterInformation | IIRFilterPtr | Pointer to the filter structure that contains the filter coefficients and the internal filter information. Call this function to allocate filterInformation before you call one of the cascade IIR filter design functions. When an error occurs, filterInformation is zero. The definition of the filter structure is as follows: typedef struct { intnum type; /* type of filter (lp, hp, bp, bs) */ intnum order /* order of filter */ intnum reset; /* 0 - don't reset, 1 - reset */ intnum na; /* number of a coefficients */ floatnum *a; /* pointer to a coefficients */ intnum nb; /* number of b coefficients */ floatnum *b; /* pointer to b coefficients */ intnum ns; /* number of internal states */ floatnum *s; /* pointer to internal state array */ } *IIRFilterPtr;