5.5.1 FIRStruct
Description
FIRStruct describes the filter structure for any of the FIR filters.
Declaration
typedef struct {
int numCoeffs;
fractional* coeffsBase;
fractional* coeffsEnd;
fractional* delayBase;
fractional* delayEnd;
fractional* delay;
} FIRStruct;
Parameters
Parameters | Description |
---|---|
numCoeffs |
Number of filter coefficients (also M) |
coeffsBase |
Base address for filter coefficients (also h) |
coeffsEnd |
End address for filter coefficients |
delayBase |
Base address for delay buffer |
delayEnd |
End address for delay buffer |
delay |
Current value of delay pointer (also d) |
Remarks
The number of filter coefficients is M.
Coefficients, h[m], defined in 0 ≤ m < M, either within X-Data space or program memory.
Delay buffer d[m], defined in 0 ≤ m < M, only in Y-Data space.
delayBase points to the actual address where the delay buffer is allocated.
delayEnd is the address of the last byte of the filter delay buffer.
When the coefficients and delay buffers are implemented as circular increasing modulo buffers, both coeffsBase and delayBase must be aligned to a zero power of two for each address (coeffsEnd and delayEnd are odd addresses). Whether these buffers are implemented as circular increasing modulo buffers or not is indicated in the remarks section of each FIR filter function description.
When the coefficients and delay buffers are not implemented as circular (increasing) modulo buffers, coeffsBase and delayBase do not need to be aligned to a zero power of two address, and the values of coeffsEnd and delayEnd are ignored within the particular FIR Filter function implementation.