0% found this document useful (0 votes)
6 views5 pages

DSP-3(c)

The document outlines a MATLAB program to perform circular convolution of two sequences using FFT. It includes an algorithm, flowchart, and the actual MATLAB code for implementation. The result confirms successful execution of the circular convolution process.

Uploaded by

prog78659
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)
6 views5 pages

DSP-3(c)

The document outlines a MATLAB program to perform circular convolution of two sequences using FFT. It includes an algorithm, flowchart, and the actual MATLAB code for implementation. The result confirms successful execution of the circular convolution process.

Uploaded by

prog78659
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/ 5

Page No.

Ex. no: 3(c)


Circular Convolution Using FFT
Date:

AIM:

To write a MATLAB program to perform the circular convolution of two sequences using FFT.

SOFTWARE REQUIRED:

MATLAB 8.5

ALGORITHM:

 Start the program

 Enter the two input sequences x(n) and h(n)

 Find the length of the input and output sequences

 If the length of sequences are not same perform zero padding to the sequence with less length

 Find FFT of x(n) & h(n) to get X(K) & H(K)

 Multiply X(K) & H(K) to get Y(K)

 Find IFFT of Y(K) to get convolution output y(n).

 Display the output

 Plot the input & output sequences

 Stop the program

Department of Electronics & Communication Engineering


Page No. :

FLOW CHART:

Start

n1=length (x)

n2=length(h)

Perform zero padding


If the lengths are not same

X=fft(x,n)

H=fft(h,n)

Y=X*H

Y=ifft(Y)

Plot the o/p


sequence

Stop

Department of Electronics & Communication Engineering


Page No. :

PROGRAM:

clc;
clear all;
close all;
x1=input('enter the 1st input sequence');
x2=input('enter the 2nd input sequence');
n1=length(x1);
n2=length(x2);
if(n1<n2)
x1=[zeros(1,n2-n1)];
elseif(n2<n1)
x2=[zeros(1,n1-n2)];
else
x1=x1;
x2=x2;
end;
n1=length(x1);
n2=length(x2);
A=fft(x1,n1);
B=fft(x2,n2);
Y=A.*B;
y=ifft(Y);
n=length(y);
disp('circular convolution output is:');
disp(y);
t1=0:n1-1;
subplot(1,3,1);
stem(t1,x1);
xlabel('n-->');
ylabel('amplitude-->');
title('first input sequence');
t2=0:n2-1;
subplot(1,3,2);
stem(t2,x2);
xlabel('n-->');
ylabel('amplitude-->');
title('second input sequence');
t=0:1:n-1;
subplot(1,3,3);
stem(t,y);
xlabel('n-->');
ylabel('amplitude-->');
title('output sequence');

Department of Electronics & Communication Engineering


Page No. :

Department of Electronics & Communication Engineering


Page No. :

RESULT:

Thus the circular convolution of two sequences using FFT was performed and executed using
MATLAB.

Department of Electronics & Communication Engineering

You might also like