Вы находитесь на странице: 1из 7

Digital Signal Processing

Module 7
Convolution using DFT and IDFT
Objective:

To perform the operations of Linear and circular convolution of sequences using DFT and IDFT

Introduction:
Linear convolution takes two functions of an independent variable, i.e., time, and
convolves them using the convolution sum to find the response of LSI systems. It can be
computed using Convolution sum or using DFT. The circular convolution, also known
as cyclic convolution, of two aperiodic functions occurs when one of them is convolved in
the normal way with a periodic summation of the other function. Circular convolution is
computed using Concentric circle method, Matrix method and also using DFT.
Description:
Linear Convolution using DFT
The DFT provides a convenient way to perform convolutions without having to evaluate the
convolution sum. This process is based on convolution property of DFT.
Specifically, if h(n) is M points long and x(n) is L points long, h(n) may be linearly convolved
with x(n) as follows:

1. Pad the sequences h(n) and x(n) with zeros so that they are of length N = L + M - 1.
2. Find the N -point DFTs of h(n) and x(n).
3. Multiply the DFTs to form the product Y (k) = H (k)X ( k ) .
4. Find the inverse DFT of Y (k).
Circular Convolution using DFT
The DFT provides a convenient way to perform circular convolution.
Specifically, if x1(n) is M points long and x2(n) is L points long, the circular convolution may
be computed as follows:

1. Zero padding is performed to the sequence which is having lesser length, so that the
lengths of both the sequences is N = max(L,M)
2. Find the N -point DFTs of x1(n) and x2(n)
3. Multiply the DFTs to form the product Y (k) = X1(k)X2( k ) .
4. Find the inverse DFT of Y (k).

Illustrative Examples:

Problem 1: Perform the circular convolution of the following sequences using DFT and
IDFT methods
x1(n)={1,1,2,1} and x2 (n)={1,2,3,4}

Solution:
Problem 2: Find the linear convolution of the sequences x(n) and h(n) using DFT and
IDFT
x(n)={1,0,2} and h(n)={1,1}
Solution:
Therefore, the linear convolution result is {1,1,2,2}
Summary:
Hence, linear convolution takes two functions of an independent variable, i.e., time, and
convolves them using the convolution sum to find the response of LSI systems and is
calculated easily using DFT and IDFT

Assignment:

Problem 1: Perform the circular convolution of the following sequences using DFT and
IDFT methods
x1(n)={1,1,1,2} and x2 (n)={1,2,3,2}

Problem 2: Find the response of an LSI system with impulse response h(n) = {1,1} for the
input x(n)={1,2,3,4}using DFT and IDFT methods

Simulation:
%Linear Convolution using DFT and IDFT
clc;
x1=input('x1 : ');
x2=input('x2 : ');
x=conv(x1,x2);
subplot(211);
stem(x);
xlabel('n--->');
ylabel('Amplitude-->');
title('Answer using convolution sum');
n=length(x1)+length(x2)-1;
X1=fft(x1,n);
X2=fft(x2,n);
X=X1.*X2;
xc=ifft(X,n);
subplot(212);
stem(xc);
xlabel('n--->');
ylabel('Amplitude-->');
title('Answer using DFT method');

Input: x1 : [1 2 3 4] x2 : [1 1 1 1]
%Circular Convolution using DFT and IDFT
clc;
x1=[1,2,1,2]
x2=[4,3]
subplot(2,2,1);
stem(x1);
xlabel('n--->');
ylabel('x1(n)-->');
title('Input 1');
subplot(2,2,2);
stem(x2);
xlabel('n--->');
ylabel('x2(n)-->');
title('Input 2');

L=length(x1);
M=length(x2);
if (L>M)
x2=[x2,zeros(1,max(L-M))];
subplot(2,2,3);
stem(x1);
xlabel('n--->');
ylabel('x2(n)-->');
title('Input 2 after zero padding');

else
x1=[x1,zeros(1,max(M-L))];
subplot(2,2,3);
stem(x1);
xlabel('n--->');
ylabel('x1(n)-->');
title('Input 2 after zero padding');
end
X1=fft(x1);
X2=fft(x2);
X=X1.*X2;
display('The circular convolution :');
xc=ifft(X)
subplot(2,2,4);
stem(xc);
xlabel('n--->');
ylabel('Amplitude-->');
title('Circular convolution using DFT method');

Input:
x1 = 1 2 1 2
x2 = 4 3
The circular convolution :
xc = 10 11 10 11
References:
1. Digital Signal Processing, Principles, Algorithms and Applications – John G Proakis, Dimitris G Manolakis,
Pearson Education / PHI, 2007
2. Discrete Time Signal Processing – A V Oppenheim and R W Schaffer, PHI, 2009
3. Digital Signal Processing – Monson H.Hayes – Schaum’s Outlines, McGraw-Hill,1999
4. Fundamentals of Digital Signal Processing using Matlab – Robert J Schilling, Sandra L Harris, Thomson
2007.
5. Digital Signal processing – A Practical Approach, Emmanuel C Ifeachor and Barrie W Jervis, 2nd Edition, PE
2009

6. Digital Signal Processing – A Computer Based Approach, Sanjit K.Mitra, McGraw Hill,2 nd Edition, 2001

Вам также может понравиться