フィルターのクリア

plot of inverse fourier transform

7 ビュー (過去 30 日間)
richard
richard 2013 年 10 月 11 日
編集済み: sixwwwwww 2013 年 10 月 11 日
I am trying to plot the inverse fourier transform of a function and I want this plot to be centered at zero. This is the following code that I have:
clear
dx=1;
x=(-45:355)*dx; %'x' position
N=length(x);
ds=(1)/(N*dx);
s=(0:400)*ds; %freq position
h1=normpdf(x,0,2);
HS=abs(fft(h1));
MTF=HS;
M=(1-(1-MTF.^2).^244.9)./(MTF); %function
M1=ifftshift(ifft(M));
plot(x,M1)
I am trying to plot M1 (the inverse fourier transform of my filter, M) vs x. I am converting my filter, M, from frequency space to 'space' space. The problem is when I plot M1 vs x, the function is all the way down at 150 but I want it centered at zero and do not know how to fix it.
Any help will be appreciated
  1 件のコメント
sixwwwwww
sixwwwwww 2013 年 10 月 11 日
Do you need just simple manipulation of x-axis? mean you just want to shift x = 0 according to the maximum value in Inverse Fourier Transform?

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

採用された回答

sixwwwwww
sixwwwwww 2013 年 10 月 11 日
編集済み: sixwwwwww 2013 年 10 月 11 日
If you just need shift the x-axis with respect to maximum amplitude position in your Inverse Fourier Transform spectrum then you can do it as follows:
clear
dx=1;
x=(-45:355)*dx; %'x' position
N=length(x);
ds=(1)/(N*dx);
s=(0:400)*ds; %freq position
h1=normpdf(x,0,2);
HS=abs(fft(h1));
MTF=HS;
M=(1-(1-MTF.^2).^244.9)./(MTF); %function
M1=ifftshift(ifft(M));
[Max, Max_ind] = max(M1);
x_shift = Max_ind - abs(min(x));
x = x - x_shift;
plot(x,M1), xlim([min(x) max(x)])
This shift in space domain corresponds to a constant phase multiplication in Frequency domain

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by