0% found this document useful (0 votes)
2 views

Digital Signal Processing Lab Manual Part 1

The document outlines a series of experiments for a Digital Signal Processing Lab course, including the use of MATLAB and Scilab for signal generation and analysis. Key experiments involve generating basic signals, implementing IIR Butterworth filters, and utilizing virtual labs for filter design. General instructions emphasize preparation, safety, and proper documentation during lab sessions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Digital Signal Processing Lab Manual Part 1

The document outlines a series of experiments for a Digital Signal Processing Lab course, including the use of MATLAB and Scilab for signal generation and analysis. Key experiments involve generating basic signals, implementing IIR Butterworth filters, and utilizing virtual labs for filter design. General instructions emphasize preparation, safety, and proper documentation during lab sessions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

DigitalSignal Processing Lab (KEC-553A)

B. Tech. ECE, 3rd Year/5h Semester

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.

REKHA RANI (E16T1131)


EXPERIMENT NO. 1
AIM: Introduction to MATLAB and or Open Source Software,
MO0Cs) Scilab (Using Spoken Tutorial
INTRODUCTION TO MATLAB:
MATLAB stands for MATrix LABoratory, It is a technical computing
performance numeric computation and visualization developed by environment for high
Math Works, Inc. (an
American privately held corporation that specializes in mathematical computing
integrates numerical analysis, matrix computation, signal processing software). It
to-use environment, where problems and solutions are and graphics and is an easy
expressed just as they are written
mathematically, without traditional programming. MATLAB allows to express the entire
algorithm in a few dozen lines, to compute the solution with great accuracy in afew
minutes on a
computer, and to readily manipulate a three-dimensional display of the result in colour.
MATLAB is an interactive system whose basic data element is a matrix that
does not
dimensioning. It enables us to solve many numerical problems in a fraction of the time require
that it
would take to write a program and execute in language such as FORTRAN,
BASIC, or C. It also
features a family of application specific solutions,called toolboxes. Areas in which
toolboxes are
available include signal processing, image processing, control systems design, dynamic
simulation, system identification, neural networks, wavelength communication and others.systems
It can
handle linear, non-linear, continuous-time, discrete-time, multivariable and
multirate systems.
Starting MATLAB:

MATLAB

Enter MATLAB by double-clicking on the MATLAB shortcut icon (MATLAB


R2015a) on your
Windows desktop. When you start MATLAB, a special window called the MATLAB desktop
appears. The desktop is a window that contains other windows. The major tools within or
accessible from the desktop are:
> The Command Window

The Command History


> The Workspace

> The Current Directory

> The Help Browser

REKHA RANI(E16T1131)
HOWE PLOTS
APPS

New Open dCompere


HNew Varable Analyze Code Search Oocumentaon
Ipot Save Open Varable B OPreferences ( 3Communty
Deta Run and Tne
Serol
FR Wornapece Cear Wotkspe0 chor Conands
Smulnk Liyout
Set Path
Melo
Request Support
Lbrary OParalT
C User Ad4-Ons
Mayank Documents MATLAB NVIRONE
Cuent Folder
nName Command Window
New to MATLAB? Watch this Vydeo, see Examples, or read Worksoace
Geting Stated Name Valye

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

Fig. 2.1: The graphical interface to the MATLAB


When MATLAB is started for the first time, the screen
looks like
Figure 2.1. This illustration also shows the default configuration of thethe one that shown in the
can customize the arrangement of tools and MATLAB desktop. You
documents to suit your needs.
WORKING PROCEDURE WITH MATLAB:
1. Double click on Matlab icon. -> Then Matlab will be opened
2. To write the Matlab Program Go to file menu-> New -> Script(Mfile) -> In the
opened Script file write the Matlab code and save the file with an extension of .m
e.g.: "linear.m"
3. To execute Matlab Program Select the all lines in matlab program (ctrl+A)of mfile and
press "F9" to execute the matlab code.
4. Entering the inputs in command window
If the command window is displaying the message like "enter the input
sequence"
then enter the sequence with square brackets and each sample values is spaced
with single space Ex: Enter input sequence [1 23 4]
> Ifit is asking a value input write the value without brackets
Ex: "enter length of sequence 4"
> After entering inputs it displays the Output Graphs.

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) Unit Step signal: Unit step function is denoted by u(t). It is defined as


u(t) ={1, t 0
0, t<0
It is used as best test signal.Area under unit step function is unity.

Fig. 3.1: Unit step signal

2) Unit Impulse signal:Impulse function is denoted by(t), and it is defined as

S(t) = 0, t #0 and 8(t)dt = 1


S(t)

Fig. 3.2: Unit Impulse signal


3) Ramp signal: Ramp signal is denoted by r(t), and it is defined as

REKHA RANI (E16T1131)


t, t>0
r(t) = 0. t<0
r(t)

