Texas Instruments TMS320C64X Programmer's Reference Manual page 80

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

Advertisement

DSP_fir_sym
DSP_fir_sym
Function
Arguments
Description
Algorithm
4-52
Symmetric FIR Filter
void DSP_fir_sym (const short * restrict x, const short * restrict h, short * re-
strict r, int nh, int nr, int s)
x[nr+2*nh]
Pointer to input array of size nr + 2*nh. Must be double-word
aligned.
h[nh+1]
Pointer to coefficient array of size nh + 1. Coefficients are in
normal order and only half (nh+1 out of 2*nh+1) are required.
Must be double-word aligned.
r[nr]
Pointer to output array of size nr. Must be word aligned.
nh
Number of coefficients. Must be multiple of 8. The number of
original symmetric coefficients is 2*nh+1.
nr
Number of samples to calculate. Must be multiple of 4.
s
Number of insignificant digits to truncate; e.g., 15 for Q.15
input data and coefficients.
This function applies a symmetric filter to the input samples. The filter tap array
h[] provides 'nh+1' total filter taps. The filter tap at h[nh] forms the center point
of the filter. The taps at h[nh − 1] through h[0] form a symmetric filter about this
central tap. The effective filter length is thus 2*nh+1 taps.
The filter is performed on 16-bit data with 16-bit coefficients, accumulating
intermediate results to 40-bit precision. The accumulator is rounded and
truncated according to the value provided in 's'. This allows a variety of
Q-points to be used.
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_fir_sym(short *x, short *h, short *r, int nh, int nr,
int s)
{
int
long
long
for (j = 0; j < nr; j++) {
y0 = round;
for (i = 0; i < nh; i++)
i, j;
y0;
round = (long) 1 << (s − 1);

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tms320c64x+

Table of Contents