Digital Signal Processing Reference
In-Depth Information
5
xq(n)
4
yq(n)
3
2
1
0
-1
-2
x(t)
-3
-4
-5
0
5
10
15
20
25
30
35
40
45
50
Sample number
FIGURE 12.27
Comparisons of continuous, regular sampled, and oversampled signal amplitudes.
subplot(3,2,2);plot(f(1:NN/2),log10(Ak(1:NN/2)),
k
);grid;ylabel(
X(f)
); axis([0 500
'
'
'
'
-4 2])
subplot(3,2,3);plot(n,xq,
k
);grid;axis([0 500 -5 5]);ylabel(
xq(n)
);
'
'
'
'
Ak
Ak(1)/2;
subplot(3,2,4);plot(f(1:NN/2),log10(Ak(1:NN/2)),
¼
2*abs(fft(xq))/NN; Ak(1)
¼
k
);grid;ylabel(
Xq(f)
); axis([0 500
'
'
'
'
-4 2])
subplot(3,2,5);plot(n,yd,
'
k
'
);grid;axis([0 500 -5 5]);ylabel(
'
yq(n)
'
);
xlabel(
'
Sample number
'
);
Ak
¼
2*abs(fft(yd))/NN; Ak(1)
¼
Ak(1)/2;
subplot(3,2,6);plot(f(1:NN/2),log10(Ak(1:NN/2)),
'
k
'
);grid;ylabel(
'
Yq(f)
'
); axis([0 500
-4 2])
xlabel(
'
Frequency (Hz)
'
);
figure (3)
plot(n(1:50),x(1:50),
'
k
'
,
'
LineWidth
'
,2); hold % Plot of
rst 50 samples
stairs(n(1:50),xq(1:50),
'
b
'
);
stairs(n(1:50),yd(1
þ
nd:50
þ
nd),
'
r
'
,
'
LineWidth
'
,2);grid
axis([0 50 -5 5]);xlabel(
'
Sample number
'
);ylabel(
'
Amplitudes
'
)
snr(x,xq);
snr(x(1:ntotal-nd),yd(1
þ
nd:ntotal));
Search WWH ::
Custom Search