You are on page 1of 29

EE 5108: DIGITAL SIGNAL PROCESSING LABORATORYORATORY

LIST OF EXPERIMENTS:

COMPULSORY EXPERIMENTS:

1. Familiarization with MATLAB

2. Generation of the following sequence and to plot them using MATLAB:


a. Unit Sample Sequence D[n]
b. Unit Step Sequence u[n]
c. Ramp Sequence n. u[n]
d. Exponential Sequences
e. Sine / Cosine Sequences

3. Verification of the following general properties using MATLAB


a. Linearity
b. Time Shifting
c. Frequency Shifting

4. Computation of the linear convolution of two finite-length sequences using


MATLAB

5. Obtaining the Partial Fraction Expansion of the Z-Transform expression and to


find its Inverse Z-Transforms using MATLAB

6. Testing for the stability of given Discrete Time Systems using MATLAB

7. To write a MATLAB program for finding out the output of two Periodic
Digital sequences using Circular Convolution. Compare your result with that
obtained by theoretical evaluation

8. Computation of N-point DFT of the length-N sequence using MATLAB

9. Development of the program for finding out DFT and FFT using TMS
320C6713 DSK Processor

10. To write a program and simulate using C language / assembly language for
computation of Linear Convolution using TMS 320C6713 DSK Processor

11. To write a program and simulate using C language / assembly language for
computation of Auto/ Cross Correlation using TMS Processor

12. To write a program and simulate using C language / assembly language for
designing a Digital Filter (LP/ HP / BP / BR) using TMS 320C6713 DSK
Processor
OPTIONAL EXPERIMENTS:

13. To develop a MATLAB program to convert Analog to Digital Frequencies


using Bilinear Transformation

14. To design a Butterworth filter using standard design steps (for LP, HP, BP &
BR filters), i.e. find out the order of the filter when Pass Band Gain, Sampling
frequency and Pass Band and Stop Band Cut-Off frequencies are given. Then
find out the Normalized Transfer Function and Actual Transfer Function

15. To design a Chebyshev filter using standard design steps (general programs
for LP, HP, BP & BR filter design)

16. To develop a Cascade realization of the given Linear-Phase FIR/ IIR transfer
functions using MATLAB

17. To write a MATLAB program to compute the Cross Correlation of two finite-
length sequences. Compare your result with that obtained by theoretical
evaluation

18. To write a MATLAB program to compute the Auto Correlation of two finite-
length sequences. Compare your result with that obtained by theoretical
evaluation

19. To write a MATLAB program to compute the PSD of two Sinusoids

20. To write a MATLAB program to compute the Inverse DFT

21. To write a MATLAB program for transforming an Analog filter into a Digital
filter using Impulse invariant technique

22. To develop programs for following Frequency Transformations in the design


of Digital filter: LP to Normalized Low Pass Transformations (NLPT); HP to
NLPT; BP to NLPT; BR to NLPT

23. To develop a general program for Non-Recursive (FIR) filter using


Rectangular, Hanning, Hamming, Blackman and Kaiser Window techniques

24. To implement LMS algorithm using TMS DSK 320C6713 DSK Processor
DEPARTMENT
OF
ELECTRONICS AND COMMUNICATION

DIGITAL SIGNAL PROCESSING LABORATORY

LAB INSTRUCTIONS FOR CARRYING OUT PRACTICAL

ON

FAMILIARIZATION WITH MATLAB

BIRLA INSTITUTE OF TECHNOLOGY


MESRA, RANCHI
AIM: Familiarization with MATLAB

INSTRUMENTS:

1. MATLAB

THEORY:

MATLAB is a high performance language for technical computing. It


integrated computation, visualization, and programming in an easy to use
environment, where problems and solutions are expressed in familiar
mathematical notation. MATLAB feature s a family of application specific
solutions called toolboxes.

PROGRAM:

Some basic matrix operations such as addition, subtraction, multiplication,


inversion, etc.

RESULT:

PRECAUTIONS:
DEPARTMENT
OF
ELECTRONICS AND COMMUNICATION

DIGITAL SIGNAL PROCESSING LABORATORY

LAB INSTRUCTIONS FOR CARRYING OUT PRACTICAL

ON

