Jan 18, 2007 #1 Deathlich Newbie level 6 Joined Oct 11, 2006 Messages 14 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,405 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?
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?
Jan 19, 2007 #2 S Sal Full Member level 4 Joined Nov 29, 2005 Messages 234 Helped 53 Reputation 106 Reaction score 13 Trophy points 1,298 Activity points 3,034 linear convolution matlab Hi this is in the help section X = fft([x zeros(1,length-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
linear convolution matlab Hi this is in the help section X = fft([x zeros(1,length-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
Jan 19, 2007 #3 Deathlich Newbie level 6 Joined Oct 11, 2006 Messages 14 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,405 matlab program for linear convolution Sal said: Hi this is in the help section X = fft([x zeros(1,length-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 Click to expand... 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
matlab program for linear convolution Sal said: Hi this is in the help section X = fft([x zeros(1,length-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 Click to expand... 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
Feb 1, 2011 #4 M maggi03 Newbie level 3 Joined Feb 1, 2011 Messages 4 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,296 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 programtry out! Last edited: Feb 1, 2011
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 programtry out!