4

汉宁窗和汉明窗

 3 years ago
source link: https://xujinzh.github.io/2022/04/10/ot-hann-hamming-window/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

窗函数在信号处理中是指一种除在给定区间之外取值均为 0 的实函数。任何函数与窗函数之积仍为窗函数,相乘的结果就像透过窗口”看“其他函数一样。常见的窗函数有矩形窗、汉宁窗(Hann window)和汉明窗(Hamming window),这在目标跟踪中也有相应的应用,如在孪生网络相应图中约束目标出现的位置。

Hann 窗和 Hamming 窗可以用如下的公式统一表示:
(1)w(n)=a0−(1−a0)⋅cos⁡(2πnN−1),0≤n≤N−1
当 a0=0.5 时,叫作 Hann 窗;当 a0=0.53836 (更精确来说是 25/46)时,称作 Hamming 窗。

Hann 窗

汉宁窗公式如下:
(2)w(n)=0.5(1−cos⁡(2πnN−1))
汉宁窗(Julius von Hann)有时也称为”Hanning“窗、余弦窗。从减小泄漏观点出发,汉宁窗优于矩形窗。但汉宁窗主瓣加宽,相当于分析带宽加宽,频率分辨力下降。

用 python 代码计算

import numpy as np

np.hanning(10)
array([0.        , 0.11697778, 0.41317591, 0.75      , 0.96984631,
0.96984631, 0.75 , 0.41317591, 0.11697778, 0. ])

Hamming 窗

汉明窗公式如下:
(3)w(n)=0.53836−0.46164cos⁡(2πnN−1)
参数 a0=0.53836 的设定是有用意的,在频率为 5π/(N−1) 处产生零交会处(zero-crossing),使原先 Hann 窗的第一个旁瓣(sidelobe)可以被大幅消除,产生只有 Hann 窗 1/5 高度的旁瓣。

用 python 代码计算

import numpy as np

np.hamming(10)
array([0.08      , 0.18761956, 0.46012184, 0.77      , 0.97225861,
0.97225861, 0.77 , 0.46012184, 0.18761956, 0.08 ])

</div


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK