Lab Manual EC DSP 3171003
Lab Manual EC DSP 3171003
(3171003)
Page No: 1
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
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: __________
Page No: 2
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
7. Add your Matlab code and result in each experiment before taking printout.
Page No: 3
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Page No: 4
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
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
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
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?
Total
Page No: 10
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical- 0
Program Objectives:
Course Outcomes:
Page No: 11
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical-1
Date:
Data analysis, modeling, visualization, and build computational competence with MATLAB.
Equipment/Instruments:
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.
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.
help command_name on the command line, or use ’search’ in the help window. For example,
type
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
MATLAB Code:
Output:
Quiz:
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
Faculty Sign:
Page No: 14
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical-2
Date:
Objectives: Write a matlab program to implement time shifting and time reversal operation
on discrete time sequences.
Equipment/Instruments:
Theory:
Time shifting:
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
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
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:
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).
Theory:
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
Faculty Sign:
Page No: 19
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical-4
Date:
Theory:
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
Faculty Sign:
Page No: 21
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical-5
Date:
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:
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:
Let x(n) be the input and let x(n-k) be the input delayed by k units.
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
Faculty Sign:
Page No: 24
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical:6
Date:
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:
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.
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
Faculty Sign:
Page No: 26
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical:7
Date:
Objectives: Write a matlab program to generate impulse response and step response of a
system.
Equipment/Instruments:
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)
MATLAB Code
Page No: 27
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Output
Quiz
Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson
Faculty Sign:
Page No: 28
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical:8
Date:
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:
Output
Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson
Page No: 29
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Faculty Sign:
Page No: 30
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical-9
Date:
Equipment/Instruments:
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.
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) = 𝑥(𝑛) =𝐸
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
Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson
Faculty Sign:
Page No: 32
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical-10
Date:
Objectives: Write a program to compute DTFT of a sequence x(n)= 0.5n u(n). Plot its
magnitude and phase response.
Equipment/Instruments:
Theory:
𝑋(𝜔) = 𝑥(𝑛)𝑒
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
Faculty Sign:
Page No: 34
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical-11
Date:
Objectives: Write a program to demonstrate the time shifting and frequency shifting
property of DTFT.
Equipment/Instruments:
Theory:
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
Faculty Sign:
Page No: 36
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical-12
Date:
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:
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.
𝑋(𝑍) = 𝑥(𝑛)𝑍 ;𝑍 = 𝑟 𝑒
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.
MATLAB Code
Output
Quiz
i) Find the inverse z-transform of the following.
Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson
Faculty Sign:
Page No: 38
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical-13
Date:
Objectives: Write a program for Direct form – I,II form realization of the given IIR system
function.
Equipment/Instruments:
Theory:
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.
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
Faculty Sign:
Page No: 41
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical-14
Date:
Objectives: Write a program to design digital FIR filter using various windowing technique.
Equipment/Instruments:
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:
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
Faculty Sign:
Page No: 43
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical-15
Date:
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:
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
Faculty Sign:
Page No: 45
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical-16
Date:
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:
Theory:
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
Faculty Sign:
Page No: 47
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical-17
Date:
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:
Theory:
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
Faculty Sign:
Page No: 49
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical-18
Date:
Objectives: Write a program to compute N-point DFT of a given sequence. Plot its
magnitude and phase response.
Equipment/Instruments:
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:
𝑋(𝑘) = 𝑥(𝑛)𝑒
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
Faculty Sign:
Page No: 51
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical-19
Date:
Objectives: Write a program to perform circular convolution of two sequences using DFT.
Equipment/Instruments:
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
𝑥 (𝑛) = 𝑋 (𝑘)𝑒
𝑁
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?
Suggested Reference:
1. “Digital Signal Processing: Principles, Algorithm & Application”, 4th
edition, Proakis, Manolakis, Pearson
Faculty Sign:
Page No: 53
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Practical-20
Date:
Objectives: Write a program to perform linear convolution of two sequences using DFT.
Equipment/Instruments:
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
𝑥 (𝑛) = 𝑋 (𝑘)𝑒
𝑁
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
Faculty Sign:
Page No: 55
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Assignment-1
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
Assignment-2
Page No: 57
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
c. 𝑋(𝑧) = ( )( )
|𝑧| > 1
d. 𝑋(𝑧) = ( . )( )
|𝑧| >
Assignment-3
8
2 − 3𝑧 − 2𝑧
𝐻(𝑧) =
1 2
1 − 3𝑧 1 + 3𝑧
Page No: 58
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Page No: 59
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
Assignment-4
Page No: 60
DIGITAL SIGNAL PROCESSING (3171003)
ELECTRONICS & COMMUNICATION ENGINEERING DEPARTMENT
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)