0% found this document useful (0 votes)
84 views9 pages

Exp - No:4 Date:30.09.2020: Verification of Sampling Theorem

The document describes an experiment to verify the sampling theorem using MATLAB. It discusses the concepts of sampling, the sampling theorem, and Nyquist rate sampling. The algorithm generates an analog signal, then discrete time signals at over, Nyquist, and under sampling rates. When plotted, the under sampled signal is clipped while the Nyquist and over sampled signals reconstruct the original signal without clipping, verifying the sampling theorem.

Uploaded by

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

Exp - No:4 Date:30.09.2020: Verification of Sampling Theorem

The document describes an experiment to verify the sampling theorem using MATLAB. It discusses the concepts of sampling, the sampling theorem, and Nyquist rate sampling. The algorithm generates an analog signal, then discrete time signals at over, Nyquist, and under sampling rates. When plotted, the under sampled signal is clipped while the Nyquist and over sampled signals reconstruct the original signal without clipping, verifying the sampling theorem.

Uploaded by

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

Exp.

no:4
Date:30.09.2020
VERIFICATION OF SAMPLING THEOREM

AIM:
To verify sampling theorem using MATLAB software.
HARDWAREREQUIREMENTS:
Computer Desktop
SOFTWAREREQUIREMENTS:
Matlab 7or later version
THEORY:
Sampling: Is the process of converting a continuous time signal into a discrete time signal. It
isthefirst step in conversion from analog signal to digital signal.
Sampling theorem:Sampling theorem states that"Exact reconstruction of acontinuoustimebase-band
signal from its samples is possible, if the signal is band-limited and the sampling frequencyisgreaterthan
twicethe signal bandwidth", i.e. fs >2W, where ‘W’is thesignal bandwidth.
Nyquist Rate Sampling: The Nyquist rate is the minimum sampling rate required to avoidaliasing, equal
to the highest modulating frequency contained within the signal. In other words,Nyquist rate is equal to
two sided bandwidth of the signal (Upper and lower sidebands). To avoidaliasing,the sampling rate must
exceed theNyquist rate.
ALGORITHM:
 Input the desired frequency fd (for which sampling theorem is to be verified).
 Generate ananalog signal x to ffrequency fd for comparison.
 Generate over sampled,nyquist&under sampled discrete time signals.
 Plot the wave forms and hence prove sampling theorem.
PROGRAM:

clear
all;close
all;clc;
%sampling signal
f=input('Frequency');t
=-3:0.01:3;
x=cos(2*pi*f*t);
subplot(4,1,1);
plot(t,x);
title('Sampling signal');
1
COMMAND :

Frequency
2
samplingfrequency1:
3
Samplingfrequency2:
4
Samplingfrequency3:
5

FIGURE:

2
xlabel('Time');ylabel('Amplitude');
%Under sampling
signalfs1=input('sampling frequency
1:');t1=-
3*fs1:0.9:3*fs1;x1=cos(2*pi*f/fs1*t
1);subplot(4,1,2);
plot(t1/fs1,x1);
title('Under
samplingsignal');xlabel('Time');yla
bel('Amplitude');

%Nyquist sampling
signalfs2=input('Sampling frequency
2:');t2=-
3*fs2:0.3:3*fs2;x2=cos(2*pi*f/fs2*t
2);subplot(4,1,3);
plot(t2/fs2,x2);
title('Nyquist sampling
signal');xlabel('Time');ylabel('Ampl
itude');

%Over sampling
signalfs3=input('Sampling frequency
3:');t3=-

3
3*fs3:0.01:3*fs3;x3=cos(2*pi*f/fs3*
t3);subplot(4,1,4);
plot(t3/fs3,x3);
title('Over sampling
signal');xlabel('Time');ylabel('A
mplitude');

COMMAND:

Frequency
2
Samplingfrequency:
4

FIGURE:

4
5
PROGRAM:

clear
all;close
all;clc;
%sampling signal
f=input('Frequency');
t=-3:0.01:3;
x=sin(2*pi*f*t;
subplot(2,1,1);
plot(t,x);
title('Sampling signal');
xlabel('Time');
ylabel('Amplitude');
%Nyquist sampling signal
fs=input('Sampling frequency :');
t1=3*fs:0.3:3*fs;
x1=sin(2*pi*f/fs*t1);
subplot(2,1,2);
plot(t1/fs,x1);
title('Nyquist sampling signal')
;xlabel('Time');
ylabel('Amplitude');

6
7
INFERENCE:

UNDERSAMPLING:

In,undersampling signal,thereisclippingofinputsignal.

NYQUISTSAMPLING:

InNyquistsamplingsignal,thereisnoclippingofinputsignal.

OVERSAMPLING:

InOversamplingsignal,Iget aperfectinput signal.

RESULT:

Thus, thesampling theorem has been proved.

8
9

You might also like