Sampling With The Effect of Aliasing (Reconstructed)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

SAMPLING WITH THE EFFECT OF ALIASING(reconstructed):

clc;
t=-10:0.01:10;
fm=0.25;
x=cos(2*pi*fm*t);
fs1=1.6*fm; %fs<2fm
fs2=2*fm;%fs=2fm
fs3=8*fm;%fs>2fm

n1=-4:1:4;
x1=cos(2*pi*n1*fm/fs1);
subplot(2,2,1);
plot(t,x);%to plot input wave coswt
xlabel('time');
ylabel('amplitude');
title('input analog signal');

subplot(2,2,2);
plot(n1,x1);%to plot sampled signal for fs<2fm
xlabel('time');
ylabel('amplitude');
title('Reconstructed signal with aliasing fs<2fm');

n2=-5:1:5;
x2=cos(2*pi*n2*fm/fs2);
subplot(2,2,3);
plot(n2,x2);%to plot sampled signal for fs=2fm
xlabel('time');
ylabel('amplitude');
title('Reconstructed signal at fs=2fm');

n3=-20:1:20;
x3=cos(2*pi*n3*fm/fs3)
subplot(2,2,4);
plot(n3,x3);%to plot sampled signal for fs>2fm
xlabel('time');
ylabel('amplitude');
title('Reconstructed signal at fs>2fm');

OUTPUT:

You might also like