0% found this document useful (0 votes)
42 views1 page

Block Convolution Function in MATLAB

This function performs block convolution on a signal x using a filter h. It divides the input signal x into overlapping blocks of size b, convolves each block with the filter h using linear convolution, and combines the results using overlap-add method to produce the final output y. It takes in the input signal x, filter h, and block size b as inputs and returns the convoluted signal y.

Uploaded by

Gaurvi Arora
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)
42 views1 page

Block Convolution Function in MATLAB

This function performs block convolution on a signal x using a filter h. It divides the input signal x into overlapping blocks of size b, convolves each block with the filter h using linear convolution, and combines the results using overlap-add method to produce the final output y. It takes in the input signal x, filter h, and block size b as inputs and returns the convoluted signal y.

Uploaded by

Gaurvi Arora
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

%%2.

Block Convolution
function [y] = bconvolution(x,h,b)
%UNTITLED8 Summary of this function goes here
% Detailed explanation goes here
w1=length(x);
w2=length(h);
%no. of elements in the convoluted matrix
m=w1+w2-1;
b1=b-1;
b2=b+1;
%no. of blocks to be created
n=w1/b;
%Start variable
s=1;

for i=1:n
%creating blocks
x1= x(s:s+b1);
s=s+b;
%Matrix Method Convolution
y1=lconvolution(x1,h);

if(i==1)
%Appending first created block
y=[y1];
else
%Overlap Addition method
y(b2,1)=y(b2,1)+y1(1,1);
%Appending the created blocks
y=[y;y1(2:b2,1)];
end

end

Not enough input arguments.

Error in bconvolution (line 5)


w1=length(x);

Published with MATLAB® R2015b

You might also like