GENERATION OF THE FOLLOWING SEQUENCE AND TO PLOT


THEM USING MATLAB:
UNIT SAMPLE SEQUENCE D[N], UNIT STEP SEQUENCE U[N],RAMP
SEQUENCE N. U[N], EXPONENTIAL SEQUENCES, SINE / COSINE
SEQUENCES

BIRLA INSTITUTE OF TECHNOLOGY


MESRA, RANCHI

AIM: Generation of the following sequence and to plot them using MATLAB:
a. Unit Sample Sequence D[n]
b. Unit Step Sequence u[n]
c. Ramp Sequence n. u[n]
d. Exponential Sequences
e. Sine / Cosine Sequences

SOFTWARE:

MATLAB

THEORY:
(a) Unit sample sequence,(n), is defined as
(n) = 1, n = 0
= 0, n  0
(b) Unit step sequence is defined as
u(n) = 1 , n  0
= 0, n < 0
(c) Unit ramp sequence is defined as
r (n) = nu(n) = n, n  0
=0,n<0
(d) Exponential sequence are defined by
x(n) = an where a is real constant for -∞ ≤ n ≤ ∞
(e) Sinusoidal sequence are given by
x(n) = sin n where  = 2f = 2k/N

PROGRAM:

To express the above sequence in graphical representation for finite duration. The
input parameters to be specified are the desired length & the simplify frequency.

RESULT:

PRECAUTIONS:
DEPARTMENT
OF
ELECTRONICS AND COMMUNICATION

DIGITAL SIGNAL PROCESSING LABORATORY

LAB INSTRUCTIONS FOR CARRYING OUT PRACTICAL

ON

VERIFICATION OF THE FOLLOWING GENERAL PROPERTIES


USING MATLAB: LINEARITY, TIME SHIFTING, FREQUENCY
SHIFTING

BIRLA INSTITUTE OF TECHNOLOGY


MESRA, RANCHI

AIM: Verification of the following general properties using MATLAB


a. Linearity
b. Time Shifting
c. Frequency Shifting

SOFTWARE:

MATLAB 7.0

THEORY:
1. Linear System:

(a) A system is said to be linear if it satisfies the principle of superposition &


homogeneity. It status that the response of the system to weighted sum of
input is equal to the corresponding weighted sum of response of the system
to each of the individual inputs.
Let y1(n) = [x1(n)]
y2(n) = [x2(n)]
y3(n) = [a1x1(n) + a2x2(n)]
The system is linear if
y3(n)= a1y1(n) + a2y2(n) where a & b are constants.

(b) Time Shifting


If x(n) is shifting in time to get x(n-K), then is called time delay whereas
if x(n + K), it is called time advance, where K is same the integer.

(c) Frequency Shifting


If x(n)   x ()
DTFT

Then X(n) e j0 n   x( - 0)


DTFT

PROGRAM:

To do by the students making use of function “inline”.

RESULT:

PRECAUTIONS:
DEPARTMENT
OF
ELECTRONICS AND COMMUNICATION

DIGITAL SIGNAL PROCESSING LABORATORY

LAB INSTRUCTIONS FOR CARRYING OUT PRACTICAL

ON

COMPUTATION OF THE LINEAR CONVOLUTION OF TWO


FINITE-LENGTH SEQUENCES USING MATLAB

BIRLA INSTITUTE OF TECHNOLOGY


MESRA, RANCHI
AIM: Computation of the linear convolution of two finite-length sequences using
MATLAB

SOFTWARE:

MATLAB 7

THEORY:
The linear convolution is used to obtain the response of an LTI system for any
given input when its impulse response known . We can say that the input x(n)
is convolved with the impulse the h(n) to produce the output y(n).
The convolution sum is given by



Y(n) = x(n) * h(n) = K  
x ( K ) h( n  K )

Involving four steps : Folding, Shifting, Multiplication & Summation.

PROGRAM:

First develop a program to compute output using linear convolution sum with
the inputs are two finite – duration sequences. Display the output starting the
point of origin. If there are M no. of samples in first sequence & N no. of
samples in second sequence then the no. of samples in output sequence must
be (M+N-1).

RESULT:

PRECAUTIONS:
DEPARTMENT
OF
ELECTRONICS AND COMMUNICATION

DIGITAL SIGNAL PROCESSING LABORATORY

LAB INSTRUCTIONS FOR CARRYING OUT PRACTICAL

ON

OBTAINING THE PARTIAL FRACTION EXPANSION OF THE


Z-TRANSFORM EXPRESSION AND TO FIND ITS INVERSE
Z-TRANSFORMS USING MATLAB
BIRLA INSTITUTE OF TECHNOLOGY
MESRA, RANCHI

AIM: Obtaining the Partial Fraction Expansion of the Z-Transform expression and
to find its Inverse Z-Transforms using MATLAB

SOFTWARE:

MATLAB 7

THEORY:

The Z-Transform of signal x(n) is given by



X(z) =  x ( n) Z
n  
n

ROC of x(z) is the set of all values of z for which X(z) attains a finite value.

The inverse procedure ie, obtaining x(n) from X(z) is called the inverse Z-
transform.
By partial fraction expansion, we can write
X(z) = X1(z)+ X2(z)+ X3(z)+…..
Taking inverse Z-transform, we get
x(z) = x1(z)+ x2(z)+ x3(z)+…..

PROGRAM:

Expression the X(z) in rational from & then apply partial fraction expansion
using the function “residues”. Display the result in time-domain.

RESULT:

PRECAUTIONS:
DEPARTMENT
OF
ELECTRONICS AND COMMUNICATION

DIGITAL SIGNAL PROCESSING LABORATORY

LAB INSTRUCTIONS FOR CARRYING OUT PRACTICAL

ON

TESTING FOR THE STABILITY OF GIVEN


DISCRETE TIME SYSTEMS USING MATLAB
BIRLA INSTITUTE OF TECHNOLOGY
MESRA, RANCHI

AIM: Testing for the stability of given Discrete Time Systems using MATLAB

SOFTWARE:

MATLAB 7

THEORY:
STABILITY:
The roots of the denominator polynomial or the poles of the
transfer function of the linear time invariant system will determine whether
the system is stable, unstable & marginal stable. Provided that degree of the
polynomial greater than or equal to the degree of the numerical polynomial.
1. Stable system: When all the poles of the transfer function must lies in the
left half of s-plane.
2. Unstable system : If any of poles lies in right side of s-plane.
3. Marginal stable: If any poles on jw-axis in the s-plane provided the other
poles at x(s) lies in the left half s-plane.
Stability in case of Z transform: A casual linear time invariant system is
one whose unit sample response h(n) satisfies the condition h(n) = 0 , n< 0.
ROC of the Z transform of a casual sequence is the exterior of a circle.
Consequently a linear time invariant system is casual if and only if the ROC
of the system function is the exterior of a circle of radius <  including the
point Z = 
Necessary and sufficient condition for a linear time invariant system to
be BIBO stable is

 h( n)  
n  

Therefore a linear time invariant system is BIBO stable if and only if the
ROC of the system function includes the units circle.
PROGRAM:

RESULT:

PRECAUTIONS:

DEPARTMENT
OF
ELECTRONICS AND COMMUNICATION

DIGITAL SIGNAL PROCESSING LABORATORY

LAB INSTRUCTIONS FOR CARRYING OUT PRACTICAL

ON

TO WRITE A MATLAB PROGRAM FOR FINDING OUT THE


OUTPUT OF TWO PERIODIC DIGITAL SEQUENCES USING
CIRCULAR CONVOLUTION. COMPARE YOUR RESULT
WITH THAT OBTAINED BY THEORETICAL EVALUATION
BIRLA INSTITUTE OF TECHNOLOGY
MESRA, RANCHI

AIM: To write a MATLAB program for finding out the output of two Periodic
Digital sequences using Circular Convolution. Compare your result with that
obtained by theoretical evaluation

SOFTWARE:

MATLAB 7

THEORY:
Let x1(n) and x2(n) are finite duration sequence both of length N with DFT’s
X1(K) and X2(K) . Now we find a sequence x3(n) for which the DFT is X3(K)
where,

X3(K) = X1(K) X2(K) ---------(i)

N 1
x3 ((n)) N   x1 ((m)) N x 2 ((n  m)) N
m0

