Digital Signal Processing Lab Manual Part 1
Digital Signal Processing Lab Manual Part 1
LIST OF EXPERIMENTS
Ex. No.
Name of Experiment
1 Introduction to MATLAB and or Open Source Software, Scilab (Using Spoken
Tutorial MOOCs)
2 Write a Program for the generation of basic signals such as unit impulse, unit
Step, ramp, exponential, sinusoidal and cosine.
3 Implement IIR Butterworth analog Low Pass for a 4 KHz cut off frequency.
4
Verify Blackman and Hamming windowing techniques.
Evaluate 4-point DFT of and IDFT of x(n)= 1, 0<n<3;0 elsewhere.
6 Verify Linear convolution of two sequences using FFT.
Verify Circular Convolution of two sequences using FFT.
To verify FFT as sample interpolator.
To implement Tone Generation.
10 To implement floating point arithmetic.
11 To study about DSP Processors and architecture of
procesSOr.
TMS320C6713 DSP
12 VIRTUAL Lab by NME-ICT available at: (Through Virtual Lab)
12.1 Study of Discrete Fourier Transform (DFT) and its inverse.
12.2. Study of FIR filter design using window method: Lowpass and highpass filter
12.3 Study of FIR filter design using window method: Bandpass and Bandstop filter.
12.4 Study of Infinite Impulse Response (IIR) filter.
GENERAL INSTRUCTIONS:
1. The experiments have been designed to be performed with in the
2-hour laboratory time.
2. To successfully complete the experiment in one lab turn, come
prepared to the laboratory.
3. Read the experiment in advance.
4. List and collect the components for the experiment.
5. Be sure that the specifications and values of the
components are as per design.
6. Follow the experimental steps judiciously.
7. Record stepwise observations using proper test instruments.
8. Get the observation signed by the instructor.
9. Always take safety precautions while performing experiments.
MATLAB
REKHA RANI(E16T1131)
HOWE PLOTS
APPS
Command Hitory
l+2
clc
clear all
4-- 15-07-20.8 3:02 --4
15-07-2013 2.: - -
- - 1é-07-2-3 9::
Details
Ready
REKHA RANI(E16T1131)
EXPERIMENT NO. 2
AIM: Write aProgram for the generation of basic signals such as unit impulse, unit step,
ramp,
exponential, sinusoidal and cosine
EQUIPMENT required:
Hardware required Software Required
PC MATLAB R2015a
THEORY:
1 2
x(t)
Case ii: if a< 0i.e. -ve then x(t) =e t The shape is called decaying
exponential.
x(t)
-A
0.9
0.8
0.7
0.6
0.5
0.4
03
0.2
0.1
Fig. 3.9: Waveform for unit step,unit ramp, unit impulse and unit parabola
10
Time
5 10
Time
Triangular
Amplitude waveforrm
1
5 10
Time Index
Exgpngtial
Amplitude growing Signal
10
10
Time Index
VIVA QUESTIONS:
are related toeach other?
1. What are Singularity functions and how theyMATLAB?
plotted in
2. How step and ramp functions are
can be plotted in MATLAB?
3. How sinusoidal functions waveform output in MATLAB?
4. How can we label x axis and y axis of any
Filter Designer is a powerful graphical user interface (GUI) in the Signal Processing Toolbox for
designing and analyzing filters. Filter Designer enables you to quickly design digital FIR or IIR
filters by setting filter performance specifications, by importing filters from your MATLAB®
workspace or by adding, moving, or deleting poles and zeros. Filter Designer also provides tools
for analyzing filters, such as magnitude and phase response plots and pole-zero plots.
Type fdatool at the MATLAB command prompt:
>>fdatool
ATip of the Day dialog displays with suggestions for using Filter Designer. Then, the GUI
displays with a default filter.
The GUI has three main regions:
1) The Current Filter Information region
2) The Filter Display region and
3) The Design panel
The upper half of the GUI displays information on filter specifications and responses for the
current filter. The Current Filter Information region, in the upper left, displays filter properties,
namely the filter structure, order, number of sections used and whether the filter is stable or not.
It also provides access to the Filter manager for working with multiple filters.
The Filter Display region, in the upper right, displays various filter responses, such as, magnitude
response, group delay and filter coefficients.
The lower half of the GUI is the interactive portion of Filter Designer. The Design Panel, in the
lower half is where the filter specifications are displayed. It controls what is displayed in the
sidebar
other two upper regions. Other panels can be displayed in the lower half by using the
buttons.
Infinite impulse response (IR) is a property applying to many linear time-invariant systems.
digital filters.
Common examples of linear time-invariant systems are most electronic and
distinguished by
Systems with this property are known as IIR systems or IIR filters, and are
certain point, but
having an impulse response which does not become exactly zero past a impulse
continues indefinitely. This is in contrast to a finite impulse response (FIR) in which the
finite T, thus being of finite
response hí)does become exactly zero at times t> 7 for some
duration.
Strudure:
(radians)
Phase
Te-FormL,
d-Order
Sections
Order: 10
Sections 5
Stable: Yes 10
Source: Designed
15
10 15 20
Store FRer e Frequency (kHz)
FRer Manager . .
)oIrferentiator
Design dethod.
There ere no optonal
Parameters for thls design
method
Butterworth
FIR Earipple
Store FRer 10 15 20
Fter Manager... Frequency (kHz)
Design Ftter
REKHARANI (E16T1131)
Filter Design &Analysis Tool- (untitled.fda ")
File Edit Analysis Targets View
WindowHelp
Curent FiRer Information
Pole/Zero Plot.
1
Structure. Direct-Form IL.
Secong-Order 0.5
Sections
Order 10
Sections 0
Stable: Yes
Source: Designed -0.5
Model Optimization
Block name: Fker Optrroze for zero gams
VIVAQUESTIONS:
1. What is IIR filter?
2. What are the design methods available for a Butterworth filter?
3. HoW many kinds of responses are available for a filter?
4. What is fda tool?
5. What are the different design methods available for IIR filter?
6. How many kinds of responses we can model for a filter using fda tool?
REKHA RANI(E16T1131)
EXPERIMENT NO. 4
AIM: Verify Blackman and Hamming
windowing techniques.
EQUIPMENT REQUIRED:
Hardware required Software Required
PC
MATLAB R2015a
THEORY: Blackman windows are defined as:
w(n) = a0 - 4Tn
cosN-1) + azcos) a
2
By common convention, the ungualified term Blackman
window refers to Blackman's "not very
serious proposal" of a = 0.16 (ao = 0.42, aj = 0.5, a = 0.08), which closely
"exactBlackman", with ao =7938/18608 x0.42659, aj =9240/18608 ~0.49656, approximates the
1430/18608 ~0.076849. These exact values place zeros at the third and fourth side and az =
result in a discontinuity at the edges and a 6 dB/oct fall-off. The truncated lobes, but
null the side lobes as well, but have an improved 18 dB/oct coefficients do not
fall-off.
A filter designed with the Hamming window has minimum
is sufficient for most implementations of digital filters. The
stopband attenuation of 53dB, which
transition region is somewhat wider
than that of the Hann and Bartlett-Hanning windows, whereas the
stopband attenuation is
considerably higher. Unlike minimum stopband attenuation, the transition region can be changed
by changing the filter order. The transition region narrows, whereas the
minimum stopband
attenuation remains unchanged as the filter order increases. The Hamming window coefficients
are expressed as:
whdow Vewer
The domoln Frequencoy domaln
40
0.8
100
120
40 20 30 40 S0 -40 02 Q6
Samplos Normab zod Frequengy (<z rdsarple)
Reotive cjelobe aloru!ion sG1 e Mar wxt:n (-u8) o 05073I
LOAkago Foctor 0 %
Whdow Viewer
Tme domeln Frequeny domain
40
20
60
-00
10 20 40 60
100 02 04
Samplo Nomaizod Froquency (* radsorplo)
Leokogo Foctor 003 % Relatve sitelobo toru ston -425 dO Mrlobg wh(-3E) 00)3053
QUTPUT:
REKHA RANI(E16T1131)
1.4
1.2
Magnitude
0.8
0.6
0.4
0.2
0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
Normalised frequency o
OUTPUT:
1.2
0.8
0.4
02
nomalized frego/r
Fig 7.4:Frequency Response Curve for Hamming window using MATLAB code
RESULT: The Blackman and Hamming windows have been verified using MATLAB using
wVtool and coding.
VIVA QUESTIONS
1. What is hamming window function?
2. What is Blackman window function?
3. What is WVtool? Explain the syntax and execution.
4. How can we implement blackman window using WVtool?
5. Howcan we imnplement the hamming windowusing WVtool?
REKHA RANI(E16T1131)
x(k)=x(k)+ta(i)* exp(-i*pi*2/N)*(i-1)*(k-1):
end;
end;
k=1:N;
disp(the output is');
x(k)
subplot(2,1,1);
stem(k,abs(x(k);
grid;
xlabel (discrete frequency');
ylabel('magnitude);
title('magnitude response of dft');
subplot(2,1,2);
stem(angle(x(k) *180/(pi));
grid;
xlabel(discrete frequency');
ylabel('phase angle');
title('phase response of dft);
OUTPUT:
the output is
ans =
REKHA RANI(E16T1131)
0
Figure 1
File Edit View Insert Tools DesktopWindow Help
-50
-100
-150
1 1.5 2 2.5 3 3.5
discrete frequency
%IDFT%
clc;
clear all;
close all:
a-input(enter the input sequence');
disp("the length of input sequence is');
N=length(a);
N
for n=1:N;
x(n)-0;
for k=1:N;
x(n)=x(n)+ta(k)*exp((G*pi*2*(n-1)*(k-1)/N));
end:
end;
n=1:N;
x=1/N*x(n);
REKHA RANI (E16T1131)
disp(the output is');
x(n)
stem(n,abs(x);
grid;
xlabel('discrete time):
ylabel('magnitude');
title('magnitude response of the idft');
grid;
OUTPUT:
35
magnitude
2.5
1.5
0.5
1.5 2 2. 3 35 4
discrete time
y[n]= ) h|k]s[n - k]
k=0
clin =
2 5 10 3
AFigure 1
File Edit View Insert Tools
Desktop Window Help
2+
1
VIVAQUESTIONS:
1. Explain the significance of convolution.
2. Define linear convolution.
3. Why linear convolution is called as a periodic convolution?
4. Why zero padding is used in linear convolution?
5. What are the four steps to find linear convolution?
6. What is the length of the resultant sequence in linear convolution?
7. How linear convolution will be used in calculation of LTIsystem
response?
8. List few applications of linear convolution in LTI system design.
9. Give the properties of linear convolution.
10. How linear convolution can be used to calculate the DFT of a signal?