This routine implements a block FIR filter. There are “nh” filter coefficients, “nr” output samples, and “nh+nr-1” input samples. The coefficients need to be placed in the “h” array in reverse order {h(nh-1), ... , h(1), h(0)} and the array “x” starts at x(-nh+1) and ends at x(nr-1). The routine calculates y(0) through y(nr-1) using the following formula:
y(n) = h(0)*x(n) + h(1)*x(n-1) + ... + h(nh-1)*x(n-nh+1)
where n = {0, 1, ... , nr-1}.
- Parameters
-
x | Pointer to array holding the input floating-point array |
h | Pointer to array holding the coefficient floating-point array |
r | Pointer to output array |
nh | Number of coefficents |
nr | Number of output values |
- Algorithm:
- DSPF_sp_fir_gen_cn.c is the natural C equivalent of the optimized linear assembly code without restrictions. Note that the linear assembly code is optimized and restrictions may apply.
- Assumptions:
- nr is a multiple of 4 and greater than or equal to 4.
nh is a multiple of 4 and greater than or equal to 4.
x, h and r are double-word aligned.
- Implementation Notes:
- Interruptibility: The code is interruptible.
Endian Support: The code supports both big and little endian modes.