torch.signal.windows.nuttall¶
- torch.signal.windows.nuttall(M, *, sym=True, dtype=None, layout=torch.strided, device=None, requires_grad=False)[來源][來源]¶
計算根據 Nuttall 的最小 4 項 Blackman-Harris 窗。
其中 。
此窗格已正規化為 1 (最大值為 1)。 但是,如果
M
為偶數且sym
為 True,則不會出現 1。- 參數
M (int) – 窗格的長度。 換句話說,傳回窗格的點數。
- 關鍵字引數
sym (bool, optional) – 如果為 False,則傳回適用於頻譜分析的週期性窗格。 如果為 True,則傳回適用於濾波器設計的對稱窗格。 預設值:True。
dtype (
torch.dtype
, optional) – 傳回張量的所需資料類型。 預設值:如果None
,則使用全域預設值 (請參閱torch.set_default_dtype()
)。layout (
torch.layout
, optional) – 傳回 Tensor 的所需版面配置。 預設值:torch.strided
。device (
torch.device
, optional) – 傳回張量的目標裝置。預設值:如果None
,則使用預設張量類型的目前裝置 (請參閱torch.set_default_device()
)。device
將會是 CPU 張量類型的 CPU,以及 CUDA 張量類型的目前 CUDA 裝置。requires_grad (bool, optional) – 如果 autograd 應該記錄在傳回張量上的運算。預設值:
False
。
- 回傳類型
參考資料
- A. Nuttall, "Some windows with very good sidelobe behavior," IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. 29, no. 1, pp. 84-91, Feb 1981. https://doi.org/10.1109/TASSP.1981.1163506 - Heinzel G. et al., "Spectrum and spectral density estimation by the Discrete Fourier transform (DFT), including a comprehensive list of window functions and some new flat-top windows", February 15, 2002 https://holometer.fnal.gov/GH_FFT.pdf
範例
>>> # Generates a symmetric Nutall window. >>> torch.signal.windows.general_hamming(5, sym=True) tensor([3.6280e-04, 2.2698e-01, 1.0000e+00, 2.2698e-01, 3.6280e-04]) >>> # Generates a periodic Nuttall window. >>> torch.signal.windows.general_hamming(5, sym=False) tensor([3.6280e-04, 1.1052e-01, 7.9826e-01, 7.9826e-01, 1.1052e-01])