0% found this document useful (0 votes)
35 views3 pages

Program

This program computes circular convolution with zero padding. It takes in two sequences as input, multiplies them together, pads the result with zeros to make it the same length as the sum of the two input sequences, and plots the input, impulse response, and output sequences. The output is the convoluted sequence.

Uploaded by

vijay cvijay
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)
35 views3 pages

Program

This program computes circular convolution with zero padding. It takes in two sequences as input, multiplies them together, pads the result with zeros to make it the same length as the sum of the two input sequences, and plots the input, impulse response, and output sequences. The output is the convoluted sequence.

Uploaded by

vijay cvijay
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/ 3

Program:

% Program for Computing Circular Convolution with zero padding


clc;
close all;
clear all;
x=input('enter the first sequence');
h=input('enter the 2nd sequence');
y=x'*h;
n1=length(x);
n2=length(h);
figure
subplot(3,1,1)
stem(x);
title('Input sequence');
xlabel('n1');
ylabel('x(n1)');
subplot(3,1,2)
stem(h);
title('Impulse sequence');
xlabel('n2');
ylabel('h(n2)');
n=n1+n2-1;
c=zeros(n);
for i=1:n1
for j=1:n2
c(i+j-1)=c(i+j-1)+y(i,j);
end
end
for i=1:n
d(i)=c(i,1);
end
disp('convoluted sequence');
disp(d);
n3=1:n;
subplot(3,1,3)
stem(n3-1,c);
title('Convoluted sequence');
xlabel('time');
ylabel('Amplitude');

OUTPUT:
enter the first sequence [1 2 4]
enter the 2nd sequence [1 2]
The resultant signal is y=1 4 8 8

Result:
Output:
Enter the length of exponential sequence:7
Enter “a” value: 0.9
y=0000011111

ans=
11111
Columns 1 through 3 Columns 4 through 6 Columns 7 through 8
1.000 2.4596 6.0496 14.8797 36.5982 90.0171 221.4064 544.5719

Enter the length of the FFT sequence:12


1.0e+02*
Columns 1 through 2
9.1698+0.0000i -7.8312+1.7423i
Columns 3 through 4
5.0473-3.6933i -1.8986+4.6697i
Columns 5 through 6
-1.0256-4.2223i 3.1176+2.4810i
Columns 7 through 8
-3.8687+0.0000i 3.1176+2.4810i
Columns 9 through 10
1.0256+4.2224i -1.8986-4.6697i
Columns 11 through 12
5.0473+3.6933i -7.8312-1.7423i

You might also like