(高斯寬度)我想傅里葉時域使用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