Adaptive Filtering - Texas Instruments TMS320C64X Programmer's Reference Manual

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

Advertisement

DSP_firlms2

4.1 Adaptive Filtering

DSP_firlms2
Function
Arguments
Description
Algorithm
Special Requirements
4-2
LMS FIR
long DSP_firlms2(short * restrict h, const short * restrict x, short b, int nh)
h[nh]
Coefficient Array
x[nh+1]
Input Array
b
Error from previous FIR
nh
Number of coefficients. Must be multiple of 4.
return long
Return value
The Least Mean Square Adaptive Filter computes an update of all nh
coefficients by adding the weighted error times the inputs to the original
coefficients. The input array includes the last nh inputs followed by a new
single sample input. The coefficient array includes nh coefficients.
This is the C equivalent of the assembly code without restrictions. Note that
the assembly code is hand optimized and restrictions may apply.
long DSP_firlms2(short h[ ],short x[ ], short b,
int nh)
{
int
long
r = 0;
for (i = 0; i < nh; i++) {
h[i] += (x[i] * b) >> 15;
r += x[i + 1] * h[i];
}
return r;
}
-
This routine assumes 16-bit input and output.
-
The number of coefficients nh must be a multiple of 4.
i;

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tms320c64x+

Table of Contents