Professional Documents
Culture Documents
Averaging The Signal or Smoothing Signal
Averaging The Signal or Smoothing Signal
clf;
R = 51;
d = 0.8*(rand(R,1) - 0.5);
m = 0:R-1;
s = 2*m.*(0.9.^m);
x = s+d';
subplot(2,1,1);
plot(m,d','r-',m,s,'g--',m,x,'b-.');
ylabel('Amplitude');
x1 = [0 0 x];
x2 = [0 x 0];
x3 = [x 0 0];
y = (x1 + x2 + x3)/3;
subplot(2,1,2);
plot(m,y(2:R+1),'r-',m,s,'g--');
ylabel('Amplitude');
10
d[n]
s[n]
5
Amplitude
x[n]
-5
0 5 10 15 20 25 30 35 40 45 50
Time index n
8
y[n]
6 s[n]
Amplitude
0
0 5 10 15 20 25 30 35 40 45 50
Time index n