0% found this document useful (0 votes)
75 views61 pages

Lab Manual EC DSP 3171003

Uploaded by

kundanscith
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)
75 views61 pages

Lab Manual EC DSP 3171003

Uploaded by

kundanscith
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/ 61

ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

A LABORATORY MANUAL FOR

DIGITAL SIGNAL PROCESSING

(3171003)

B.E. SEM: VII (EC)

Directorate of Technical Education,


Gandhinagar, Gujarat

ELECTRONICS & COMMUNICATION


ENGINEERING DEPARTMENT

Page No: 1
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Directorate of Technical Education,


Gandhinagar, Gujarat

Certificate
This is to certify that Mr./Ms. ___________________________________
________ Enrollment No. _______________ of B.E. Semester _____
Electronics and Communication Engineering of this Institute (GTU
Code: _____ ) has satisfactorily completed the Practical / Tutorial work for
the subject DIGITAL SIGNAL PROCESSING (3171003) for the
academic year 2022-23.

Place: __________
Date: __________

Name and Sign of Faculty Member:

Head of the Department

Page No: 2
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Instructions for students:


1. The lab will meet every week.
2. Your activity, participation, and progress during the lab session will be part of your
lab grade.
3. A lab report for each will be due the following week in lab. Your lab report should
include relevant code fragments, figures, answers to questions in the quiz.
4. The lab consists of computer-based exercises. You are required to do programming
with MATLAB. Follow the guidelines for the usage of online Matlab simulator.
5. MATLAB tutorial can be downloaded for free from the Mathworks website:
http://www.mathworks.com/
6. Other documentation can be obtained at:
http://www.mathworks.com/access/helpdesk/help/helpdesk.shtml

7. Add your Matlab code and result in each experiment before taking printout.

Page No: 3
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical – Course Outcome Matrix


Sr. CO CO CO CO
Objective(s) of Experiment
No. 1 2 3 4
Generation of elementary sequences in discrete-time
1. (i)unit impulse, (ii) unit step, (iii) unit ramp, (iv) exponential, √
(v)square, (vi) sin (vii) cosine,(viii) triangular,(ix) sinc signal
Write a MATLAB program to implement time shifting and time
2. √
reversal operation on discrete time sequences.
Use help conv to find out how to use the conv command.
Let f(n) = u(n) − u(n − 4)
g(n) = n · u(n) − 2 (n − 4) · u(n − 4) + (n − 8) · u(n − 8).

Make stem plots of the following convolutions.


Use the MATLAB conv command to compute the convolutions.
3. √
(a) f(n) ∗ f(n)
(b) f(n) ∗ f(n) ∗ f(n)
(c) f(n) ∗ g(n)
(d) g(n) ∗ δ(n)
(e) g(n) ∗ g(n)

Convolution of non-causal signals.


f(n) = 3 δ(n + 2) − δ(n − 1) + 2 δ(n − 3)

4. g(n) = u(n + 4) − u(n − 3) √

x(n) = f(n) ∗ g(n)

Suppose a system is implemented with the difference equation:


y(n) = x(n) + 0.5 x(n − 1)+ 2 x(n-2) − 0.95 y(n − 1)
Write your own MATLAB function, mysystem, to implement this
difference equation using a for loop.
(a) Is this system linear? Use your MATLAB function to
confirm your answer:
y1 = mysystem (x1)
5. √
y2 = mysystem (x2)
y3 = mysystem (2*x1+3*x2)
Use any signals x1, x2 you like.
(b) Is this system time-invariant?
Confirm this in MATLAB (how?).
(c) Compute and plot the impulse response of this system.

Page No: 4
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Use x = [1, zeros(1,100)]; as input.


(d) Define x(n) = cos(π n/8) [u(n) − u(n − 50)]. Compute the
output of the system in two ways:

(1) y(n) = h(n) ∗ x(n) using the conv command.


(2) Use your function to find the output for this input signal. Are the
two output signals you compute the same?
Write a MATLAB program to represent Moving average system and
6. use it to compute the average of some sample values and to smooth a √
noisy sequence.
Write a MATLAB program to generate impulse response and step
7. √
response of a system.
Write a program to perform linear convolution of two sequences.
8. Get the input sequence and its duration form the user. Also plot all √
the sequences.
Write a program to find autocorrelation and cross correlation of
9. sequences. Verify auto correlation property to find energy of the √
sequence and period of the sequence.
Write a program to compute DTFT of a sequence x[n]= (0.5)n u[n].
10. √
Plot its magnitude and phase response.
Write a program to demonstrate the time shifting and frequency
11. √
shifting property of DTFT.
Write a program to find Z transform and its inverse Z transform of a
12. √
sequence Write a program to plot pole-zero of a given FIR/IIR filter.
Write a program for Direct form – I,II form realization of the given
13. √
IIR system function.
Write a program to design digital FIR filter using various windowing
14. √
technique.
(A) Create Blackman Harris, Hamming and Gaussian window and
plot them in the same filter design tool.
15. √
(B) Design an FIR filter with side lobe attenuation of 40 dB using
Kaiser Window of 200 points.
(A)Design low pass butter worth digital filter with given specification
using impulse invariance method.
(B)Design a high pass elliptical filter with given specification using
16. √
impulse invariance method.
(C)Design a band pass chebychev-2 filter with given specification
using impulse in-variance method.
Design a second-order digital bandpass Butterworth filter with the
17. following specifications: √
fu= 2.6 kHz,fL = 2.4 kHz , fs = 8000 Hz. Plot the magnitude and

Page No: 5
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

phase response.
Write a program to compute N-point DFT of a given sequence. Plot
18. √
its magnitude and phase response.
Write a program to perform circular convolution of two sequences
19. √
using DFT.
Write a program to perform linear convolution of two sequences
20. √
using DFT.

Page No: 6
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Rubrics for Assessment:


