Professional Documents
Culture Documents
Student Id No:150060031
Name:ch.sairam
Lab Section:
Branch: EEE
Id No:150060022
Pre-lab Session
work (15M)
Date:
Project Group:
In-Lab Session
work (15M)
Viva
(10M)
Total Marks
50M
Marks awarded
Objective: The objective of this Lab is to understand concepts and observe the effects
of periodically sampling a continuous signal at different sampling rates, changing the
sampling rate of a sampled signal, aliasing, and anti-aliasing filters.
Introduction: The signals we use in the real world, such as our voices, are called
"analog" signals. To process these signals in digital computers or digital systems, we
need to convert the signals to "digital" form. While an analog signal is continuous in both
time and amplitude, a digital signal is discrete in both time and amplitude. To convert a
signal from continuous time to discrete time, a process called sampling is used. The
value of the signal is measured at certain intervals in time. Each measurement is
referred to as a sample. The analog signal is also quantized in amplitude, but that
process is ignored in this demonstration.
Sampling Theorem: The sampling theorem can be defined in two ways as below.
Time domain Statement: A band limited signal having no frequency components higher
than f m Hz may be completely recovered from the knowledge of its samples taken at
the rate of at least 2 f m samples per second.
Student Id No:150060031
The uniform sampling and reconstruction process is illustrated in Fig.1. Let us consider a
( ) is
band limited signal x(t ) having no frequency components beyond f m Hz, i.e., X
zero for | | m , where m 2 f m . When this signal is multiplied by a periodic
impulse function T (t ) (with period T ), the product yields a sequence of impulses
located at uniform intervals of T seconds. The strength of resulting impulses is equal to
the value of x(t ) at the corresponding instants.
The Fourier transforms of the band limited signal x(t ) and the impulse train T (t )
( ) and s () shown in Fig 2(a) and (b) respectively. The product of x(t ) and
are X
Student Id No:150060031
We know that the Fourier Transform of periodic impulse train is also periodic function
( ) and s () represents
Thus the spectrum X
s ( ) is obtained by convolving X
X
( ) repeating every s rad/sec. It is obvious from X
s ( ) shown in Fig 2(c), that
X
( ) will repeat periodically without overlapping provided s 2m or
2
2(2 f m ) .
T
Signal Recovery from its samples: It can be shown that the original signal x(t )
can be recovered by passing its sampled version through a LPF with a cut off frequency
f c f m or c m ).
Let the function x(t ) is sampled at Nyquist rate s , then we have s 2 m .
Therefore X
s( )
1
X (- m
T m
s)
1
X (- 2m
T m
m) .
,| |< c
T
0, | |> c
( )
The LPF transfer function is given by H
Then X
r ( )X
s ( H) ( ) or
Student Id No:150060031
x r (t ) x s (t ) I.F.T H
( )
x s (t ) T
s
Sa
{ mt } x s t( ) Sa { mt }
2
x n (t nT ) Sa
{ mt }
Sa { m t(
nT )}
Sa ( mt
n )
This equation represents the function x r (t ) (or equivalent to x(t ) ) can be constructed by
s 2m (or
f s 2 f m ), the spectrum of
( ) the spectrum of
When s 2m , X
x(t ) is no longer replicated in X
s ( ) and thus
no longer recoverable by low pass filtering.
This effect in which the individual terms
4
Student Id No:150060031
f0=1000;%Freqyency of sin
fs1=10000;%Sampling Frequency Fs>2Fm
fs2=1500;%Sampling Frequency Fs<2Fm
n=0:1:20;
x=cos(2*pi*f0*n/fs1);
x1=cos(2*pi*f0*n/fs2);
figure ()
plot(n,x, 'm','LineWidth',2); title('Original Signal');
figure();
plot(n,x, 'b','LineWidth',2);hold on
stem(n,x,'--r','fill','LineWidth',2);
plot(n,x1,'k','LineWidth',2);
title('Sampling');
legend('Original Signal','Sampling with Fs>2Fm','Sampling With Fs<2Fm');
Student Id No:150060031
b)
clear all; close all; clc;
clear all; clf
% sinusoids
omega_0 = 1;omega_s = 7;
T = 2* pi/omega_0;
t = 0:0.001:2*T; % a period of x1
x1 = cos(omega_0* t);
x2 = cos((omega_0 + omega_s)*t);
N = length(t);
Ts = 2*pi/omega_s; % sampling period
M = fix(Ts/0.001);
imp = zeros(1,N);
for k = 1:M:N-1.
imp(k) = 1; % sequence of impulses
end
xs = imp.*x1; % sampled signal
plot(t,x1,'b',t,x2,'k'); hold on
stem(t,imp.*x1,'r','filled');
axis([0 max(t) -1.1 1.1]); xlabel('t'); grid
Student Id No:150060031
Student Id No:150060031
Lab Exercise-9
Exercise9.1: Consider a multitone signal
s (t ) 1.2sin(380 t ) 2 cos(840 t ) .
3
Is there any aliasing effect? If these sampled signals are reconstructed, what are the
frequency components are available? Develop Matlab codes, sketch and label them.
Draw the corresponding spectra.
clear all; close all; clc;
f0=600;
f1=1200;
n=0:1:20;
x=1.2*sin((380*pi*n)/f0+pi/3)+2*cos((840*pi*n)/f0-pi/5);
x1=1.2*sin((380*pi*n)/f1+pi/3)+2*cos((840*pi*n)/f1-pi/5);
figure ()
plot(n,x, 'm','LineWidth',2); title('Original Signal');
figure();
Student Id No:150060031
plot(n,x, 'b','LineWidth',2);hold on
stem(n,x,'--r','fill','LineWidth',2);
plot(n,x1,'k','LineWidth',2);
title('Sampling');
legend('Original Signal','Sampling with 600','Sampling With 1200');
Exercise9.2: Consider various human voice / speech (probably your voice both male
and female) or music signals with band width occupies from 300- 3.4 KHz. Try different
sampling rates and observe the effect of aliasing
In lab Session:
(a) Execute the Matlab codes prepared for the exercises and observe the results.
(b) Compute all the tasks given in the exercises.
(c) Note the results and store the necessary figures and data for the lab report.
Student Id No:150060031
(c) Submit the lab report to the lab in-structure and get the signature in time.
(d) Type the complete description of commands used in the lab.
10