0% found this document useful (0 votes)
15 views4 pages

Experiment 04 Communication

The experiment aims to verify the sampling theorem by plotting a signal with two frequency components under three sampling conditions: fs < 2fm, fs = 2fm, and fs > 2fm. MATLAB is used to generate the original signal, sample it at different rates, and plot the original and sampled signals. When fs < 2fm, aliasing occurs due to under-sampling. When fs = 2fm, ideal sampling is possible without information loss. When fs > 2fm, over-sampling results in redundant information without affecting reconstruction.

Uploaded by

Dharminder Saini
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)
15 views4 pages

Experiment 04 Communication

The experiment aims to verify the sampling theorem by plotting a signal with two frequency components under three sampling conditions: fs < 2fm, fs = 2fm, and fs > 2fm. MATLAB is used to generate the original signal, sample it at different rates, and plot the original and sampled signals. When fs < 2fm, aliasing occurs due to under-sampling. When fs = 2fm, ideal sampling is possible without information loss. When fs > 2fm, over-sampling results in redundant information without affecting reconstruction.

Uploaded by

Dharminder Saini
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/ 4

Experiment 04

Aim: To verify the Sampling Theorem and plotting its graph


Apparatus Required: MATLAB Software
Theory:
The Sampling Theorem states that a continuous-time signal, if it is band-limited (i.e., it has
no frequency components above a certain maximum frequency, denoted as "fm"), can be
exactly and completely reconstructed from its samples if it is sampled at a rate at least twice
the maximum frequency component in the signal. This minimum sampling rate is called the
Nyquist rate and is denoted as "fs."
The conditions fs < 2fm, fs = 2fm and fs > 2fm are crucial in understanding the Sampling
Theorem and their implications on signal sampling. Let's examine each condition in detail:

1. fs < 2fm:
Condition: When the sampling frequency fs is less than twice the maximum frequency
component fm in the signal, i.e., fs < 2fm
Implications:
→Aliasing: This condition leads to aliasing, a phenomenon where higher frequency
components "fold" into lower frequency regions, making it impossible to accurately
reconstruct the original signal. Aliasing distorts the signal and introduces errors during
reconstruction.
→Under sampling: This situation is referred to as under sampling, and it violates the
Nyquist theorem. It is crucial to avoid this condition when sampling signals to ensure
accurate reconstruction.

2. fs = 2fm
Condition: When the sampling frequency fs is exactly equal to twice the maximum
frequency component fm in the signal, i.e., fs = 2fm.
Implications:
→Nyquist Rate: This represents the Nyquist rate, the minimum sampling rate required to
theoretically reconstruct the signal without aliasing or loss of information.
→Ideal Sampling: At this rate, the signal can be perfectly sampled without any loss of
information, assuming the signal is band-limited and the ideal reconstruction method is
used.
3. fs > 2fm

Condition: When the sampling frequency fs exceeds twice the maximum frequency
component fm in the signal, i.e., fs > 2fm
Implications:
→Over-Sampling: This condition represents over-sampling, where the sampling rate is
higher than necessary to satisfy the Nyquist criterion.
→Redundant Information: While over-sampling doesn't harm the reconstruction process,
it results in redundant information, potentially increasing computational load and data
storage requirements.

Algorithm:
1. Initialize variables: Define the frequencies f1 and f2, the time vector t, and the
original signal x as a sum of two cosine signals.
2. Plot the original signal: Create Figure 1 and plot the original signal x against time t.
3. Case 1: (fs < 2fm)
o Define the sampling frequency fs1 and calculate the sampling period ts1.
o Generate the sampled signal xs1 by sampling the original signal using fs1.
o Create Figure 2, stem plot xs1 against the sampled time vector n1, and overlay it
with the original signal.
o Add a legend indicating "fs<2fm."
4. Case 2: (fs = 2fm)
o Repeat steps similar to Case 1, but for a sampling frequency fs2 equal to 2*f2.
o Create Figure 3, stem plot xs2 against the sampled time vector n2, and overlay it
with the original signal.
o Add a legend indicating "fs=2fm."
5. Case 3: (fs > 2fm)
o Repeat steps similar to Case 1, but for a higher sampling frequency fs3 equal to
7*f2.
o Create Figure 4, stem plot xs3 against the sampled time vector n3, and overlay it
with the original signal.
o Add a legend indicating "fs>2fm."
6. Display all plots: All three cases of sampled signals are now displayed alongside the
original signal for visual comparison.
MATLAB Code:

%% SAMPLING
clc;
clear all;
close all;
f1 = 3;
f2 = 23;
t = -0.4:0.0001:0.4;
x = cos(2*pi*f1*t) + cos(2*pi*f2*t);
figure(1);
plot(t,x,'-.r');
xlabel('Time----->');
ylabel('Amplitude');
title('Original Signal');

%CASE 1: (fs < 2fm)


fs1 = 1.4*f2;
ts1 = 1/fs1;
n1 = -0.4:ts1:0.4;
xs1 = cos(2*pi*f1*n1) + cos(2*pi*f2*n1);
figure(2);
stem(n1,xs1);
hold on;
plot(t,x,'-.r');
hold off;
legend("fs<2fm");

%CASE 2: (fs = 2fm)


fs2 = 2*f2;
ts2 = 1/fs2;
n2 = -0.4:ts2:0.4;
xs2 = cos(2*pi*f1*n2) + cos(2*pi*f2*n2);
figure(3);
stem(n2,xs2);
hold on;
plot(t,x,'-.r');
hold off;
legend("fs=2fm");

%CASE 3: (fs > 2fm)


fs3 = 7*f2;
ts3 = 1/fs3;
n3 = -0.4:ts3:0.4;
xs3 = cos(2*pi*f1*n3) + cos(2*pi*f2*n3);
figure(4);
stem(n3,xs3);
hold on;
plot(t,x,'-.r');
hold off;
legend("fs>2fm");
Output:

Fig 4.1:Original Signal Fig 4.2: When fs<2fm

Fig 4.3: When fs=2fm Fig 4.4: when fs>2fm

Result: Thus we have studied the Verification of the Sampling Theorem and also observe its
waveforms for the three conditions i.e. fs < 2fm, fs = 2fm and fs > 2fm.

You might also like