Anda di halaman 1dari 3

SAMPLING WITH THE EFFECT OF ALIASING:

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);
stem(n1,x1);%to plot sampled signal for fs<2fm
xlabel('value of n1');
ylabel('amplitude');
title('sampled signal at fs<2fm');

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

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

OUTPUT:

Anda mungkin juga menyukai