フィルターのクリア

How can I calculate the inverse fourier transform in matlab?

12 ビュー (過去 30 日間)
Marcia Azeredo
Marcia Azeredo 2013 年 3 月 11 日
Hi. I have to calculate the inverse fourier transform of the function F in may code and compare with the original function f. The code is
w0=15; %frequencia da fonte
w=linspace(1,150,150); %vetor da frequencia
deltaw=w(2)-w(1);
t=linspace(0,30,150); %vetor do tempo
alpha=0.1; %coeficiente de atenuação de sinal sísmico
for nt=1:length(t)
if t(nt)>=0.0
H(nt)=1.0; %H(t) é a função de Heaviside
end
if t(nt)<0.0
H(nt)=0.0;
end
f(nt)=H(nt)*(exp(1)^(-alpha*t(nt)))*sin((pi/180)*w0*t(nt));
end
for nw=1:length(w)
F(nw)=alpha/(alpha^(2)+(w(nw)+(pi/180)*w0)^(2));
end
A=(i*t'*w);
B=exp(A);
Ftempo=(1/(2*pi))*deltaw*(F*B.');
plot(t,f,t,real(Ftempo))
But the graphic is not good. What I have to do?
  1 件のコメント
Youssef  Khmou
Youssef Khmou 2013 年 3 月 11 日
i tried to change your code , but i do not understand the lines : "A=i*t'*w);......"

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

採用された回答

Youssef  Khmou
Youssef Khmou 2013 年 3 月 11 日
編集済み: Youssef Khmou 2013 年 3 月 11 日
hi Marcia,
Are you trying to compute the inverse Fourier Transform of the Heaviside function and compare it with Heaviside function?
you can try this code in which Fast Fourier Transform is computed using loops not built in fft function :
w0=15; %frequencia da fonte
w=linspace(1,150,150); %vetor da frequencia
deltaw=w(2)-w(1);
t=linspace(-10,30,150); %vetor do tempo
alpha=0.1; %coeficiente de atenuação de sinal sísmico
% HEAVIVISE FUNCTION H, F(H)=z and F^1(z)=ZZ
for nt=1:length(t)
if t(nt)<0.0
H(nt)=0.00; %H(t) é a função de Heaviside
elseif t(nt)==0
H(nt)=0.5;
elseif t(nt)>0.0
H(nt)=1.00;
end
end
figure, plot(t,H,'LineWidth',1.9), axis([-10 30 -1 2]), title(' Heaviside function H(x)'), grid on ,
% Fourier Transform, without using FFT
N=length(H);
nfft=N;
z=zeros(1,nfft);
Sum=0;
for k=1:nfft
for jj=1:N
Sum=Sum+H(jj)*exp(-2*pi*j*(jj-1)*(k-1)/nfft);
end
z(k)=Sum;
Sum=0;% Reset
end
figure, plot(w, abs(z),'LineWidth',1.9), title(' Fourier Transform of F[H(x)]'), grid on
% Inverse FOURIER Transform
ZZ=zeros(1,nfft);
Sum=0;
for k=1:nfft
for jj=1:N
Sum=Sum+z(jj)*exp(2*pi*j*(jj-1)*(k-1)/nfft);
end
ZZ(k)=Sum;
Sum=0;% Reset
end
ZZ=ZZ/N;
figure, plot(t, real(ZZ),'LineWidth',1.9), title(' Inverse Fourier Transform F^{-1}[F[H(x)]]=H(x)'), grid on
axis([-10 30 -1 2])
  1 件のコメント
Marcia Azeredo
Marcia Azeredo 2013 年 3 月 12 日
Yes. This is what I would like to do. Thanks. I'l test this code.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by