Student Performance Evaluation
Accuracy in
Submission
data Professional Total
Punctuality Active of laboratory
collection, attitude, behaviour Marks
(2) Participation(2) file and
analysis (2) (10)
viva(2)
etc.(2)
Full Partially
Satisfactory = Not satisfactory =
Assessment: Satisfactory = satisfactory =
1.5 0
2 1

Page No: 7
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Index
(Progressive Assessment Sheet)
Sr. Page Date Date Assess Sign. of Remark
No. Objective(s) of Experiment No. of of ment Teache s
perfor submi Marks r with
mance ssion date
0. Mission & Vision

1. Generation of elementary sequences in discrete-time


(i)unit impulse, (ii) unit step, (iii) unit ramp, (iv)
exponential, (v)square, (vi) sin (vii) cosine,(viii)
triangular,(ix) sinc signal
2. Write a MATLAB program to implement time
shifting and time reversal operation on discrete time
sequences.
3. Use help conv to find out how to use the conv
command.
Let f(n) = u(n) − u(n − 4)
g(n) = n · u(n) − 2 (n − 4) · u(n − 4) + (n − 8) · u(n
− 8).

Make stem plots of the following convolutions.


Use the MATLAB conv command to compute the
convolutions.
(a) f(n) ∗ f(n)
(b) f(n) ∗ f(n) ∗ f(n)
(c) f(n) ∗ g(n)
(d) g(n) ∗ δ(n)
(e) g(n) ∗ g(n)
4. Convolution of non-causal signals.
f(n) = 3 δ(n + 2) − δ(n − 1) + 2 δ(n − 3)
g(n) = u(n + 4) − u(n − 3)

x(n) = f(n) ∗ g(n)


5. Suppose a system is implemented with the
difference equation:
y(n) = x(n) + 0.5 x(n − 1)+ 2 x(n-2) − 0.95 y(n − 1)
Write your own MATLAB function, mysystem, to
implement this difference equation using a for loop.
(a) Is this system linear? Use your Matlab
function to confirm your answer:
y1 = mysystem (x1)
Page No: 8
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

y2 = mysystem (x2)
y3 = mysystem (2*x1+3*x2)
Use any signals x1, x2 you like.
(b) Is this system time-invariant?
Confirm this in MATLAB (how?).
(c) Compute and plot the impulse response
of this system.
Use x = [1, zeros(1,100)]; as input.
(d) Define x(n) = cos(π n/8) [u(n) − u(n −
50)].
Compute the output of the system in two ways: (1)
y(n) = h(n) ∗ x(n) using the conv command. (2) Use
your function to find the output for this input signal.
Are the two output signals you compute the same?

6. Write a MATLAB program to represent Moving


average system and use it to compute the average of
some sample values and to smooth a noisy sequence.
7. Write a MATLAB program to generate impulse
response and step response of a system.
8. Write a program to perform linear convolution of
two sequences.
Get the input sequence and its duration form the
user. Also plot all the sequences.
9. Write a program to find autocorrelation and cross
correlation of sequences. Verify auto correlation
property to find energy of the sequence and period
of the sequence.
10. Write a program to compute DTFT of a sequence
x[n]= (0.5)n u[n]. Plot its magnitude and phase
response.
11. Write a program to demonstrate the time shifting
and frequency shifting property of DTFT.
12. Write a program to find Z transform and its inverse
Z transform of a sequence Write a program to plot
pole-zero of a given FIR/IIR filter.
13. Write a program for Direct form – I,II form
realization of the given IIR system function.
14. Write a program to design digital FIR filter using
various windowing technique.
Page No: 9
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

15. (A) Create Blackman Harris, Hamming and


Gaussian window and plot them in the same filter
design tool.
(B) Design an FIR filter with side lobe attenuation
of 40 dB using Kaiser Window of 200 points.
16. (A)Design low pass butter worth digital filter with
given specification using impulse invariance
method.
(B)Design a high pass elliptical filter with given
specification using impulse invariance method.
(C)Design a band pass chebychev-2 filter with
given specification using impulse in-variance
method.
17. Design a second-order digital bandpass Butterworth
filter with the following specifications: fu= 2.6 kHz,
fL = 2.4 kHz , fs = 8000 Hz. Plot the magnitude and
phase response.
18. Write a program to compute N-point DFT of a given
sequence. Plot its magnitude and phase response.
19. Write a program to perform circular convolution of
two sequences using DFT.
20. Write a program to perform linear convolution of
two sequences using DFT.

Total

Page No: 10
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical- 0

Vision and Mission of DTE:

Vision and Mission of Institute:

Vision and Mission of Department:

Program Objectives:

Program Specific Outcomes:

Program Educational Objectives:

Course Outcomes:

Page No: 11
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-1
Date:

Competency and Practical Skills: Introduction to the MATLAB technical computing


environment which involves the basic concepts of the language such as data types, operators
and control structures along with writing, executing and debugging Matlab code for various
tasks such as data analysis, visualization and simulation.

Data analysis, modeling, visualization, and build computational competence with MATLAB.

Relevant CO: Analyse digital and analog signals and systems

Objectives: Generation of elementary sequences in discrete- time


(i)unit impulse, (ii) unit step, (iii) unit ramp, (iv) exponential, (v)square, (vi) sin (vii)
cosine,(viii) triangular,(ix) sinc signal

Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory: Elementary signal plays vital role in the study of signals and systems. It serves as
basic building blocks for the construction of most complex signals. These elementary signals
are also called standard signals.

