An analog signal yt sin500pi t pi4 sin1200 pi t is sampled
An analog signal y(t) sin(500pi t + pi/4) + sin(1200 pi t) is sampled at a rate of f_s = 700Hz to produce a discrete-time signal y[n] as the following figure. Write a MATLAB code to perform following tasks: Generate 1400 samples of signal y[n]. Use fft command, compute the 1024-point Discrete Fourier Transform of y[n] and plot the magnitude spectrum of y[n] with frequency axis in Hz. From the magnitude spectrum in (b-iii), determine all the frequency components present in signal y[n] in the frequency region 0 Hz to 700Hz. Explain why these frequencies exist in the spectrum. The signal y[n] is input to a three-sample averaging system to produce the output p[n] = (y[n] + y[n - 1] + y[n - 2])/3. Implement this averaging system and plot the first 100 samples of y[n] and p[n].
Solution
% Verifying the Sampling theorem
t=-10:0.001:10;
% continuous time signal x(t)
fm=0.1;
xt=cos(2*pi*fm*t);
subplot(2,2,1);plot(t,xt);
title(\'continuous time signal x(t)\');
% sampled signal with fs<2fm
fs1=0.1;
n1=-5:5;
x1n=cos(2*pi*fm*n1/fs1);
subplot(2,2,2);stem(n1,x1n);
title(\'sampled signal signal with fs<2fm\');
% sampled signal with fs=2fm
fs2=0.2;
n2=-5:5;
x2n=cos(2*pi*fm*n2/fs2);
subplot(2,2,3);stem(n2,x2n);
title(\'sampled signal signal with fs=2fm\');
% sampled signal with fs>2fm
fs3=0.8;
n3=-10:10;
x3n=cos(2*pi*fm*n3/fs3);
subplot(2,2,4);stem(n3,x3n);
title(\'sampled signal signal with fs>2fm\');
Result:
The Sapling theorem for different sampling conditions was verified and plotted.
![An analog signal y(t) sin(500pi t + pi/4) + sin(1200 pi t) is sampled at a rate of f_s = 700Hz to produce a discrete-time signal y[n] as the following figure. An analog signal y(t) sin(500pi t + pi/4) + sin(1200 pi t) is sampled at a rate of f_s = 700Hz to produce a discrete-time signal y[n] as the following figure.](/WebImages/1/an-analog-signal-yt-sin500pi-t-pi4-sin1200-pi-t-is-sampled-969303-1761495670-0.webp)