1 2

Fig. 3.3: Ramp Signal

4) Parabolic signal:Parabolic signal can be defined as

x(0) ="/2, t>o


0, t<0

x(t)

Fig. 3.4: Parabolic Signal

5) Exponential Signal:Exponential signal is in the form of x(t) =e


The shape of exponential can be defined by a
Case i: ifa= 0 ’ x(t) = e'=1.

REKHA RANI (E16T1131)


+X()

Fig 3.5:exponential equal to 1

Case ii: if a< 0i.e. -ve then x(t) =e t The shape is called decaying
exponential.
x(t)

Fig. 3.6: Decaying Exponential


Case iii If a> 0 i.e. tve then x(t)= e,The shape iscalled raising exponential.
X(t)

Fig. 3.7: Raising exponential

6) Sinusoidal Signal: Sinusoidal signal is in the form of x(t) =Acos(wot) or Asin(Wgtb).

REKHA RANI (E16T1131)


aX(t)
A

-A

Fig 3.8: Sinusoidal signal

PROGRAM: (Generation of Continuous Time Signals)


% Program for unit step, unit ramp, unit impulse and unit parabola
t=(-1:0.01:1);
impulse = t-0;
unitstep ==0;
ramp =t. *unitstep;
parabola =t.^2.*unitstep;
plot(t,[impulse unitstep ramp parabola]) ;
%Program for sine wave
t-0:0.1:10;
y=sin(2*pi*t);
subplot(3,3,1);
plot(t,y, 'k');
xlabel(»Time');
ylabel('Amplitude');
title(Sine wave');
%Program for cosine wave and triangular wave
t-0:0.1:10;
y=cos(2*pi*t);
subplot(3,3,2);
plot(t,y,k');
xlabel(Time');
ylabel('Amplitude');
title(Cosine wave');
yEsawtooth(t,.5); % sawtooth with 50% duty cycle(triangular)
subplot(3,3,5);
plot(t,y);
ylabel (Amplitude');
xlabel (Time Index');
title(Triangular waveform');
REKHA RANI (E16T1131)
% Program for
t-0:.1:8:;
exponential growing signal
a-2;
y=exp(a*t);
subplot(3,3,7);
plot(t,y);
ylabel (Amplitude');
xlabel (Time Index);
title(Exponential growing Signal);
OUTPUT: Following are the expected waveforms for the codes given
above:

0.9

0.8

0.7

0.6

0.5

0.4
03

0.2

0.1

-0 -0.6 -0.4 -0.2 0.2 0,4 0.6

Fig. 3.9: Waveform for unit step,unit ramp, unit impulse and unit parabola

Amplitude Sine wave

10
Time

Fig 3.12: Sine waveform output

REKHA RANI (E16T1131)


AmplitudeCosine wave

5 10
Time
Triangular
Amplitude waveforrm
1

5 10
Time Index

Fig 3. 10: Cosine and triangular waveform output

Exgpngtial
Amplitude growing Signal
10

10
Time Index

Fig 3.11: Exponential waveform output


RESULT: Basic functions such as unit impulse, unit step, ramp, exponential, sinusoidal and
cosine are generated successfully using MATLAB.

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

REKHA RANI (E16T1131)


EXPERIMENT NO.3
AIM: Implement IlR Butterworth analog Low Pass for a 4 KHzcut off
frequency.
EQUIPMENT REQUIRED:
Hardware required Software Required
PC
MATLAB R2015a,fda tool(filter design and analysis tool)
THEORY:

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.

REKHA RANI (E16T1131)


Low Pass Butterworth Filter Design
The frequerncy response of the Butterworth Filter approximation function is also often referred
to as "maximally flat" (no ripples) response because the pass band is designed to have a
frequency response which is as flat as mathematically possible from OHz (DC) until the cut-off
frequency at -3dB with no ripples. Higher frequencies beyond the cut-off point rolls-off down to
zero in the stop band at 20dB/decade or 6dB/octave. This is because it has a 'quality factor", "o"
of just 0.707.
PROGRAMMING STEPS:
1. Type fdatool in MATLAB command prompt.
2. Under response type panel select Lowpass.
3. Under Design method panel select IIR Butteroworth.
4. Specify any filter order.
5. Under frequency specifications specify cut off frequency f. as 4kHz.
6. Under Analysis button in the fdatool window you can observe various responses like
magnitude response, phase response etc for the filter.
7. Using realize model button on the left corner of fda tool we can see the block diagram of
the filter.
This panel displays the different analysis
responses for the filter. In this case phase
OUTPUT
response.

- Filter Design & Analysis Tool [untitled.fda )


Edit Analysis Targets View Window Help

Current Fiter lnfornation Phase Response

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 . .

Response Type. Fker Order -Frequency Specifications agntude Specificatons


Lowpess Specify order:10 Unts H:

Highpass OMnlmumn order Fs: 48000 The attenuaton at cutoff


O Bandpass frequenches is foxed eat 3 de
O Bandstop optlons Fc: 4000 (half the passband power)

)oIrferentiator
Design dethod.
There ere no optonal
Parameters for thls design
method
Butterworth
FIR Earipple

omputing Rosponbe ... Done

In this panel we can specify the cut


off frequency for filter in Hz or
KHZ.

REKHA RANI (E16T1131)


Here we can specify the design method for the
flter. In this case choose IIR Butterworth type
design method. Above this panel we can choose
the response type of filter lowpass or highpass.

Fig 8.1: FDA Tool Window in MATLAB


JFilter Design &Analysis Tool - (untitled.fda )
File Edit Analysis Targets View Window Help

Current Fter nformation Group delay.


samples)
25
Structure: Direct-Form I,
Second-Order (in 20
Sections
Order: 10
delay15
Sections
Stable Yes
Group10
Source: Designed
5

Store FRer 10 15 20
Fter Manager... Frequency (kHz)

-Response Type Fiker Order. - Frequency Specifications. LHagntude Specifications


LOwpass Specity order: 10 Units: Hz
OHighpass
O Bandpass
Minimum order Fs: 48000 The attenuation at cutoff
frequencies is foxed at 3 dB
OBandstop Options Fc: 4000 (half the passband power)

ODifferentiator There are no optional


LDesign Method parameters for this design
R method.
Butterworth
O FR Equiripple

Design Ftter

Cornputing Response ... Done

Fig. 8.2: FDA toolwindow output group delay response of filter

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

Store Fer ... 1 2


Fiter Manager Real Part

Model Optimization
Block name: Fker Optrroze for zero gams

Destination: Current OptmAZe for unty gans

Jserlred unttied Optmze for negatrve gams

Ovewrte generated Fter block Optimze delay chains


O
Buikd model using basic elements VOptimize for unity scale values

Input processing: Coumns as channels (frame based) Reaize NModel

Computing Response ... Done

Fig 8.3:FDA tool output for Pole zero plot of filter


RESULT:IR Butterworth filter is implemented successfully using MATLAB fda tool.

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:

w[n]= 0.54 -0.46(1 - cos():0snsN-1


N-1

The windows in MATLABcan be implemented using two ways


1) Using WVtool or Window Visualisation tool in MATLAB
WVtool(WindowVector) opens the Window Visualization Tool (WVTool) with time and
frequency domain plots of the window vector specified
in WindowVector. WindowVector must be a real-valued row or column vector. By
default, the frequency domain plot is the magnitude squared of the Fourier transform of
the window vector in decibels (dB).

w= blackman(N) returns the N-point symmetric Blackman window in the column


vector w, where N is a positive integer.

REKHA RANI (E16T1131)


W= blackman(N,SFLAG) returns an N-point Blackman window using the window
sampling specified by 'sflag', which can be either 'periodic' or 'symmetric (the default).
The 'periodic' flag is useful for DFT/FFT purposes, such as in spectral analysis. The
DETTFFT contains an implicit periodic extension and the periodic flag enables a signal
windowed with a periodic window to have perfect periodic extension. When 'periodic' is
specified, blackman computes a length N+1 windowand returns the first N points. When
using windows for filter design, the 'symmetric' flag should be used.
W= hamming(L) returns an L-point symmetric Hamming window.
W= hamming(L,sflag)returns a Hamming window using the window sampling specified
by sflag.
2) Using MATLAB coding
PROGRAM:

1. Create a 64-point Blackmann window. Display the result using WVtool.


L=64;
wvtool(blackman(L);
File Edit View Insert Tools Window Help

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 %

Fig 7.1: Blackman window output using wvtool in MATLAB


2. Create a 64-point Hamming window. Display the result using WV tool.
L=64;
wvtool(hamming(L))

REKHA RANI (E16T1131)


File Edt View Insert Tools Window Help

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

Fig 7.2:Hamming window output using WVtool in MATLAB

3) MATLAB programme for Blackman Window function


clear all
we-0.5*pi;
N=25;
b=firl(N,wc/pi,bartlett(N+1));
w-0:.01:pi;
h-freqz(b,1,w);
plot(w/pi,abs(h), -.);grid;
xlabel('Normalised frequency\omegapi');
ylabel('Magnitude');
hold off

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

Fig 7.3:Frequency Response of Blackman window in MATLAB using code

4) MATLAB programme for Hamming Window function


wc-0.5*pi;
N=25;
b-firl (N,wc/pi,hamming(N+1));
w=1:.01:pi;
h-freqz(b,1,w);
plot(w/pi,abs(h);
hold on
b=firl(N,wc/pi,blackman(N+1));
w-0:.01:pi;
h=freqz(b,1,w);
plot(w/pi,abs(h),-.);grid;
ylabel('Magnitude');
xlabel('normalized freqlomegapi');
hold off

OUTPUT:

REKHA RANI (E16T1131)


1.4

1.2

0.8

0.4

02

0.1 0.2 0.3 0 0.6 o7 o8 0.9

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)


EXPERIMENT NO. 5
AIM: Evaluate 4-point DFT of andIDFT of x(n) = 1,0
<n<3; 0 elsewhere.
EQUIPMENT REQUIRED:
Hardware required Software Required
PC
MATLAB R2015a
THEORY:

Given a sequence of Nsamples s[n], indexed by n = 0.N-1, the Discrete


Transform (DFT) is defined as S(k), where k-0.N-1: Fourier
N-1
S[k] )s[n]e-ilrkn/N k= 0, 1,.... N - 1
n=0

S[k] are often called the 'Fourier Coefficients' or 'Harmonics'. The


sequence sn] can be
calculated from S[k] using the Inverse Discrete Fourier Transform
(IDFT):
N-1

s[n] = (1/N) ) SIkje2nkn/N n =0, 1, ..., N -1


k=0

Ingeneral, both s[n] and S[k] are complex.


The DFT is the most important discrete transform, used to perform Fourier analysis in many
practical applications.In digital signal processing, the function is any quantity or signal that
varies over time, such as the pressure of a sound wave, a radio signal, or daily temperature
readings, sampled over a finite time interval (often defined by a window function). The DFT is
also used to efficiently solve partial differential equations, and to perform other operations such
as convolutions or multiplying large integers.
PROGRAM:
%DFT%
clc;
clear all;
close all;
a-input ('enter the input sequence');
N=length(a);
disp(length of input sequence is );
N
for k=1:N;
x(k)-0;
for i=1:N;

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:

enter the input sequence[1 111]


length of input sequence is
N=

the output is
ans =

4.0000 + 0.0000i -0.0000 - 0.0000i 0.0000 -0.0000i 0.0000 - 0.00001

REKHA RANI(E16T1131)
0
Figure 1
File Edit View Insert Tools DesktopWindow Help

magnitude response of dft


magnitude
3

1.5 2 2.5 3 3.5


discrete frequency
phase
angle phase response of dft

-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:

enter the input sequence[10 -2+2j -2 -2-2j]


the length of input sequence is
N=4
the output is
ans

1.0000 2.0000+0.0000i 3.0000 - 0.0000i 4.0000 - 0,0000i


magnitude response of the idft

35

magnitude
2.5

1.5

0.5

1.5 2 2. 3 35 4
discrete time

Fig 5.2:IDFT Output


RESULT: DFT and IDFT is studied successfully with the help of MATLAB.
VIVA QUESTIONS:
1. Define Symmetric and Anti-Symmetric Signals?
2. Define Continuous and Discrete Time Signals?
3. What are the Different types of representation of discrete time signals?
4. What are the Different types of Operation performed on signals?
5. Define DFT.How DFT can be calculated in matrix form?
6. How can you plot the magnitude response of DFT and IDFT using MATLAB?
7. Which MATLAB function plots the discrete graph in the software?

REKHA RANI (E16T1131)


EXPERIMENT NO. 6
AIM: Verify Linear convolution of two
sequences using FF1.
EQUIPMENT required:
PC
Hardware required Software Required
MATLAB R2015a
THEORY: THEORY:
Convolution is a formal mathematical operation, just as multiplication, addition, and integration.
Addition takes two numbers and produces a third number, while
and produces a third signal. convolution takes two signals
Convolution used in the mathematics of many fields,
is
such as
probability and statistics. In linear systems, convolution is used to
between three signals of interest: the input signal, the describe the relationship
impulse response, and the output signal.
MathematicalFormula: For discrete time signals s[n] and hín], linear
convolution is defined by
N-1

y[n]= ) h|k]s[n - k]
k=0

Where sl[n] is the input signal and h[n] is the


impulse response of the system.
Here we could see that one of the inputs is
with the other input signal. Linear shifted in time by a value every time it is
multiplied
Convolution is quite often used as a method of implementing
filters of various types.
In linear convolution length of
output sequence is,
Length (y[n]) = length(s[n]) + length(h[n]) - 1
PROGRAM:
clc;
clear all;
close all:
X= [212 1];
y=[123];
clin = conv(x,y)
stem(clin)
title('Linear Convolution of xand y')

REKHA RANI (E16T1131)


OUTPUT:

clin =

2 5 10 3

AFigure 1
File Edit View Insert Tools
Desktop Window Help

10 Linear Convolutlon of x and y

2+
1

1 1.5 2 2.5 3 3.5 4 4.5 5 5.5

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?

REKHA RANI (E16T1131)

You might also like