更新时间:2023-02-26 16:59:37
快速傅里叶变换(FFT).可以使用nperseg
参数控制这些段的长度,该参数使您可以调整由于
scipy.signal.spectrogram
works by splitting the signal into (partially overlapping) segments of time, and then computing the power spectrum from the Fast Fourier Transform (FFT) of each segment. The length of these segments can be controlled using the nperseg
argument, which lets you adjust the trade-off between resolution in the frequency and time domains that arises due to the uncertainty principle. Making nperseg
larger gives you more resolution in the frequency domain at the cost of less resolution in the time domain.
除了改变进入每个段的样本数量外,有时还需要在进行FFT之前对每个段应用零填充.这就是nfft
参数的用途:
In addition to varying the number of samples that go into each segment, it's also sometimes desirable to apply zero-padding to each segment before taking its FFT. This is what the nfft
argument is for:
nfft :int,可选
如果需要零填充FFT,则使用FFT的长度.如果为 None ,则FFT长度为 nperseg .默认为无.
Length of the FFT used, if a zero padded FFT is desired. If None, the FFT length is nperseg. Defaults to None.
默认情况下为nfft == nperseg
,表示将不使用零填充.
By default, nfft == nperseg
, meaning that no zero-padding will be used.