Linear Convolution in Matlab

1. linear convolution in matlab

How to perform Linear convolution using fft, filt functions in matlab

lets say we have
x[n] = 2*(n-1).*e^(n-1), n = 1, 2, …, 64
and
h = ones(1,8 )/8

I tried to do it in many different ways, is it me or its not possible to do it using these 2 functions?

•

2. linear convolution matlab

Hi

this is in the help section

X = fft([x zeros(1,length(y)-1)])
Y = fft([y zeros(1,length(x)-1)])
conv(x,y) = ifft(X.*Y)

if you think this info is useful, click on 'helped me' for statistics

Sal

•

3. matlab program for linear convolution

Originally Posted by Sal
Hi

this is in the help section

X = fft([x zeros(1,length(y)-1)])
Y = fft([y zeros(1,length(x)-1)])
conv(x,y) = ifft(X.*Y)

if you think this info is useful, click on 'helped me' for statistics

Sal
Hello Sal,
yes i did this before and it works, when we ignore the round off error, but in this way we dont use filt which i need to use

as i know if y=conv(x,h)
then Y(Z)=X(Z)H(Z)

but this is not working in MATLAB, always gives me an error

•

4. Re: Linear Convolution in Matlab

n=6;
x=[1 2 2 3];
h=[2 4 3];
m=length(x);
n=length(h);
X=[x,zeros(1,n-1)];
H=[h,zeros(1,m-1)];
for i=1:m+n-1
Y(i)=0;
for j=1:m
for j=1:i
Y(i)=Y(i)+X(j)*H(i-j+1);
end
end
end
disp(x);
disp(h);
disp(Y);

guys..this is correct program:)try out!

--[[ ]]--