for 0 n  (n-1)

x3((n))N = x3(n); similarly x1((m))N = x1(m)

N 1
x3 (n)   x1 (m) x 2 ((n  m)) N -----------------(ii)
M 0

The above equation represents the circular convolution of x1(n) and x2(n)
represents

X3(n) = x1(n)x2(n)------------------(iii)

Form equation (i) and (iii), we find that

DFT [x1(n)x2(n)] = X1(K)X2(K)

PROGRAM:
RESULT:

PRECAUTIONS:

DEPARTMENT
OF
ELECTRONICS AND COMMUNICATION

DIGITAL SIGNAL PROCESSING LABORATORY

LAB INSTRUCTIONS FOR CARRYING OUT PRACTICAL

ON

COMPUTATION OF N-POINT DFT OF THE LENGTH-N


SEQUENCE USING MATLAB
BIRLA INSTITUTE OF TECHNOLOGY
MESRA, RANCHI

AIM: Computation of N-point DFT of the length-N sequence using MATLAB

SOFTWARE:

MATLAB

THEORY:

The discrete Fourier transform is a powerful computation tool which allows us


to evaluate the Fourier transform X(e i) on a digital computer or specially
designed digital hardware.
The DFT is obtained by sampling one period of the Fourier transform at a
finite number of frequency points.
The DFT of a sequence x(n) is
N 1  i 2kn
X(k) =  x ( n)e ; k = 0,1,2……….N-1
n0 N

PROGRAM:

RESULT:

PRECAUTIONS:
DEPARTMENT
OF
ELECTRONICS AND COMMUNICATION

DIGITAL SIGNAL PROCESSING LABORATORY

LAB INSTRUCTIONS FOR CARRYING OUT PRACTICAL

ON

DEVELOPMENT OF THE PROGRAM FOR FINDING OUT


DFT AND FFT USING TMS 320C6713 DSK PROCESSOR
BIRLA INSTITUTE OF TECHNOLOGY
MESRA, RANCHI

AIM: Development of the program for finding out DFT and FFT using TMS
320C6713 DSK Processor

SOFTWARE:

MATLAB 7

THEORY:
The discrete Fourier transform is a powerful computation tool which allows us
to evaluate the Fourier transform X(e i) on a digital computer or specially
designed digital hardware.
The DFT is obtained by sampling one period of the Fourier transform at a
finite number of frequency points.
The DFT of a sequence x(n) is
N 1  i 2kn
X(k) =  x ( n)e ; k = 0,1,2……….N-1
n0 N
MATLAB provides a function called fft to compute the DFT of a vector x. This fft
function is written in machine language and not using MATLAB commands.
Therefore it executes very fast . If N is a power of two, then a high speed radix- 2 FFT
algorithm is employed . If N is not a power of two , then N is decomposed into prime
factor and a slower mixed – radix FFT algorithm is used . Finally if N is a prime
number then the fft function is reduced to the row DFT algorithm .
PROGRAM:

To do by the student without using the function fft.

RESULT:

PRECAUTIONS:

DEPARTMENT
OF
ELECTRONICS AND COMMUNICATION

DIGITAL SIGNAL PROCESSING LABORATORY

LAB INSTRUCTIONS FOR CARRYING OUT PRACTICAL

ON

TO WRITE A PROGRAM AND SIMULATE USING C


LANGUAGE / ASSEMBLY LANGUAGE FOR COMPUTATION
OF LINEAR CONVOLUTION USING TMS 320C6713 DSK
PROCESSOR
BIRLA INSTITUTE OF TECHNOLOGY
MESRA, RANCHI

AIM: To write a program and simulate using C language / assembly language for
computation of Linear Convolution using TMS 320C6713 DSK Processor

SOFTWARE:

MATLAB 7

THEORY:

The linear convolution is used to obtain the response of an LTI system for any
given input when its impulse response known . We can say that the input x(n)
is convolved with the impulse the h(n) to produce the output y(n).
The convolution sum is given by



Y(n) = x(n) * h(n) = K  
x ( K ) h( n  K )

Involving four steps : Folding, Shifting, Multiplication & Summation.

PROGRAM:

RESULT:

RESULT:

