2017-01-26 21 views
2

(高斯宽度)我想傅里叶时域使用Python向频域变换的模拟的激光脉冲。我从高斯函数开始,因为已知“时间带宽积”(时域宽度乘以频域宽度)是0.44,当宽度用高斯的半高全宽。时间 - 带宽积使用numpy.fft

然而,在使用numpy.fft.fft的时候,我发现时间带宽积为0.88,两次应该是什么。

enter image description here 这里是我的代码(在第几行小例子,剩下的只是使地块):

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() 
+1

您的高斯是未标准化,导致了不同的FWHM那么你意,选中[高斯(http://mathworld.wolfram.com/GaussianFunction.html)。正规化prefactor是1 /(西格马* sqrt(2 * pi)) –

+1

你是正确的,它没有正常化。但高斯的高度不应该影响宽度。 – DanHickstein

回答

1

@PaulPanzer在正确的轨道上!当比较两个高斯函数的FWHM时,我们确实期望找到0.88作为时间带宽乘积。

但为什么大多数参考文献 [1,2,3]都说0.44是激光脉冲的时间带宽乘积?关键是我们实际观察到的是电场(E)的强度(I),其中I = E^2。因此,实际上,比较宽度配置文件,而不是配置文件的宽度是最有意义的。当我们比较强度分布时,我们发现时间带宽乘积确实是0.44。

修改后的代码:

import numpy as np 
import matplotlib.pyplot as plt 

fwhm = 40e-15 # using a 40 femtosecond pulse 

t = np.linspace(-1000e-15, 1000e-15, 4000) 
It = np.exp(-t**2/(2*(fwhm/2.35482)**2)) # Intensity in the time domain 
Et = np.sqrt(It)        # E-field in the time domain 

Ef = np.abs(np.fft.fftshift(np.fft.fft(Et))) # FT to get E-field in frequency domain 
If = Ef**2          # Intensity in the frequnecy domain 
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(If)-If)) ]) # find the fwhm of the frequency-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,It) 
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_xlim(-150e-15, 150e-15) 
axs[0].set_ylim(0,1.3) 
axs[0].set_xlabel('Time (sec)') 

axs[1].set_title('Frequency domain') 
axs[1].plot(f,If) 

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, ls='dashed', label='FWHM is actually %.1f THz'%(fwhm_fft*1e-12)) 
axs[1].axvline(fwhm_fft*0.5, color='g', alpha=0.5, ls='dashed') 

axs[1].set_xlim(-2.0e13,2.0e13) 
axs[1].set_ylim(0,30000) 
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() 

enter image description here

PS:RP-光子是一个奇妙的资源。它是激光和光子学领域的主要教科书之一。

+0

哈哈,在我的领域之外,为我过于自大而为我服务。你为什么不继续并接受你自己的答案?这听起来对我来说似乎是合情合理的。 –

+0

感谢您的回答保罗!它真的帮我弄清楚了。 – DanHickstein

1

编辑2:看来魔鬼是在物理,而不是数学,见丹的自我回答。平方高斯确实将半极大值的位置移动了1/sqrt(2),因此一切都很好。我仍然谦虚无保地向RP Photonics道歉。编辑2.

末我敢肯定的“错误”,你要找的是与0.44,则链接引用不看100%可靠。

所以让我们自己计算出预期的结果。傅里叶变换有不同的定义。 this one似乎是一个numpy正在坚持。在这个约定中高斯的标准偏差和它的傅立叶变换的乘积是1 /(2pi)。 SD sigma的零均值高斯的半最大值在+/- sigma sqrt(2 log 2)。因此FWHM的的产品是1 /(二皮)8日志2 = 4/PI日志2 = 0.8825 ...

换句话说:什么你观察是正确的。

编辑:为了公平起见RP Photonics公司,它们不一定是他们可能只是使用尚未傅立叶的另一个定义变换错误的。