(高斯宽度)我想傅里叶时域使用Python向频域变换的模拟的激光脉冲。我从高斯函数开始,因为已知“时间带宽积”(时域宽度乘以频域宽度)是0.44,当宽度用高斯的半高全宽。时间 - 带宽积使用numpy.fft
然而,在使用numpy.fft.fft
的时候,我发现时间带宽积为0.88,两次应该是什么。
import numpy as np
import matplotlib.pyplot as plt
fwhm = 40e-15 # using a 40 femtosecond pulse
t = np.linspace(-500e-15, 500e-15, 2000)
Et = np.exp(-t**2/(2*(fwhm/2.35482)**2)) # gaussian function
Ef = np.abs(np.fft.fftshift(np.fft.fft(Et))) # take the fourier transform
f = np.fft.fftshift(np.fft.fftfreq(Ef.shape[0],t[1]-t[0])) # generate the frequencies
fwhm_fft = 2 * np.abs(f[ np.argmin(np.abs(0.5*np.max(Ef)-Ef)) ]) # find the fwhm of the frequnecy-domain signal
print 'Observed time-bandwidth product: %.3f'%(fwhm*fwhm_fft)
# just making plots from here onwards:
fig, axs = plt.subplots(2,1, figsize=(6,8))
axs[0].set_title('Time domain')
axs[0].plot(t,Et)
axs[0].axvline(-fwhm*0.5, color='r', alpha=0.5, label='Full-width at half-maximum (FWHM) = %.1f fs'%(fwhm*1e15))
axs[0].axvline(fwhm*0.5, color='r', alpha=0.5)
axs[0].set_ylim(0,1.3)
axs[0].set_xlabel('Time (sec)')
axs[1].set_title('Frequency domain')
axs[1].plot(f,Ef)
axs[1].axvline(-0.44/fwhm*0.5, color='r', alpha=0.5, label='FWHM should be %.1f THz'%(0.44/fwhm*1e-12))
axs[1].axvline(0.44/fwhm*0.5, color='r', alpha=0.5)
axs[1].axvline(-fwhm_fft*0.5, color='g', alpha=0.5, label='FWHM is actually %.1f THz'%(fwhm_fft*1e-12))
axs[1].axvline(fwhm_fft*0.5, color='g', alpha=0.5)
axs[1].set_xlim(-5e13,5e13)
axs[1].set_ylim(0,120)
axs[1].set_xlabel('Frequency (Hz)')
for ax in axs:
ax.legend(fontsize=10)
ax.set_ylabel('Electric field intensity (arbitrary units)')
plt.tight_layout()
plt.savefig('time-bandwidth-product.png', dpi=200)
plt.show()
您的高斯是未标准化,导致了不同的FWHM那么你意,选中[高斯(http://mathworld.wolfram.com/GaussianFunction.html)。正规化prefactor是1 /(西格马* sqrt(2 * pi)) –
你是正确的,它没有正常化。但高斯的高度不应该影响宽度。 – DanHickstein