PRECAUTIONS:
DEPARTMENT
OF
ELECTRONICS AND COMMUNICATION

DIGITAL SIGNAL PROCESSING LABORATORY

LAB INSTRUCTIONS FOR CARRYING OUT PRACTICAL

ON

TO WRITE A PROGRAM AND SIMULATE USING C LANGUAGE /


ASSEMBLY LANGUAGE FOR COMPUTATION OF AUTO/ CROSS
CORRELATION USING TMS PROCESSOR
BIRLA INSTITUTE OF TECHNOLOGY
MESRA, RANCHI

AIM: To write a program and simulate using C language / assembly language for
computation of Auto/ Cross Correlation using TMS Processor

SOFTWARE:

MATLAB 7

THEORY:
Correlation is a measure of the degree to which two sequence are similar.
Given two real-valued sequences x(n) & y(n) is a sequence γxy(ℓ) defined as

 xy ()   x ( n) y ( n  )
n  

The index ℓ is called shift parameter .


When x(n) = y(n), then the above equation defines
autocorrelation as


 xx ()   x(n) x (n  )
n  

PROGRAM:
To develop by the students without making use of function “x corr (x,y)”.
Give imphasis on the use on the use of the conV_m function

PRECAUTIONS:
DEPARTMENT
OF
ELECTRONICS AND COMMUNICATION

DIGITAL SIGNAL PROCESSING LABORATORY

LAB INSTRUCTIONS FOR CARRYING OUT PRACTICAL

ON

TO WRITE A PROGRAM AND SIMULATE USING C LANGUAGE /


ASSEMBLY LANGUAGE FOR DESIGNING A DIGITAL FILTER
(LP/ HP / BP / BR) USING TMS 320C6713 DSK PROCESSOR

BIRLA INSTITUTE OF TECHNOLOGY


MESRA, RANCHI

AIM: To write a program and simulate using C language / assembly language for
designing a Digital Filter (LP/ HP / BP / BR) using TMS 320C6713 DSK Processor

SOFTWARE:

MATLAB 7.0

THEORY:
The Butterworth low pass filter has a magnitude response given by

A
H (i) 
1  ( /  c )2N  1/ 2

where A = Filter gain, c = 3dB cut off frequency


order of filter

 1  
 AB 2  1 
1 / 2 log  
N=   1 
 2  1
  AP 
log( S /  P )
Where AS = stop Band Gain
AP = Pass band Gain
S = Stop edge frequency
c = Pass edge frequency
S
1
 1  2N
  1
A 2 
and cut off frequency c =  S 
Poles for butterworth filter.
SK = c exp[j(N+2K+1)/2N]
Where K = 0,1,2,…………….N-1

The Chebyshev Low pass filter has a magnitude response given by


A
H ()  0.5
1   2 C N 2 ( /  c )
where A = filter Gain
 = constant
c = 3-dB cut off frequency
The Chebyshev polynomial of the  kind of Nth order
cos( N cos fx ) for n  1
CN(x)= cosh( N cosh fx ) for n  1

The magnitude response of the Chebyshev filter has passband & maximally
flat passband. According to the response of filter that by increasing the filter
order N, The Chebyshev response approximate the ideal response . The phase
response of the Chebyshev filter in noise non-linear than the butterworth filter
for given filter length N.
The order of the filter is given by
cosh 1  1 / AS  1 2 
1 1 


2

N 
cos 1 ( S /  P )

1
 1  2

where    1 & c = P
 AS 2 
 
 
 1 
RP  10 log 2N

  P  
 1    
  c  
 
 
 1 
AS  10 log 2N

  S  
 1    
  c  
Rp AS
log[10 10  1) /(10 10  1)]
N 
2 log( P /  S )
P
C 
RP
2N (10 10
 1)
S
C 
AS
2N (10 10
 1)

The analog low pass filter is specified by the parameters P, S , AP & AS.
Therefore the essence of the design in the case of Butterworth filter is to obtain
the order N & the cutoff frequency C , given these specifications.

PROGRAM:

The above design procedure can be implemented in MATLAB as a simple


function. To design by the students without making use of inbuilt function “ sfd –
butt.”

RESULT:

PRECAUTIONS:

You might also like