Sampling: 'Time in Seconds' 'X (T) ' 'Continous Time Signal'
Sampling: 'Time in Seconds' 'X (T) ' 'Continous Time Signal'
t=-10:0.01:10;
fm=0.2;
x=cos(2*pi*fm*t);
fs1=1.2*fm;
fs2=2*fm;
fs3=8*fm;
n1=-4:1:4;
xn1=cos(2*pi*n1*fm/fs1);
subplot(221)
plot(t,x);
xlabel('time in seconds');
ylabel('x(t)');
title('continous time signal');
subplot(222)
stem(n1,xn1);
hold on;
plot(n1,xn1);
xlabel('n');
ylabel('x(n)');
title('discrete time signal with fs<2fm');
n2=-5:1:5;
xn2=cos(2*pi*n2*fm/fs2);
subplot(223)
stem(n2,xn2);
hold on;
plot(n2,xn2);
xlabel('n');
ylabel('x(n)');
title('discrete time signal with fs=2fm');
n3=-20:1:20;
xn3=cos(2*pi*n3*fm/fs3);
subplot(224)
stem(n3,xn3);
hold on;
plot(n3,xn3);
xlabel('n');
ylabel('x(n)');
title('discrete time signal with fs>2fm');
continous time signal discrete time signal with fs<2fm
1 1
0.5 0.5
x(n)
x(t)
0 0
-0.5 -0.5
-1 -1
-10 -5 0 5 10 -4 -2 0 2 4
time in seconds n
discrete time signal with fs=2fm discrete time signal with fs>2fm
1 1
0.5 0.5
x(n)
x(n)
0 0
-0.5 -0.5
-1 -1
-5 0 5 -20 -10 0 10 20
n n