Texas Instruments TMS320C64X Programmer's Reference Manual page 82

Dsp little-endian dsp library
Hide thumbs Also See for TMS320C64X:
Table of Contents

Advertisement

DSP_iir
DSP_iir
Function
Arguments
Description
Algorithm
4-54
IIR With 5 Coefficients
void DSP_iir (short * restrict r1, const short * restrict x, short * restrict r2, const
short * restrict h2, const short * restrict h1, int nr)
r1[nr+4]
Output array (used in actual computation. First four elements
must
have the previous outputs.)
x[nr+4]
Input array
r2[nr]
Output array (stored)
h2[5]
Moving-average filter coefficients
h1[5]
Auto-regressive filter coefficients. h1[0] is not used.
Number of output samples. Must be ≥ 8.
nr
The IIR performs an auto-regressive moving-average (ARMA) filter with 4
auto-regressive filter coefficients and 5 moving-average filter coefficients for
nr output samples.
This is the C equivalent of the assembly code without restrictions. Note that
the assembly code is hand optimized and restrictions may apply.
void DSP_iir(short *r1, short *x, short *r2, short *h2,
short *h1, int nr)
{
int j,i;
int sum;
for (i=0; i<nr; i++){
sum = h2[0] * x[4+i];
for (j = 1; j <= 4; j++)
sum += h2[j]*x[4+i−j]−h1[j]*r1[4+i−j];
r1[4+i] = (sum >> 15);
r2[i] = r1[4+i];
}
}

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tms320c64x+

Table of Contents