436 CHAPTER 7: Sampling Theory
0 2 4 601234x(t),y(t)− 10 − 5 0 500.511.52f (KHz)−0.4−0.2 0 0.200.511.52f (KHz)0
0.010.020.030.040.0501234t (sec)t (sec) ×^10 −^3|Y(Ω)||X(Ω)|xr(t
)(a) (b)0 2 4 6
01234t (sec)x(t),y(t)Analog signal
Sampled signalAnalog signal
Sampled signal− 10 − 5 0 500.511.52f (KHz)− 3 − 2 − 1 0 1 200.511.52f (KHz)0 2 4 601234t (sec)|Y(Ω)|× 10 −^3× 10 −^3|X(Ω)|xr(t
)FIGURE 7.9
Sampling ofx(t)= 2 −cos( 500 πt)−sin( 1000 πt)with (a) no aliasing (fs= 6000 samples/sec) and (b) with
aliasing (fs= 800 samples/sec).y1(1:delta:L) = x(1:delta:L);
y = x(1:delta:L);
% analog FT and DTFT of signals
dtx = 1/fsim;
X = fftshift(abs(fft(x)))∗dtx;
N = length(X); k = 0:(N−1); fx = 1/N.*k; fx = fx∗fsim/1000−fsim/2000;
dty = 1/fs;
Y = fftshift(abs(fft(y)))∗dty;
N = length(Y); k = 0:(N−1); fy = 1/N.*k; fy = fy∗fs/1000−fs/2000;The following function computes the sinc interpolation of the samples.function [t,xx,xr] = sincinterp(x,Ts)
%
% Sinc interpolation
% x sampled signal
% Ts sampling period of x
% xx,xr original samples and reconstructed in range t
%
N = length(x)
t = 0:dT:N;
xr = zeros(1,N∗ 100 +1);
for k = 1:N,