![]() |
![]() |
Collaboration diagram for DSPF_sp_fir_gen:
|
| void | DSPF_sp_fir_gen (const float *restrict x, const float *restrict h, float *restrict r, int nh, int nr) |
| void DSPF_sp_fir_gen | ( | const float *restrict | x, | |
| const float *restrict | h, | |||
| float *restrict | r, | |||
| int | nh, | |||
| int | nr | |||
| ) |
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}.
| 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 |