inverse Fourier transform

5 次查看(过去 30 天)
hi,
I have a matrix 120x200 called H. inside H, there are some data like x+iy. I'd like to take inverse Fourier of H, I tried to use, ifft command but it takes only one dimensional inverse Fourier. What command should I use or what code should I use to take inverse Fourier of a 120x200 matrix. Thank you
  1 个评论
salih
salih 2011-2-10
I also wrote a code to take inverse fourier of a matrix 120x200 size. is something wrong with the code
function out = invf(H)
for t=1:120
for tao=1:200
b=zeros(120,200);
for f=1:201
b(t,tao) = b(t,tao)+ H(t,f)*exp(1i*2*pi*(5099+f)*tao*10^-3);
end
k(t,tao)= b(t,tao);
end
end
out = k(:,:);

请先登录,再进行评论。

采纳的回答

Brett Shoelson
Brett Shoelson 2011-2-10
Look at the dimensions of your z matrix. (size(z)). Then make sure the number of x values matches the first dimen
Consider:
a = rand(3,4);
[nrows,ncols] = size(a); %Careful with this syntax if you
% have higher dimensions!
THIS WORKS:
surf(1:ncols,1:nrows, a)
BUT THIS DOESN'T:
surf(1:nrows,1:ncols, a)
Cheers,
Brett
  1 个评论
salih
salih 2011-2-10
thank you buddy, it was very helpful I solved my problem :)

请先登录,再进行评论。

更多回答(2 个)

David Young
David Young 2011-2-10
ifft2
  2 个评论
salih
salih 2011-2-10
thank you very much David for your help. can you also help me on that.
I'd like to plot 3D of inverse fourier transform. I use the following commands
x=1:120
y=1:200
z=ifft2(H(:,:))
surf(y,x,abs(z))
but I get following error
??? Error using ==> surf at 78
Data dimensions must agree.
Could you tell me how to correct it ?
David Young
David Young 2011-2-10
See comment on next "answer"

请先登录,再进行评论。


salih
salih 2011-2-10
I'd like to plot 3D of inverse fourier transform. I use the following commands
x=1:120;
y=1:200;
z=ifft2(H(:,:));
surf(y,x,abs(z))
but I get following error
??? Error using ==> surf at 78 Data dimensions must agree. Could you tell me how to correct it ?
  2 个评论
salih
salih 2011-2-10
no suggestion ?
David Young
David Young 2011-2-10
Try
surf(x, y, abs(z))
Remember that the length of x must be the number of columns of z, and the length of y must be the number of rows.

请先登录,再进行评论。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by