DSPF_sp_lms
4.1 Adaptive Filtering
DSPF_sp_lms
Function
Arguments
Description
Algorithm
4-2
Single-precision floating-point LMS algorithm
float DSPF_sp_lms (float *x, float *h, float *desired, float *r, float adaptrate,
float error, int nh, int nr)
x
Pointer to input samples
h
Pointer to the coefficient array
desired
Pointer to the desired output array
r
Pointer to filtered output array
adaptrate
Adaptation rate
error
Initial error
nh
Number of coefficients
nr
Number of output samples
The DSPF_sp_lms implements an LMS adaptive filter. Given an actual input
signal and a desired input signal, the filter produces an output signal, the final
coefficient values, and returns the final output error signal.
This is the C equivalent of the assembly code without restrictions. Note that
the assembly code is hand optimized and restrictions may apply.
float DSPF_sp_lms(float *x,float *h,float *y,int nh,float
*d,float ar, short nr, float error)
{
int i,j;
float sum;
for (i = 0; i < nr; i++)
{
for (j = 0; j < nh; j++)
{
h[j] = h[j] + (ar*error*x[i+j-1]);
}
sum = 0.0f;
for (j = 0; j < nh; j++)
Need help?
Do you have a question about the TMS320C67 DSP Series and is the answer not in the manual?
Questions and answers