AN2108 Freescale Semiconductor / Motorola, AN2108 Datasheet - Page 38

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
_fract _X x[INPUT_LENGTH];/* Input signal
_fract _X d[INPUT_LENGTH];/* Desired signal
_fract _X y[INPUT_LENGTH];/* Filter output signal
_fract _X e[INPUT_LENGTH];/* Error signal
_fract _X *d_ptr=d;/* Pointer to desired signal
_fract _X *y_ptr=y;/* Pointer to output signal
_fract _X *e_ptr=e;/* Pointer to error signal
_fract mu2=0.02; /* FIR-LMS filter convergence factor. */
unsigned int count = INPUT_LENGTH; /* Data sample counter */
/* ------------------------------------------- *
void _long_interrupt(53) lms_isr(void)
{
38
Code Listing for FIR LMS Example
*
* ------------------------------------------- */
_fract Ke; /* Local variable for 2ue(n) */
*y_ptr = FDOR;
/* Calculate e(n) = d(n) - y(n) */
*e_ptr = (*d_ptr++) - (*y_ptr++);
count--;
if (count==0)
{
}
else
{
EFCOP output interrupt service routine.
FCSR.B.FDOIE = 0;
/* Adapt filter weights for next iteration */
Ke = mu2 * (*e_ptr++);
FKIR = Ke;
/* Load error constant into EFCOP’s FKIR
Programming the DSP56307/DSP56311 EFCOP in C
/* Get EFCOP output
/* Decrement data sample counter
/* If all input samples have been processed... */
/* Disable output interrupts to halt filtering */
Freescale Semiconductor, Inc.
/* Ke = 2*mu*e */
For More Information On This Product,
(triggers weight update)
Go to: www.freescale.com
*
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/

Related parts for AN2108