Fourier transform in Matlab

1 view (last 30 days)
Jiwan Kim
Jiwan Kim on 8 Jan 2016
Commented: Walter Roberson on 8 Jan 2016
Hello, everyone.
I am a newbie in Matlab. I started this several days ago. I am trying to do fourier transform (not FFT) in Matlab, but there comes errors. I am sure that that is grammar problems. Could you tell me what is wrong in the code ?
clear all
lamb = 800000;
A1 = 0.6;
A2 = -1.8;
n = 2.48;
k = 4.38 ;
xi = lamb/(4*pi*k);
chi = lamb/(4*pi*n);
v = 5894;
P1 = real((2*(n+1i*k))/(1-(n+1i*k)^2)*(A1+1i*A2));
P2 = imag((2*(n+1i*k))/(1-(n+1i*k)^2)*(A1+1i*A2));
syms t
F = -6*(cos(0.25*t)-0.209611)*exp(-(t/10)^2);
G =(P1*sin(v/chi*t)+P2*cos(v/chi*t)*sign(t))*exp(-abs(t)*v/xi);
ezplot(G,[-50 50])
FF = fourier(F)
GG = fourier(G)
figure;
ezplot(FF,[-20 20])
ezplot(GG,[-20 20])
Thank you in advance.
  1 Comment
Walter Roberson
Walter Roberson on 8 Jan 2016
What difficulty are you encountering? Other than the fact that GG is complex valued except at 0?
Are you certain, by the way, that you want to be plotting over negative frequencies?

Sign in to comment.

Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!