Thursday 10 December 2015

MATLAB CODE FOR SAMPLING THEOREM

SAMPLING THEOREM: 
              In the field of digital signal processing, the sampling theorem is a fundamental bridge between continuous-time signals (often called "analog signals") and discrete-time signals (often called "digital signals").
To understand sampling theorem the following matlab code is useful.

MATLAB CODE:


%Program for sampling theorem
f1=1/128;
f2=5/128;
n=0:255;
fc=50/128;
x=cos(2*pi*f1*n)+cos(2*pi*f2*n);
xa=cos(2*pi*fc*n);
xamp=x.*xa;
subplot(2,2,1);
plot(n,x);
title('x(n)');
xlabel('Sn-->');
ylabel('Amplitude');
subplot(2,2,2);
plot(n,xa);
title('xa(n)');
xlabel('n-->');
ylabel('Amplitude');
subplot(2,2,3);
plot(n,xamp);
xlabel('n-->');
ylabel('Amplitude');

 For MORE DETAILS CLICK HERE

No comments:

Post a Comment