Digital Signal Processing Reference
In-Depth Information
2
1
0
-1
-2
0
100
200
300
400
500
600
700
800
2
1
0
-1
-2
0
100
200
300
400
500
600
700
800
Number of samples
FIGURE 10.16
Noisy signal and enhanced signal.
over the entire bandwidth. The bottom plot is the enhanced signal spectrum. Since the method is
adaptive, it is especially effective when the enhanced signal frequency is changing with time. Program
10.3 lists the MATLAB program for this simulation.
Program 10.3. MATLAB program for adaptive line enhancement.
close all; clear all
fs
1/fs; % Sampling rate and sampling period
t ¼ 0:T:0.1; % 1 second time instant
n ¼ randn(1,length(t)); % Generate Gaussian random noise
d ¼ cos(2*pi*500*t) þ n; % Generate 500-Hz tone plus noise
x ¼ filter([ 0 0 0 0 0 0 0 1 ],1,d); % Delay filter
mu ¼ 0.001; % Initialize the step size for LMS algorithms
w ¼ zeros(1,21); % Initialize the adaptive filter coefficients
y ¼ zeros(1,length(t)); % Initialize the adaptive filter output
e ¼ y; % Initialize the error vector
% Perform adaptive filtering using the LMS algorithm
for m ¼ 22:1:length(t)-1
sum ¼ 0;
for i ¼ 1:1:21
sum ¼ sum þ w(i)*x(m-i);
¼
8000; T
¼
 
Search WWH ::




Custom Search