(i) Unit Impulse 𝛿(𝑛) = { 1 𝑛 = 0 0 𝑛 ≠ 0


(ii) Unit Step 𝑢(𝑛) = { 1 ≥ 0 0 𝑛 < 0
(iii) Unit ramp 𝑟(𝑛) = { 𝑛 𝑛 ≥ 0 0 𝑛 < 0
(iv) Exponential 𝑥(𝑛) = 𝑎 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑛
(v) Sinusoidal signal 𝑥(𝑛) = 𝐴 𝑠𝑖𝑛(𝑤𝑛 + ∅)
(vi) Cosine signal 𝑥(𝑛) = 𝐴 𝑐𝑜𝑠(𝑤𝑛 + ∅)

Write a script: In the main menu of Matlab, select file -> new -> M-file A new window will
pop up. Type in your commands and then save the file with .m extension under the default
path matlab/work.

Using Matlab help system, click on


Help -> MATLAB help or type helpdesk to open the help files. For description of a single
function or command, type

help command_name on the command line, or use ’search’ in the help window. For example,
type

help plot or help clc or help sinc

Be aware that Matlab is case sensitive i.e vector ‘a’ and ‘A’ are different.
Page No: 12
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Suggested MATLAB function:


(i) exp()
(ii) sin()
(iii) cos()
(iv) square()
(v) tripuls()
(vi) subplot()
(vii) stem()
(viii) title()
(ix) xlabel()
(x) ylabel()
(xi) figure()

MATLAB Code:

Output:

Quiz:

1) A discrete time signal is shown in figure:

Sketch and label each of the following signal


a) x[n-2]
b) x[4-n]
Page No: 13
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

c) x[2n]
d) x[n]u[2-n]
e) x[n-1]δ[n-3]

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 14
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-2

Date:

Competency and Practical Skills: Introduction to the MATLAB technical computing


environment which involves the basic concepts of the language such as data types, operators
and control structures along with writing, executing and debugging Matlab code for various
tasks such as data analysis, visualization and simulation.

Relevant CO: Analyse digital and analog signals and systems

Objectives: Write a matlab program to implement time shifting and time reversal operation
on discrete time sequences.

Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:

Time shifting:

Time shifting operation of a discrete-time signal x(n) can be represented by


y(n) = x(n-k)
The signal y(n) can be obtained by time shifting the signal x(n) by k units. If k is positive, it
is delay and the shift is to the right, and if k is negative, it is advance and the shift is to the
left.

Time Reversal:
The time reversal, also called the folding of a signal x(n) can be obtained by folding the signal
about n = 0. This operation is very useful in convolution. It is denoted by x(-n). It is obtained
by replacing the independent variable n by (–n).

Page No: 15
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Suggested MATLAB function:


(i) fliplr()
(ii) iinput()
MATLAB Code

Output

Quiz:
Sketch the following signals.
(i) 𝑢(−𝑡 + 2)
(ii) 2 𝑟(𝑡 − 2)
(iii) 𝑢(𝑡 + 3)𝑢(−𝑡 + 3)

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Page No: 16
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Faculty Sign:

Page No: 17
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-3

Date:

Competency and Practical Skills: Introduction to the MATLAB technical computing


environment which involves the basic concepts of the language such as data types, operators
and control structures along with writing, executing and debugging Matlab code for various
tasks such as data analysis, visualization and simulation.

Relevant CO: Analyse digital and analog signals and systems

Objectives: Use help conv to find out how to use the conv command.
Let f(n) = u(n) − u(n − 4)
g(n) = n · u(n) − 2 (n − 4) · u(n − 4) + (n − 8) · u(n − 8).

Make stem plots of the following convolutions.


