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

Overlap Add Method1

This document describes an experiment using the overlap-add method for fast convolution. It provides the MATLAB code to split an input signal into blocks, convolve each block with a filter, and add the results to obtain the final output signal. The code takes the input signal, filter, and block length as inputs from the user. It then displays the input, filter, block convolutions, and final output.

Uploaded by

srikkanth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

Overlap Add Method1

This document describes an experiment using the overlap-add method for fast convolution. It provides the MATLAB code to split an input signal into blocks, convolve each block with a filter, and add the results to obtain the final output signal. The code takes the input signal, filter, and block length as inputs from the user. It then displays the input, filter, block convolutions, and final output.

Uploaded by

srikkanth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

EXPT.

NO: 1

FAST CONVOLUTION

12-6-2013

OVERLAP ADD METHOD:


Coding:
clc;
clear all;
x=input('enter the input signal x[n]');
user

%getting the inputs from the

h=input('enter the value for h[n]');


b=input('enter the no. of samples in first block');
length
n=0:1:length(x)-1;
x

%to get the input of block


%to find the length of

subplot(3,1,1);
stem(n,x)
n=0:1:length(h)-1;
h

%to find the length of

subplot(3,1,2);
stem(n,h)
x1=[x(1:b) zeros(1,length(h)-1)];
appending zeros

%spliting blocks and

x2=[x(b+1:length(x)) zeros(1,length(h)-1)];
y1=convol(x1,h);
convolution function

%calling

y2=convol(x2,h);
c=length(y1);
d=length(y2);
y2=[zeros(1,c-length(h)+1) y2];
matrices of same size
y1=[y1 zeros(1, d-length(h)+1)];
y=y1+y2;
disp(y)

%adding zeros to make both

n=0:1:length(y)-1;
subplot(3,1,3);
stem(n,y)
Execution:
enter the input signal x[n]
3
2
1]

[1

enter the value for h[n]

[1 2 1]

enter the number of samples in first block 8


x1
1

X2
1

Y1
14

14

12

14

15

15

Y2

y=
1

You might also like