Table 8.8 List of C program for Experiment 8B
/*
exp8b.c À Experiment 8B, Adaptive linear predictor
*/
#define N 48
/* Adaptive FIR filter order
*/
#define Ns 256
/* Number of input signal per block */
#pragma DATA_SECTION(e, "lms_err");
#pragma DATA_SECTION(y, "lms_out");
#pragma DATA_SECTION(x, "lms_in");
#pragma DATA_SECTION(d, "lms_data");
#pragma DATA_SECTION(w, "lms_coef");
#pragma DATA_SECTION(index, "lms_data");
#pragma CODE_SECTION(main, "lms_code");
int e [Ns],
/* Error signal buffer
*/
y [Ns],
/* Output signal buffer
*/
in [Ns],
/* Input signal buffer
*/
w [N],
/* Filter coefficient buffer */
x [N],
/* Filter signal buffer
*/
index;
extern void init(int *, unsigned int);
extern unsigned int alp(int *, int *, int *, int *, int *,
unsigned int, unsigned int, unsigned int);
extern void cos_rand(int *, unsigned int);
void main(void)
{
init(x,N);
/* Initialize x []to zero */
init(w,N);
/* Initialize w []to zero */
index 0;
for(;;)
{
cos_rand(x, Ns);
/* Generate testing signal */
index alp(in, y, e, x, w, Ns, N, index); /* Adaptive predictor */
}
}
4. Verifythe adaptive linear predictor and compare the results with Figure 8.13.
5. Verifythe adaptation process byviewing how the adaptive coefficients w []are
adjusted. Record the steady-state values of w [], and plot the magnitude response
of the adaptive filter.
6. Change the order of the adaptive filter and observe the system performance.
7. Adjust adaptation step size and observe the system performance.
EXPERIMENTS USING THE TMS320C55X
395