Use the MATLAB conv command to compute the convolutions.
(a) f(n) ∗ f(n)
(b) f(n) ∗ f(n) ∗ f(n)
(c) f(n) ∗ g(n)
(d) g(n) ∗ δ(n)
(e) g(n) ∗ g(n
Comment on your observations.
What happens as you repeatedly convolve this signal with itself?
Use the commands title, xlabel, ylabel to label the axes of your plots.
Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:

Convolution: Convolution is a mathematical operation which is used to express the input-


output relationship of an LTI system. It relates the input and impulse response of the system
to output. The convolution of two signals x(n) and h(n) can be represented as:

𝑦(𝑛) = 𝑥(𝑛) ∗ ℎ(𝑛) = ℎ(𝑛) ∗ 𝑥(𝑛)

𝑦(𝑛) = 𝑥(𝑘)ℎ(𝑛 − 𝑘) = ℎ(𝑘)𝑥(𝑛 − 𝑘)

Suggested MATLAB function:


(i) conv()
(ii) deconv()
MATLAB code

Page No: 18
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Output

Quiz
(i) Find output of the system with impulse response h(n) = {1, 2, 3,4}, n = -1:2 for an
input x(n) = {1,1,1,1}, n=0:3.
(ii) Perform linear convolution of following signals using graphical method.
h(n) = u(n)-u(n-N) N is an positive integer
x(n)= an u(n)

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 19
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-4

Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Analyse digital and analog signals and systems

Objectives: Convolution of non-causal signals.

f(n) = 3 δ(n+2) – δ(n-1) + 2δ(n-3)


g(n) = u(n+4) – u(n-3)
x(n) = f(n) ∗ g(n)
Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:

Convolution: Convolution is a mathematical operation which is used to express the input-


output relationship of an LTI system. It relates the input and impulse response of the system
to output. The convolution of two signals x(n) and h(n) can be represented as:

𝑦(𝑛) = 𝑥(𝑛) ∗ ℎ(𝑛) = ℎ(𝑛) ∗ 𝑥(𝑛)

𝑦(𝑛) = 𝑥(𝑘)ℎ(𝑛 − 𝑘) = ℎ(𝑘)𝑥(𝑛 − 𝑘)

Suggested MATLAB function:


(i) conv()
(ii) deconv()

Comment on your observations.


Use the commands title, xlabel, ylabel to label the axes of your plots.
MATLAB Code

Page No: 20
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Output

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 21
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-5

Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Formulate engineering problems in terms of DSP tasks

Objectives: Suppose a system is implemented with the difference equation:


y(n) = x(n) + 0.5 x(n − 1)+ 2 x(n-2) − 0.95 y(n − 1)

Write your own Matlab function, mysystem, to implement this difference equation using a for loop.
If the input signal is N-samples long (0 ≤ n ≤ N − 1), your program should find the first N
sample of the output y(n) (0 ≤ n ≤ N − 1).

(a) Is this system linear? Use your Matlab function to confirm your answer:
y1 = mysystem (x1)
y2 = mysystem (x2)
y3 = mysystem (2*x1+3*x2)
Use any signals x1, x2 you like.
(b) Is this system time-invariant?
Confirm this in Matlab.
(c) Compute and plot the impulse response of this system.
Use x = [1, zeros(1,100)]; as input.
(d) Define x(n) = cos(π n/8) [u(n) − u(n − 50)].

Compute the output of the system in two ways: (1) y(n) = h(n) ∗ x(n) using the conv
command. (2) Use your function to find the output for this input signal. Are the two output
signals you compute the same?

Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:

Linear System:

Page No: 22
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

A system which obeys the principle of superposition and homogeneity is called a linear system,
and a system which does not obey the principle of superposition and homogeneity is called a
non-linear system.

Homogeneity principle means system which produces an output y(n) for an input x(n) must
produce an output ay(n) for an input ax(n).

Superposition principle means a system which produces an output y1(n) for an input x1(n) and
an output y2(n) for an input x2(n) must produce an output y1(n)+ y2(n) for an input x1(n) +x2(n).

𝑇[𝑎𝑥 (𝑛) + 𝑏𝑥 (𝑛)] = 𝑎𝑇[𝑥 (𝑛)] + 𝑏𝑇[𝑥 (𝑛)]

Time-invariant System:

A system is said to be time-invariant (or shift-invariant) if its input/output characteristics does


not change with time, i.e. a shift in the input results in a corresponding time shift in the output.

Let x(n) be the input and let x(n-k) be the input delayed by k units.

y(n) = T[x(n)] be the output for the input x(n).

y(n,k) = T[x(n-k)] be the output for the delayed input.

y(n-k) = y(n)|n=n-k be the output delayed by k units.

Impulse Response of the System:


Response of a system to an impulse input is called as impulse response of the system. It is
denoted by h(n).
h(n) = T [δ(n)]
An LTI system is completely characterized by its impulse response.
Suggested MATLAB function:
(i) function
(ii) for
(iii) input()
(iv) impz()

MATLAB Code

Page No: 23
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Output

Quiz:

For each of the following system determine whether the systems is 1) stable 2)
causal 3) linear 4) time invariant 5) memoryless
a) 𝑇{𝑥(𝑛)} = 𝑔(𝑛). 𝑥(𝑛) 𝑤𝑖𝑡ℎ 𝑔𝑖𝑣𝑒𝑛 𝑔(𝑛)
b) 𝑇{𝑥(𝑛)} = ∑ 𝑥(𝑘)
c) 𝑇{𝑥(𝑛)} = ∑ 𝑥(𝑘)

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 24
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical:6
Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Formulate engineering problems in terms of DSP tasks

Objectives: Write a matlab program to represent Moving average system and use it to
compute the average of some sample values and to smooth a noisy sequence.
Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:
Signal Smoothing or Averaging is the Fundamental Noise Reduction Tool in 1-D Signal
Processing Such as a Monotonic Signal, Speech or Voice. Moving Average Filter is a Finite
Impulse Response (FIR) Filter smoothing filter used for smoothing the signal from short term
overshoots or noisy fluctuations and helps in retaining the true signal representation or retaining
sharp step response. It is a simple yet elegant statistical tool for de-noising signals in the time
domain.

The general moving average system is defined by

Suggested MATLAB function:


(i) rand()
(ii) zeros()
(iii) ones()
MATLAB Code

Output
Page No: 25
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Quiz:
(i) Find the impulse response of a Moving average system.
(ii) Check whether the moving average systems is 1) stable 2) causal 3) linear 4) time
invariant 5) memoryless

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 26
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical:7
Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Analyse digital and analog signals and systems

Objectives: Write a matlab program to generate impulse response and step response of a
system.
Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:
Impulse Response:
Response of a system to an impulse input is called as impulse response of the system. It is
denoted by h(n).
h(n) = T [δ(n)]
An LTI system is completely characterized by its impulse response. We can check causality,
stability of a system from its impulse response. Whether the system is FIR or IIR can also be
checked from the length of its impulse response.

Step Response:
Output of the system for a unit step input is called as step response of the system. It is
denoted by s(n). Unit step response can be obtained by convolving u(n) with the impulse
response h(n) of the system.
s(n) = T [u(n)]
s(n) =u(n) * h(n)

Suggested MATLAB function:


(i) filter()
(ii) impz()
(iii) ones()
(iv) zeros()

MATLAB Code

Page No: 27
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Output

Quiz

Determine impulse response for each of the following system.


 Moving Average System
 Ideal Delay System
 Accumulator System
 Forward difference system
 Backward difference system
 Up-sampler system
 Down-sampler system

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 28
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical:8
Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Formulate engineering problems in terms of DSP tasks

Objectives: Write a program to compute convolution of two sequences. Get the input
sequence and its duration from the user. Also plot all the sequences.
Check the range of convolved signal. If first sequence has range from -2:2 and second
sequence has range from 0:3, then convolved signal has range from -2:5.
Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Suggested Matlab functions:


(i) input()
(ii) length()
(iii) error()
(iv) conv()
(v) deconv()
MATLAB Code

Output

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Page No: 29
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 30
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-9

Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Formulate engineering problems in terms of DSP tasks

Objectives: Write a program to find autocorrelation and cross correlation of sequences.


Verify auto correlation property to find energy of the sequence and period of the sequence.

Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:

Cross Correlation: The cross correlation between two different waveforms or signals is a
measure of similarity or match or relatedness or coherence between one signal and the time
delayed version of another signal. This means the cross correlation between two signals
indicates how much one signal is related to the time delayed version of another signal.
A measure of similarity between a pair of energy signals x(n) and y(n) is given by cross
correlation.

