0% found this document useful (0 votes)
7 views2 pages

Eexxpp 5

The document presents a MATLAB code that demonstrates the Sampling Theorem using a continuous time signal and its discrete counterparts at different sampling frequencies. It includes plots for continuous and discrete signals sampled at frequencies less than, equal to, and greater than twice the maximum frequency of the original signal. The results illustrate the effects of sampling on the signal representation in the time domain.

Uploaded by

surajr1206
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Eexxpp 5

The document presents a MATLAB code that demonstrates the Sampling Theorem using a continuous time signal and its discrete counterparts at different sampling frequencies. It includes plots for continuous and discrete signals sampled at frequencies less than, equal to, and greater than twice the maximum frequency of the original signal. The results illustrate the effects of sampling on the signal representation in the time domain.

Uploaded by

surajr1206
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Exp 5 Sampling Theorem

Code:

clc;
clear all;
close all;
% Continous time signal
t=-10:.01:10;
T=4;
fm=1/T;
x=cos(2*pi*fm*t);
subplot(2,2,1); plot(t,x);
xlabel('time'); ylabel('x(t)'); title('continous time signal');
grid;
% Sampling Freuency
fs1=1.6*fm; % fs < 2fm
fs2=2*fm; % fs = 2fm
fs3=8*fm; % fs > 2fm
% Discrete time signal with fs<2fm
n1=-4:1:4;
x1=cos(2*pi*fm/fs1*n1);
subplot(2,2,2); stem(n1,x1);
xlabel('time'); ylabel('x(n)'); title('discrete time signal with fs<2fm');
hold on;
subplot(2,2,2);
plot(n1,x1);
grid;
% Discrete time signal with fs=2fm
n2=-5:1:5;
x2=cos(2*pi*fm/fs2*n2);
subplot(2,2,3);
stem(n2,x2);
xlabel('time'); ylabel('x(n)'); title('discrete time signal with fs=2fm');
hold on;
subplot(2,2,3);
plot(n2,x2)
grid;
% Discrete time signal with fs>2fm
n3=-20:1:20;
x3=cos(2*pi*fm/fs3*n3);
subplot(2,2,4);
stem(n3,x3);
xlabel('time'); ylabel('x(n)'); title('discrete time signal with fs>2fm')
hold on;
subplot(2,2,4);
plot(n3,x3)
grid;
Output :

x(n) x(t)

x(n) x(n)

You might also like