# Given below is the code for a radiated electric field as a function of time. I need to take its Fourier transform.

조회 수: 3 (최근 30일)
Jasmine 2023년 1월 4일
답변: Christopher McCausland 2023년 1월 4일
clc;clear all;
tau=35*10^-15
mu=200*(10^(-4))
E_b=30
e0=8.854*(10^(-12))
pi=3.14
w0=20*10^-6
A=pi*(w0^(2))
lambda=800*10^-9
c=3*10^8
I0=1.59*(10^20)
t=linspace(-0.3*10^-12,0.3*10^-12,500)
I=I0*exp(-((t./tau).^2))
plot(t,I)
xlabel('time(ps)');
ylabel('I(t)');
e=1.602*10^-19;
eta=377;
F_opt=10
F_opt_2=1.3
F_opt_3=1.0
b=5*10^-6;
n=3.94;
m=200*(10^(-4));
E_b=30;
pi=3.14;
R=0.359
c=3*10^8;
I0=1.59*(10^20)
h=6.626*10^-34;
h_cross=h./(2*(pi));
w=2.3561*10^15;
E_p=h_cross*w
r=20*10^-6;
A=pi*(r^(2))
B=(A.*e.*(1-R).*m)./(4.*pi.*e0.*c.^(-2).*b.*h_cross.*w.*sqrt(pi))
D=(eta.*e.*(1-R).*m)./((n+1).*h_cross.*w.*sqrt(pi))
syms x
f_1=tau.*exp(-x.^(2));
t=linspace(-0.3*10^-12,0.3*10^-12,500);
fun=matlabFunction(f_1,'Vars',x)
for k = 1:length(t)
z_1(k)=integral(fun,-Inf,(t(k)/tau),'ArrayValued',true);
end
plot(t,Q)
xlabel('time(ps)');

댓글을 달려면 로그인하십시오.

### 채택된 답변

Christopher McCausland 2023년 1월 4일
Hi Jasmine,
You can use the inbuilt fft() function. Documentation is here.
Christopher

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Fast Fourier Transforms에 대해 자세히 알아보기

### Community Treasure Hunt

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

Start Hunting!

Translated by