如果我有一个光脉冲,我可以将其定义为(在某些边界内,并且高斯函数)
在对其应用 FFT 之后,我可以将脉冲移到频率范围内,并且通过及时使用足够高的分辨率,我可以准确地解析. 不幸的是,对于大时间窗口,这需要高分辨率,这会减慢速度。因此,一个想法是(在我对振荡不感兴趣之后,只对包络感兴趣)替换
和
即将中心频率从到. 现在,与初始情况相比,FFT 所需的分辨率显着降低,但我现在不知道如何识别所涉及的频率。
我写了一个简短的例子,如下:
import matplotlib.pyplot as plt
import scipy.constants as scco
import numpy as np
def create_gaussian_function(x, t):
return np.exp(-np.power(x / t, 2))
l_0 = 1550e-9
w_0 = 2 * np.pi * scco.speed_of_light / l_0
class pulse:
def __init__(self, Nt, t_min, t_max, l_min, l_max, t_0, l_0, with_main_frequency = False):
self.t_vec = np.linspace(t_min, t_max, Nt, dtype=complex)
self.t_min = t_min
self.t_max = t_max
self.Nt = Nt
self.t_0 = t_0
self.l_0 = l_0
self.w_0 = 2 * np.pi * scco.speed_of_light / self.l_0
self.with_main_frequency = with_main_frequency
self.dt = np.real(self.t_vec[1] - self.t_vec[0])
#self.f_vec = np.fft.fftfreq(Nt, self.dt)
self.f_vec = []
self.index_minimum_frequency = 0
f_min = scco.speed_of_light / l_max
f_max = scco.speed_of_light / l_min
for i in range(int(Nt / 2)):
local_f = i / (self.t_max - self.t_min)
if local_f < f_min:
self.index_minimum_frequency += 1
if local_f >= f_min and local_f <= f_max:
self.f_vec.append(local_f)
self.f_vec = np.asarray(self.f_vec)
self.Nf = len(self.f_vec)
print("Minimal frequency:", self.f_vec[0], ", maximum frequency:", np.max(self.f_vec))
if 0 in self.f_vec:
self.l_vec = scco.speed_of_light / self.f_vec[1:]
self.l_vec = np.concatenate(([0], self.l_vec))
else:
self.l_vec = scco.speed_of_light / self.f_vec
print("Minimal wavelength:", np.min(self.l_vec) * 1e9, ", maximum wavelength:", np.max(self.l_vec * 1e9))
self.data_vec = create_gaussian_function(self.t_vec, self.t_0)
if self.with_main_frequency:
self.data_vec *= np.exp(-1j * self.w_0 * self.t_vec)
t_min = -5e-13
t_max = 10e-13
t_0 = 1e-13
Nt = 2048
l_min = 100e-9
l_max = 10000e-9
pulse_with_frequency = pulse(Nt, t_min, t_max, l_min, l_max, t_0, l_0, True)
pulse_without_frequency = pulse(128, t_min, t_max, l_min, l_max, t_0, l_0, False)
plt.plot(pulse_with_frequency.t_vec, np.real(pulse_with_frequency.data_vec))
plt.plot(pulse_without_frequency.t_vec, np.real(pulse_without_frequency.data_vec))
plt.show()
plt.plot(pulse_with_frequency.l_vec, np.abs(np.fft.ifft(pulse_with_frequency.data_vec))[pulse_with_frequency.index_minimum_frequency:pulse_with_frequency.index_minimum_frequency + pulse_with_frequency.Nf])
plt.xlim((0, 2000e-9))
plt.show()
plt.plot(pulse_without_frequency.l_vec, (np.abs(np.fft.ifft(pulse_without_frequency.data_vec)))[pulse_without_frequency.index_minimum_frequency:pulse_without_frequency.index_minimum_frequency + pulse_without_frequency.Nf])
plt.show()
当移动脉冲时,我可以将必要的分辨率降低 16 倍,而不会丢失包络的 FFT 信息,但我也不再具有脉冲的中心频率self.f_vec。对于未来的计算,在一些计算取决于频率/波长之后,我需要这些值。
因此,即使我移除了载波,我如何重新计算所涉及的频率和波长以再次表示脉冲?或者那不可能?