𝑟 (𝑘) = 𝑥(𝑛)𝑦(𝑛 − 𝑘) 𝑘 = 0, ±1, ±2 …

Autocorrelation: The autocorrelation gives the measure of match or similarity or relatedness


or coherence between a signal and its time delayed version. This means that the autocorrelatin
function is a special form of cross correlation function.

𝑟 (𝑘) = 𝑥(𝑛)𝑥(𝑛 − 𝑘) 𝑘 = 0, ±1, ±2 …

The value of the autocorrelation function of a signal at origin (i.e. at k =0) is equal to the energy
of the signal i.e.

𝑟 (0) = 𝑥(𝑛) =𝐸

Suggested Matlab functions:


(i) xcorr()
(ii) findpeaks()
(iii) diff()
(iv) mean()
Page No: 31
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

MATLAB Code

Output

Quiz
i) Find the autocorrelation of the signal
x(n)= {1,2,4,6}, n = 0:3
ii) Determine cross correlation of the signals

x(n)= {1,2,3}, n = 0:2 and y(n) = {4,1, -2.5} n = 0:2

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 32
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-10

Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Analyse discrete time signals in frequency domain

Objectives: Write a program to compute DTFT of a sequence x(n)= 0.5n u(n). Plot its
magnitude and phase response.

Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:

Discrete-Time Fourier Transform

The Fourier transform of a discrete-time sequence is known as the discrete-time Fourier


transform (DTFT).
Mathematically, the discrete-time Fourier transform (DTFT) of a discrete-time
sequence x(n) is defined as −

𝑋(𝜔) = 𝑥(𝑛)𝑒

Suggested MATLAB function:


1. angle()
2. abs()
3. plot()

MATLAB Code

Output

Page No: 33
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Quiz
i) Find the frequency response H(ejw) of the LTI system whose input and output satisfy
the difference equation
1
𝑦(𝑛) − 𝑦(𝑛 − 1) = 𝑥(𝑛) − 2𝑥(𝑛 − 1) + 𝑥(𝑛 − 2)
2
ii) Write a difference equation that characterizes a system when frequency response
is
1
1− 𝑒 +𝑒
𝐻 𝑒 = 2
1 3
1+ 𝑒 + 𝑒
2 4
iii) Find
𝑋(𝑒 )

𝑋 𝑒

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 34
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-11
Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Analyse discrete time signals in frequency domain

Objectives: Write a program to demonstrate the time shifting and frequency shifting
property of DTFT.

Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:

Discrete-Time Fourier Transform

The Fourier transform of a discrete-time sequence is known as the discrete-time Fourier


transform (DTFT).
Mathematically, the discrete-time Fourier transform (DTFT) of a discrete-time
sequence x(n) is defined as −
𝒋𝝎𝒏
𝑿(𝝎) = 𝒙(𝒏)𝒆
𝒏

Time Shifting Property of Discrete-Time Fourier Transform

Statement - The time-shifting property of discrete-time Fourier transform states that if a


signal x(n) is shifted by k in time domain, then its DTFT is multiplied by 𝑒 . Therefore, if
𝒙(𝒏) ↔ 𝑿(𝝎)
Then
𝑥(𝑛 − 𝑘) ↔ 𝑒 𝑋(𝜔)
Where, k is an integer.
Suggested MATLAB function:
1. rand()
2. fftshift()
3. abs()
4. plot()

Page No: 35
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

MATLAB Code

Output

Quiz
i) Prove following properties of DTFT.
1. Time shifting
2. Frequency Shifting
ii) Find Fourier Transform of
𝑥(𝑛) = 𝑎 𝑢(𝑛 − 5)

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 36
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-12

Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Analyse discrete time signals in frequency domain

Objectives: Write a program to find Z transform and its inverse Z transform of a sequence.
Write a program to plot pole-zero of a given FIR/IIR filter.

Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:

The Z-transform (ZT) is a mathematical tool which is used to convert the difference equations
in time domain into the algebraic equations in z-domain.

The Z-transform is a very useful tool in the analysis of a linear shift invariant (LSI) system.
An LSI discrete time system is represented by difference equations. To solve these difference
equations which are in time domain, they are converted first into algebraic equations in z-
domain using the Z-transform, then the algebraic equations are manipulated in z-domain and
the result obtained is converted back into time domain using the inverse Z-transform.

Mathematically, if x(n) is a discrete-time signal or sequence, then its bilateral or two-sided Z-


transform is defined as −

𝑋(𝑍) = 𝑥(𝑛)𝑍 ;𝑍 = 𝑟 𝑒

Region of Convergence (ROC) of Z-Transform

The set of points in the z-plane, for which the Z-transform of a discrete-time sequence x(n),
that is X(z) converges is called the region of convergence (ROC) of the Z-transform X(z).
For any given discrete-time sequence, the Z-transform may or may not converge. If there is no
point in the z-plane for which the function X(z) converges, then the sequence x(n) is said to
be having no z-transform.

Suggested MATLAB function:


1. ztrans()
2. iztrans ()
3. zplane()
Page No: 37
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

MATLAB Code

Output

Quiz
i) Find the inverse z-transform of the following.

𝐻(𝑧) = for all possible ROCs.

ii) Find the z-transform of followings.


𝑎 , 0≤𝑛 ≤𝑁−1
a. 𝑥(𝑛) = 𝑛 𝑎 𝑢(𝑛) b. 𝑥(𝑛) =
𝑜, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 38
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-13

Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Analyse discrete time signals in frequency domain

Objectives: Write a program for Direct form – I,II form realization of the given IIR system
function.
Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:

Direct-Form-I implementation of a 2nd-order digital filter.

The DF-I structure has the following properties:

