inverse Fourier transform

5 ビュー (過去 30 日間)
salih
salih 2011 年 2 月 10 日
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDiscrete Fourier and Cosine Transforms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by