Digital Signal Processing Reference
In-Depth Information
2
0
-2
0
100
200
300
400
500
600
700
800
1
0
-1
0
100
200
300
400
500
600
700
800
1
0
-1
0
1 0 0
2 0 0
3 0 0
4 0 0
5 0 0
6 0 0
7 0 0
8 0 0
1
0
-1
0
100
200
300
400
500
600
700
800
Number of samples
FIGURE 10.13
The waveforms for the unknown system's output, adaptive filter output, and error output.
% Bandpass filter design
% for the assumed unknown system using the bilinear transformation
%(BLT) method (see Chapter 8)
wd1
¼
1400*2*pi; wd2
¼
1600*2*pi;
wa1
¼
(2/T)*tan(wd1*T/2); wa2
¼
(2/T)*tan(wd2*T/2);
BW
wa2-wa1;
w0 ¼ sqrt(wa2*wa1);
[B,A] ¼ lp2bp([1],[1 1.4141 1],w0,BW);
[b,a] ¼ bilinear(B,A,fs);
freqz(b,a,512,fs); axis([0 fs/2 -80 1]); % Frequency response plots
figure
t ¼ 0:T:0.1; % Generate the time vector
x ¼ cos(2*pi*500*t) þ sin(2*pi*1500*t) þ cos(2*pi*2500*t þ pi/4);
d ¼ filter(b,a,x); % Produce unknown system output
mu ¼ 0.01; % Convergence factor
w ¼ zeros(1,21); y ¼ zeros(1,length(t)); % Initialize the coefficients and output
e ¼ y; % Initialize the error vector
% Perform adaptive filtering using LMS algorithm
for m ¼ 22:1:length(t)-1
sum ¼ 0;
for i ¼ 1:1:21
¼
 
Search WWH ::




Custom Search