我目前正在编写一个小的 Python 脚本来估计光谱中的脉冲持续时间。
最后,这个想法是观察光谱相位对脉冲持续时间和形状的影响。但就目前而言,如果不考虑光谱相位,我无法检索出众所周知的结果。
实际上,具有以 800 nm 为中心的 30 nm 宽光谱的时间带宽受限高斯脉冲的持续时间约为 31 fs。这是经验法则的基本结果。例如,您可以在此处和此处查看结果。
可悲的是,我的 Python 脚本使用numpy/matplotlib给了我两倍大的脉冲持续时间:
from numpy import power, linspace, sqrt, log, exp, abs, max, conj
from numpy.fft import fft, fftshift, fftfreq
from scipy.constants import c
from matplotlib import pyplot as plt
# Number of points for the computations
n_points = 2**9
# Spectral width and center in wavelength (nm)
wl_center = 800e-9
wl_width = 30e-9
# Conversion of spectral parameters in frequency (s-1)
freq_center = c/wl_center
freq_width = wl_width*c/power(wl_center, 2)
# Building of the x axes
frequencies = linspace(freq_center - freq_width*8, freq_center + freq_width*8, n_points)
wavelengths = c/frequencies
# Building the Gaussian spectrum according to the parameters
diff_freq = frequencies - freq_center
sig_freq = freq_width/(sqrt(8*log(2)))
spectrum_freq_abs = exp(-(power(diff_freq, 2))/(2*power(sig_freq, 2)))
# FFT
step = frequencies[1] - frequencies[0]
time = fftshift(fftfreq(n_points, d=step))
field = fftshift(fft(spectrum_freq_abs))
# Plotting
# The commented line plot the spectrum vs the wavelength. The second line plot the pulse.
# The second line plot the optical pulse envelope vs the time in fs. It is twice too large (60 fs fwhm instead of 30 fs.)
# plt.plot(wavelengths*1e9, spectrum_freq_abs)
plt.plot(time*1e15, abs(field*conj(field)))
plt.show()
我检查了由于fftfreq. 根据频率阵列大小和步长,numpy它似乎很好。所以我不认为这是一个x轴问题。
我在这个小而简单的 Python 脚本中找不到我错的地方,这非常令人沮丧。也许社区可以在某个地方给我一个提示?
PS:这是来自物理社区的转贴,我已被重定向到 scicomp。