1. It can be regarded as a zero filter section followed in series by a pole filter section.
2. In most fixed-point arithmetic schemes (such as two's complement, the most
commonly used) there is no possibility of internal filter overflow. That is, since there
is fundamentally only one summation point in the filter, and since fixed-point overflow
naturally “wraps around” from the largest positive to the largest negative number and
vice versa, then as long as the final result y(n) is “in range”, overflow is avoided, even
when there is overflow of intermediate results in the sum. This is an important, valuable,
and unusual property of the DF-I filter structure.

Page No: 39
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

3. There are twice as many delays as are necessary. As a result, the DF-I structure is not
canonical with respect to delay. In general, it is always possible to implement a Nth
order filter using only N delay elements.
4. As is the case with all direct-form filter structures (those which have coefficients given
by the transfer-function coefficients), the filter poles and zeros can be very sensitive to
round-off errors in the filter coefficients. This is usually not a problem for a simple
second-order section, but it can become a problem for higher order direct-form filters.
This is the same numerical sensitivity that polynomial roots have with respect to
polynomial-coefficient round-off. As is well known, the sensitivity tends to be larger
when the roots are clustered closely together, as opposed to being well spread out in
the complex plane. To minimize this sensitivity, it is common to factor filter transfer
functions into series and/or parallel second-order sections.

Direct-Form-II implementation of a 2nd-order digital filter.

The DF-II structure has the following properties:

1. It can be regarded as a pole filter section followed by a zero filter section.


2. It is canonical with respect to delay. This happens because delay elements associated
with the pole and zero sections are shared.
3. In fixed-point arithmetic, internal overflow can occur at the delay-line input (output of
the leftmost summer in the figure, unlike in the DF-I implementation, which can only
overflow if the output overflows.
4. As with all direct-form filter structures, the poles and zeros are sensitive to round-off
errors in the coefficients, especially for high transfer-function orders. Lower sensitivity
is obtained using series low-order sections (e.g., second order), or by using ladder
or lattice filter structures.

MATLAB Code

Page No: 40
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Output

Quiz
i) Obtain the direct form II and parallel structures for the system

3 1 1
𝑦(𝑛) = 𝑦(𝑛 − 1) − 𝑦(𝑛 − 2) + 𝑥(𝑛) + 𝑥(𝑛 − 1)
4 8 3
ii) Obtain the direct and cascade structure for the system function
𝐻(𝑧) = (1 + 0.25𝑧 + 𝑧 )(1 + 0.5𝑧 + 𝑧 )

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 41
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-14

Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Design digital filters

Objectives: Write a program to design digital FIR filter using various windowing technique.

Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:

An ideal low-pass filter has infinite attenuation in the stop-band. When we approximate an
ideal filter with a practical filter using the window method, we accept some approximation
error. The peak approximation error depends on the window type and is known for each
window as reported in Table:

Suggested MATLAB function:


1. fir1()
2. freqz ()
3. bartlett()
4. kaiser()

MATLAB Code

Page No: 42
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Output

Quiz
i) Design a low pass FIR filter with rectangular window with M=7.
| |
𝐻 (𝑤) = 𝑒
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Wc is 1 rad/sec
ii) Write a short note on designing of FIR filter using windowing method.

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 43
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-15

Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Design digital filters

Objectives:
A) Create Blackman-Harris, Hamming and Gaussian window and plot them in the same filter
design tool.
(B) Design an FIR filter with side lobe attenuation of 40 dB using Kaiser Window of 200
points.

Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:
Blackman window
The Blackman window exhibits an even lower maximum stopband ripple (about 74 dB down)
in the resulting FIR filter than the Hamming window. It is defined mathematically as

4𝜋𝑛
𝑤(𝑛) = 0.42 − 0.5𝑐𝑜𝑠(2𝜋𝑛/𝑁 − 1) + 0.08𝑐𝑜𝑠 − 1 𝑛 = 0,1, … , 𝑁 − 1
𝑁
Hamming window
The Hamming window coefficients are given by the following formula:
2𝜋𝑛
𝑤(𝑛) = 0.54 − 0.46𝑐𝑜𝑠 − 1 𝑛 = 0,1, … , 𝑁 − 1
𝑁
Gaussian window

The coefficients of a Gaussian window are computed from the following equation:
( )
𝑤(𝑛) = 𝑒 ( )/

where –(L – 1)/2 ≤ n ≤ (L – 1)/2, and α is inversely proportional to the standard deviation, σ,
of a Gaussian random variable. The exact correspondence with the standard deviation of a
Gaussian probability density function is σ = (L – 1)/(2α).
Suggested MATLAB function:
1. blackman()
2. hamming()
3. zplane()

Page No: 44
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Output

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 45
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-16

Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Design digital filters

Objectives: (A) Design low pass butter worth digital filter with given specification using
impulse invariance method.
(B) Design a high pass elliptical filter with given specification using impulse invariance
method.
(C) Design a band pass chebychev-2 filter with given specification using impulse in-variance
method.

Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:

Suggested MATLAB function:

Page No: 46
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

1. butter()
2. ellip()
3. cheby2()

MATLAB Code

Output

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 47
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-17

Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Design digital filters

Objectives: Design a second-order digital bandpass Butterworth filter with the following
specifications:
fu= 2.6 kHz,fL = 2.4 kHz , fs = 8000 Hz. Plot the magnitude and phase response.

Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:

Suggested MATLAB function:


1. butter()
2. freqs()

Page No: 48
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

MATLAB Code

Output

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 49
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-18

Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Analyse discrete time signals in frequency domain

Objectives: Write a program to compute N-point DFT of a given sequence. Plot its
magnitude and phase response.

Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:

The DFT is one of the most powerful tools in digital signal processing which enables us to find
the spectrum of a finite-duration signal.

The DFT is based on sampling the DTFT, at equally spaced frequency points. 𝑋(𝑒 ) is a
periodic function in ω with a period of 2π. If we take N samples in each period of 𝑋(𝑒 ) , the
spacing between frequency points will be . Hence, the frequency of the set of sinusoids that
we are looking for will be of the form × 𝑘., where we can select k=0,1,2…N-1. Using
complex exponentials formula of DFT is given as below:

