0% found this document useful (0 votes)
47 views7 pages

DCS Lab 1

The document discusses sampling of continuous signals in MATLAB. It defines sampling and the Nyquist sampling theorem, which states that the sampling frequency must be at least twice the highest frequency of the signal. The document generates sine and cosine waves, performs under sampling, uniform sampling, and over sampling on a cosine signal, and observes the results. Uniform sampling accurately reconstructs the original signal while under and over sampling cause aliasing and redundancy respectively.

Uploaded by

harshith
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)
47 views7 pages

DCS Lab 1

The document discusses sampling of continuous signals in MATLAB. It defines sampling and the Nyquist sampling theorem, which states that the sampling frequency must be at least twice the highest frequency of the signal. The document generates sine and cosine waves, performs under sampling, uniform sampling, and over sampling on a cosine signal, and observes the results. Uniform sampling accurately reconstructs the original signal while under and over sampling cause aliasing and redundancy respectively.

Uploaded by

harshith
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/ 7

ECE4001 – Digital Communication Systems

Lab Task – 1

Name: Harshith C S

Reg No: 18BEC0585

Slot: L35+L36
Title: Sampling Theorem
Task No: 1

Date: 20/07/2020

Aim: To understand the basic signal processing functions of MATLAB and to generate sine and
cosine functions in both continuous and discrete form. To perform sampling on continuous signals
and to observe the different modes of sampling.

Theory:

Sampling is a process of converting continuous time and continuous amplitude signals into
discrete time and continuous amplitude signals. It is the first step employed in the conversion
of an analog signal to digital signal. Sampling involves generation of samples. A sample is a
value or set of values at a point in time and/or space. A sampler is a subsystem or operation
that extracts samples from a continuous signal.
Sampling is done in accordance with the sampling theorem also called Nyquist–Shannon
sampling theorem, after the scientists responsible for its development. It is a bridge between
the continuous-time signals and discrete-time signals.

According to sampling theorem, a continuous time signal can be represented in its samples
and can be recovered back when sampling frequency fs is greater than or equal to the twice
the highest frequency component of message signal. i. e. fs≥2fm.
In sampling, the number of samples produced per second is called sampling rate and it holds
a significant factor in determining how well the discrete conversion is faithful to its original
analog signal. The ideal sampling rate is called Nyquist rate. The Nyquist rate is twice the
bandwidth of a bandlimited function or a bandlimited channel. If it the sampling rate is less
than Nyquist rate it is termed as under sampling, if it is over the Nyquist rate it is termed as
over sampling and if it is equal to Nyquist rate it is termed as uniform sampling.
Programme:

1. For generation of signals

clc;
clear all;
t=0:0.001:0.4;
f=10;
y=sin(2*pi*f*t);
z=cos(2*pi*f*t);
figure
plot(t,y);
figure
plot(t,z);
figure
plot(t,y);
hold on
plot(t,z);
hold off
figure
subplot(2,1,1)
plot(t,y);
subplot(2,1,2)
plot(t,z);

2. For periodic Sequence

clc
clear all
close all
n = [0:4];
x = [1 1 2 -1 0];
subplot (2,1,1);
stem (n,x);
grid on;
axis ([0 14 -1 2]);
xlabel ('n');
ylabel ('x(n)');
title ('Sequence');
xtilde = [x,x,x];
length_xtilde = length (xtilde);
n_new = [0:length_xtilde-1];
subplot (2,1,2);
stem (n_new,xtilde,'r');
grid on;
xlabel ('n');
ylabel ('perodic x(n)');
title ('Periodic Sequence');
3. for Sampling

clc
clear all
close all
t=-5:0.01:5;
T=4;
fm=1/T;
x=cos(2*pi*fm*t);
subplot(2,2,1);
plot(t,x,'linewidth',3);
xlabel('Time');
ylabel('Amplitude');
grid;
title('Input Signal');
n1=-8:1:8;
fs1=1.6*fm;
fs2=2*fm;
fs3=4*fm;
x1=cos(2*pi*fm/fs1*n1);
subplot(2,2,2);
stem(n1,x1,'linewidth',3);
xlabel('Number of Samples');
ylabel('Amplitude');
title('Under Sampling')
hold on;
subplot(2,2,3);
plot(n1,x1,'linewidth',3);
xlabel('Time');
ylabel('Amplitude');
grid;
title('Under Sampling');
n2=-5:1:5;
x2=cos(2*pi*fm/fs2*n2);
figure
subplot(2,2,1);
stem(n2,x2,'linewidth',3);
xlabel('Number of Samples');
ylabel('Amplitude');
title('Uniform Sampling')
hold on;
subplot(2,2,2);
plot(n2,x2,'linewidth',3);
xlabel('Time');
ylabel('Amplitude');
grid;
title('Uniform sampling');
n3=-20:1:20;
x3=cos(2*pi*fm/fs3*n3);
subplot(2,2,3);
stem(n3,x3,'linewidth',3);
xlabel('Number of samples');
ylabel('Amplitude');
title('Over Sampling');
hold on;
subplot(2,2,4);plot(n3,x3,'linewidth',3);
xlabel('Time');
ylabel('Amplitude');
grid;
title('Over Sampling');

Graphical Output (Captured Photo)

1.
2.

3.
Result: The experiment was performed and the sampling of continuous signals was observed.
Under sampling, over sampling and its disadvantages over uniform sampling was understood.

Verification Signature

You might also like