AN2108 Freescale Semiconductor / Motorola, AN2108 Datasheet - Page 24

no-image

AN2108

Manufacturer Part Number
AN2108
Description
AN2108 Programming the DSP56307/DSP56311 EFCOP in C Using Taskings Tool Suite
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
6.3 Adaptive FIR filter
6.3.1 Theory
24
Application Examples
After writing the filter coefficients to FCM, setting up DMA channels 0 and 1 for data transfer to/from the
EFCOP, and initializing the EFCOP itself, the program reads the input data from the
file, and then enables the EFCOP and the DMA channels to start the data transfers. (The EFCOP
automatically starts an FIR filtering calculation when data is written to the FDIR.) The DSP56300 core
then waits for DMA channel 1 to read the last sample from the FDOR. (DMA channel 1 is configured to
produce an interrupt on completion of its transfer of all samples.) During this waiting period, the
DSP56300 core is free to perform other tasks in parallel with the EFCOP. Finally, the output data samples
are written to the
tvecs\output.txt
The adaptive FIR filter example presented in this section represents a 200 sample input signal filtered by a
20 tap filter.
Figure 13 shows the generic structure of an adaptive FIR filter. The filter coefficients are time-varying
and are updated by an adaptation algorithm that modifies the coefficients so that the output signal of the
FIR filter, y(k), is as close as possible to some desired signal, d(k). Many different adaptation algorithms
exist. In this example, the well-known Least Mean Squares (LMS) algorithm is used. The filter
coefficients of Eq. (1) are modified at each time iteration according to the following update equation:
where:
9. The C Code for this example (firlms.c) is listed in Appendix B
w(k) is an N x 1 vector containing the filter coefficients at time k (assuming an N-tap filter).
x(k) is an N x 1 vector containing the N most recent input samples.
e(k) is the difference, at time k, between the desired signal, d(k), and the actual output of the filter,
y(k).
which the algorithm becomes unstable. This limit depends essentially on the power of the input
signal, x(k), and careful choice of
is a convergence factor that controls the speed of adaptation. ( has a maximum limit beyond
9
x(k)
out\output.txt
.
Programming the DSP56307/DSP56311 EFCOP in C
Freescale Semiconductor, Inc.
For More Information On This Product,
w k
Figure 13. Adaptive FIR Filter
+
file. This file should be identical to the reference file,
1
Go to: www.freescale.com
Adaptation
Algorithm
W(z)
=
is therefore necessary.)
w k
+
y(k)
2 e k x k
-
.
+
d(k)
S
e(k)
tvecs\input.txt
(2)

Related parts for AN2108