How to implement ifft?

3 ビュー (過去 30 日間)
bazrafshan88@gmail.com
bazrafshan88@gmail.com 2015 年 7 月 15 日
編集済み: bazrafshan88@gmail.com 2015 年 7 月 16 日
Dear all
I have been having a big problem understanding the concept of numerical ifft. Consider a function in spatial domain like f(x)=-2/pi*Ln(abs(x)) for -Lx<x<Lx. The fourier transform of this function is F(w)=2/abs(w). I want to figure out whether these two are numerically the same using ifft command in Matlab. If you run the simple code below, you will see the difference that bothers me:
clc
clear all
Lx=0.0005;
N=pow2(10);
dx=2*Lx/(N-1);
w=pi/(N*dx)*linspace(-N/2,N/2,N);
Hw=2./abs(w);
hx=1/dx*abs(fftshift(ifft(Hw)));
x=linspace(-Lx,Lx,N);
hxexact=-2/pi.*log(abs(x));
plot(x,hx,x,hxexact,'r')
legend('ifft','exact')
I would appreciate that if anyone could help me with this.

回答 (0 件)

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by