Digital Signal Processing Reference
In-Depth Information
void main()
{
int T=0, i=0;
for (i = 0; i < WLENGTH; i++)
{
w[i] = 0.0;
//init coeff for adaptive FIR
dly_adapt[i] = 0;
//init buffer for adaptive FIR
}
for (T = 0; T < N; T++)
dly_fix[T] = 0;
//init buffer for fixed FIR
sreg.regval=0xFFFF;
//initial seed value
fb = 1;
//initial feedback value
comm_intr();
//init DSK, codec, McBSP
while (1);
//infinite loop
}
FIGURE 7.19. ( Continued )
output ( fir_out ) of the fixed FIR bandpass filter centered at 2 kHz and represented
by the coefficient file bp55.cof . It can be observed that this output is practically
identical to the adaptive filter's output.
Edit the main program to include the coefficient file BS55.cof (introduced in
Example 4.4), which represents an FIR bandstop filter with 55 coefficients centered
at 2 kHz. The FIR bandstop filter represents the unknown system to be identified.
Rebuild/run and verify that the output of the adaptive FIR filter (with the slider
in position 1) is practically identical to the FIR bandstop filter (with the slider in
position 2). Increase (decrease) beta by a factor of 10 to observe a faster (slower)
rate of convergence. Change the number of weights (coefficients) from 60 to 40 and
verify a slight degradation of the identification process.
Example 7.5: Adaptive FIR for System ID of a Fixed FIR as an
Unknown System with Weights of an Adaptive Filter Initialized
as an FIR Bandpass ( adaptIDFIRw )
The program adaptIDFIR.c in Example 7.4 is modified slightly to create the
program adaptIDFIRW.c (on the CD). This new program initializes the weights
of the adaptive FIR filter with the coefficients of an FIR bandpass filter centered at
3 kHz and represented by the coefficient file bp3000.cof (on the CD). The weights
w [i] within the function main are initialized with the coefficients in the file
bp3000.cof in lieu of zero.
Build this project as adaptIDFIRw . Initially, the spectrum of the output of the
adaptive FIR filter shows the FIR bandpass filter centered at 3 kHz. Then, gradu-
ally, the output spectrum adapts (converges) to the fixed (unknown) FIR bandpass
filter centered at 2 kHz (represented by bp55.cof ), while the reference filter
Search WWH ::




Custom Search