𝑋(𝑘) = 𝑥(𝑛)𝑒

Suggested MATLAB function:


1. freqs()

MATLAB Code

Output
Page No: 50
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Quiz
1) Suppose we have two four point sequence x[n] and h[n] as follows:
x[n] = cos(πn/2), n=0,1,2,3.
h[n] = 2 n n=0,1,2,3.
a) Calculate the four point DFT X[k].
b) Calculate the four point DFT H[k].

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 51
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-19

Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Analyse discrete time signals in frequency domain

Objectives: Write a program to perform circular convolution of two sequences using DFT.

Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:

Let us take two finite duration sequences x1(n) and x2(n), having integer length as N. Their
DFTs are X1(K) and X2(k) respectively, which is shown below

𝑋 (𝑘) = 𝑥 (𝑛)𝑒

𝑋 (𝑘) = 𝑥 (𝑛)𝑒

Now, we will try to find the DFT of another sequence x3(n), which is given as X3(K).
𝑋 (𝑘) = 𝑋 (𝑘). 𝑋 (𝑘)
By taking the IDFT of the above we get

1
𝑥 (𝑛) = 𝑋 (𝑘)𝑒
𝑁

Suggested MATLAB function:


Write a MATLAB code to create function of DFT and IDFT.

MATLAB Code

Page No: 52
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Output

Quiz
i) What is circular convolution? How is it different from linear convolution?

x(n) = cos(πn/2) for n=0,1,2,3


h(n) = 2n for n= 0,1,2
a) Calculate y[n] = x[n] * h[n] by circular convolution
b) Calculate y[n] of part (a) by multiplying the DFTs of x[n] and h[n] and
performing an inverse DFT.

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 53
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Practical-20

Date:

Competency and Practical Skills Introduction to the MATLAB technical computing


environment. Data analysis, modeling, visualization, and build computational competence with
MATLAB.

Relevant CO: Analyse discrete time signals in frequency domain

Objectives: Write a program to perform linear convolution of two sequences using DFT.

Equipment/Instruments:

MATLAB 2021a with Signal Processing Toolbox

Theory:

Let us take two finite duration sequences x1(n) and x2(n), having integer length as N. Both the
discrete time domain signal is to be padded with zeros corresponding to the length of other
signal. Then take DFTs of the padded sequence and they are X1(K) and X2(k) respectively,
which is shown below

𝑋 (𝑘) = 𝑥 (𝑛)𝑒

𝑋 (𝑘) = 𝑥 (𝑛)𝑒

Now, we will try to find the DFT of another sequence x3(n), which is given as X3(K).
𝑋 (𝑘) = 𝑋 (𝑘). 𝑋 (𝑘)
By taking the IDFT of the above we get

1
𝑥 (𝑛) = 𝑋 (𝑘)𝑒
𝑁

Suggested MATLAB function:


Write a MATLAB code to create function of DFT and IDFT.

MATLAB Code

Page No: 54
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Output

Quiz

i) Find linear convolution of the sequences x(n) = {2,5,0,4}, n= 0:3 and x(n) = {4,1,3},
n=0:2 using (a) circular convolution and, (b) DFT and IDFT.

Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson

2. “Discrete Time Signal Processing”:Oppeheim, Schafer, Buck Pearson


education publication, 2nd Edition, 2003.

References used by the students:

Rubric wise marks obtained:


Rubrics 1 2 3 4 5 Total
Marks

Faculty Sign:

Page No: 55
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Assignment-1

Question Question Marks CO BL


No.
1. For each of the following system determine whether 7 CO-1 U
the systems are 1) stable 2) causal 3) linear 4) time
invariant 5) memoryless
T(x[n]) = 𝑥[𝑛 − 𝑛 ]
T(x[n]) = 𝑒 [ ]
T(x[n]) = a x[n]+b
T(x[n]) = x[n]+3u[n-1]
2. By direct evaluation of the convolution sum, 7 CO-2 E
determine the step response of a LTI system whose
impulse response is:
h[n] = 𝑎 u(n) 0 < a < 1
3. Consider a linear constant coefficient difference 7 CO-2 N
equation:
y[n] - 3/4y[n-1] +1/8y[n-2] = 2x[n-1]
determine y[n] for n≥0 when x[n] is δ[n] and y[n] = 0,
n<0.
4. A causal LTI system is described by the difference 7 CO-2 E
equation:
y[n] – 5y[n-1] – 6y[n-2] = 2x[n-1]
a) Determine the homogeneous response of the
system.
b) Determine the impulse response of the system
5. Let 𝑋 𝑒 denote the Fourier transform of the signal 7 CO-3 A
x[n] shown in figure, perform following function
without explicitly evaluating 𝑋 𝑒 .

a) Evaluate 𝑋 𝑒 |
b) Evaluate 𝑋 𝑒 |
c) Evaluate ∫- X(e ) dω
6. State and prove all the properties of DTFT. 7 CO-3 U
7. Perform linear convolution of following signals using 7 CO-1 U
graphical method.
ℎ(𝑛) = 𝑢(𝑛) − 𝑢(𝑛 − 𝑁)
𝑥(𝑛) = 𝑎 𝑢(𝑛)

Page No: 56
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

8. Find the frequency response H (𝑒 ) of the LTI 4 CO-2 E


system whose input and output satisfy the difference
equation:
y[n] – 1/2y[n-1] = x[n] – 2x[n-1] +x[n-2]
9. Determine whether each of the following signal is 4 CO-2 N
periodic. If the signal is periodic state its period.
x[n] = 𝑒 ( / )
x[n] = 𝑒 ( / )
x[n] = [sin(πn/5)]/(πn)
x[n] = 𝑒 ( /√ )
10. Find output of the system with impulse response h(n) 4 CO-2 N
= {1, 2, 3,4}, n= -1:2 for an input x(n) = {1,1,1,1},
n=0:3.

