필터 지우기
필터 지우기

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 CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by