Texas Instruments TMS320C67 DSP Series Programmer's Reference Manual page 68

Library
Hide thumbs Also See for TMS320C67 DSP Series:
Table of Contents

Advertisement

Description
Algorithm
Special Requirements
r[nr]
Output array
index
Offset by which to start reading from the input array. Must be
multiple of 2.
Size of circular buffer x[] is 2^(csize+1) bytes. Must be 2 ≤
csize
csize ≤ 31.
Number of filter coefficients. Must be multiple of 2 and ≥ 4.
nh
nr
Size of output array. Must be multiple of 4.
This routine implements a circularly addressed FIR filter. 'nh' is the number of
filter coefficients. 'nr' is the number of the output samples.
This is the C equivalent for the assembly code. Note that the assembly code
is hand optimized and restrictions may apply.
void DSPF_sp_fircirc
index, int csize,
int nh, int nr)
{
int i, j;
//Circular Buffer block size = ((2^(csize + 1)) / 4)
//floating point numbers
int mod = (1 << (csize - 1));
float r0;
for (i = 0; i < nr; i++)
{
r0 = 0;
for (j = 0; j < nh; j++)
{
//Operation "% mod" is equivalent to "& (mod -1)"
//r0 += x[(i + j + index) % mod] * h[j];
r0 += x[(i + j + index) & (mod - 1)] * h[j];
}
r[i] = r0;
}
}
-
The circular input buffer x[] must be aligned at a 2^(csize+1) byte bound-
ary. csize must lie in the range 2 ≤ csize ≤ 31.
-
The number of coefficients (nh) must be a multiple of 2 and greater than
or equal to 4.
(float x[], float h[], float r[], int
DSPLIB Reference
DSPF_sp_fircirc
4-43

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C67 DSP Series and is the answer not in the manual?

Questions and answers

Table of Contents