Assignment-2

Question Question Marks CO BL


No.
1. The input to a causal linear time invariant system is 7 CO-3 N
x[n] = u[-n-1] + (1/2)n u[n]. The z – transform of
output of this system is Y (z) =
( )( )
(a) Determine H(z), the transferor of the system
impulse response. Be sure to specify region of
convergence.
(b) What is the region of convergence for Y(z)?
(c) Determine y[n].

2. The system function of causal linear time invariant 7 CO-3 A


system is
(1 − 𝑧 )
𝐻(𝑧) =
3
(1 + 4 𝑧 )
The input of this system is x[n]=(1/3)n u[n] + u[-n-
1]

(a) Find the impulse response of the system, h[n]


(b) Find the output y[n]
(c) Is the system stable?

3. Find inverse Z-transform of following: 7 CO-3 E


a. 𝐻(𝑧) = for all possible ROCs.
b. X(z) = log(1+a z-1) |z|>a . Hint Apply
differentiation of X(z) property.

Page No: 57
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

c. 𝑋(𝑧) = ( )( )
|𝑧| > 1
d. 𝑋(𝑧) = ( . )( )
|𝑧| >

e. 𝑋(𝑧) = |𝑧| >


4. Find Z-transform of following. 7 CO-3 E
a. 𝑥(𝑛) = 𝑎 𝑢(−𝑛)
b. 𝑥(𝑛) = 𝑛 𝑎 𝑢(𝑛)
c. 𝑥(𝑛) = 𝑎 𝑠𝑖𝑛(𝑤 𝑛)𝑢(𝑛)
5. Suppose 𝐻(𝑧) =
.
. Find impulse response 7 CO-3 E
.
h(n) of its inverse system for all possible ROCs.

6. Find out all pass minimum phase description of given 4 CO-3 A


system.
1 + 3𝑧
𝐻(𝑧) =
1
1+ 2𝑧
7. Define ROC. List properties of ROC. 7 CO-3 R
8. Prove all the properties of Z-transform. 7 CO-3 U
9. Determine the unit step response of the causal system 7 CO-3 A
for which z- transform of impulse response is:
(1 − 𝑧 )
𝐻(𝑧) =
(1 − 𝑧 )
10 Show relationship between Z- transform and DTFT. 4 CO-3 U

Assignment-3

Question Question Marks CO BL


No.
1. Consider the causal LTI system with system function 7 CO-4 N

8
2 − 3𝑧 − 2𝑧
𝐻(𝑧) =
1 2
1 − 3𝑧 1 + 3𝑧

Draw a signal flow graph that implement this system


as a parallel combination of first order transposed
direct form II section.
2. For the system function 7 CO-4 N
1 + 2𝑧 + 𝑧
𝐻(𝑧) =
3 1
1 − 4𝑧 + 8𝑧
Draw the flow graphs of all possible realization for
this system as cascaded of first order system.
3. Write short note on structures of IIR system. 7 CO-4 R
4. Write short note on structures of FIR system 7 CO-4 R

Page No: 58
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

5. Draw direct and cascade structure for the system 7 CO-4 N


function

𝐻(𝑧) = (1 + 0.25𝑧 + 𝑧 ) (1 + 0.5𝑧


+𝑧 )

6. Using a rectangular window, design an LPF with a 7 CO-4 A


pass-band gain of unity, cut-off frequency of 1000 Hz,
and working at a sampling frequency of 5 KHz. Take
the length of the impulse response as 7.
7. An analog filter system function is given by 7 CO-4 A
𝑆+1
𝐻 (𝑆) =
(𝑆 + 1) + 16

Convert this filter into digital IIR filter using Bilinear


transformation, if digital filter resonant frequency is
𝜔 =
8. Discuss Impulse Invariance method for IIR filter 7 CO-4 U
design.
9. Name different windows used for FIR filter design 7 CO-4 R
and explain Kaiser window in detail.
10. Compare IIR and FIR filter. 4 CO-4 R

Page No: 59
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Assignment-4

Question Question Marks CO BL


No.
1. Find 4-pt DFT of 𝑥 (𝑛) = {0,1, 2, 3}. 4 CO-3 N
2. Find 4-pt IDFT of X(k)= {6, -2+2j, -2, -2-2j}. 4 CO-3 N
3. Compare DTFT, Z-transform and DFT. 4 CO-3 U
4. Consider input sequence 𝑥 (𝑛) = {1, 2, 3} and 7 CO-3 C
impulse response of a system ℎ (𝑛) = {1, 1}. Find the
linear convolution using graphical circular
convolution method. Match result of same using
tabulation/ matrix method.
5. Explain circular shift and symmetry properties of 7 CO-3 U
DFT.
6. Given 𝑥(𝑛) = 2 and N=8. Find X(k) using DIT- 7 CO-3 E
FFT algorithm.
7. Given 𝑥(𝑛) = 2 and N=8. Find X(k) using DIF- 7 CO-3 E
FFT algorithm.
8. Discuss in brief: Radix-2 Decimation-in-Time FFT 7 CO-3 A
algorithms.
9. Discuss in brief: Radix-2 Decimation-in-Frequency 7 CO-3 A
FFT algorithms.
10. Explain how computation complexity is reduced in 4 CO-3 A
FFT compared to DFT.

Page No: 60
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT

Digital Signal Processing


3171003

Lab Manual / Assignments are prepared by


Prof. (Dr.) P.J.Brahmbhatt
Associate Professor, EC
LDCE, Ahmedabad

Prof. Ghanshyam Shah


Assistant Professor, EC
VGEC,Chandkheda

Branch Coordinator
Prof.(Dr.) Milind Shah
Professor, EC
SSEC, Bhavnagar

Committee Chairman
Dr N M Bhatt
Professor of Mechanical Engineering
L. E. College, Morbi

Page No: 61
DIGITAL SIGNAL PROCESSING (3171003)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy