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 CenterFile Exchange에서 Discrete 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