How can I calculate the inverse fourier transform in matlab?
Ältere Kommentare anzeigen
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 Kommentar
Youssef Khmou
am 11 Mär. 2013
i tried to change your code , but i do not understand the lines : "A=i*t'*w);......"
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!