numpy.kaiser

numpy.kaiser(M, beta)[源代码]

返回凯撒窗口。

凯撒窗是一种使用贝塞尔函数形成的锥度。

参数
M利息

输出窗口中的点数。如果小于或等于零,则返回空数组。

beta浮动

窗口的形状参数。

返回
out数组

最大值规范化为1的窗口(只有当样本数为奇数时,才会显示值1)。

笔记

凯撒窗口定义为

System Message: WARNING/2 (w(n)=I 0左(\beta\sqrt{1-\frac{4n^2}{(M-1)^2}})

latex exited with error [stdout] This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian) (preloaded format=latex) restricted \write18 enabled. entering extended mode (./math.tex LaTeX2e <2018-12-01> (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2018/09/03 v1.4i Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo)) (/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amscls/amsthm.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texlive/texmf-dist/tex/latex/anyfontsize/anyfontsize.sty) (/usr/share/texlive/texmf-dist/tex/latex/tools/bm.sty) (./math.aux) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) ! Package inputenc Error: Unicode character ( (U+FF08) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...qrt{1-\frac{4n^2}{(M-1)^2}}\end{split} ! Package inputenc Error: Unicode character ) (U+FF09) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...qrt{1-\frac{4n^2}{(M-1)^2}}\end{split} ! Package inputenc Error: Unicode character 左 (U+5DE6) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...qrt{1-\frac{4n^2}{(M-1)^2}}\end{split} ! Package inputenc Error: Unicode character ( (U+FF08) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...qrt{1-\frac{4n^2}{(M-1)^2}}\end{split} ! Package inputenc Error: Unicode character ( (U+FF08) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...qrt{1-\frac{4n^2}{(M-1)^2}}\end{split} ! Package inputenc Error: Unicode character ) (U+FF09) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...qrt{1-\frac{4n^2}{(M-1)^2}}\end{split} ! Package inputenc Error: Unicode character ( (U+FF08) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...qrt{1-\frac{4n^2}{(M-1)^2}}\end{split} ! Package inputenc Error: Unicode character ) (U+FF09) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...qrt{1-\frac{4n^2}{(M-1)^2}}\end{split} ! Package inputenc Error: Unicode character 左 (U+5DE6) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...qrt{1-\frac{4n^2}{(M-1)^2}}\end{split} ! Package inputenc Error: Unicode character ( (U+FF08) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...qrt{1-\frac{4n^2}{(M-1)^2}}\end{split} ! Package inputenc Error: Unicode character ( (U+FF08) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...qrt{1-\frac{4n^2}{(M-1)^2}}\end{split} ! Package inputenc Error: Unicode character ) (U+FF09) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...qrt{1-\frac{4n^2}{(M-1)^2}}\end{split} [1] (./math.aux) ) (see the transcript file for additional information) Output written on math.dvi (1 page, 544 bytes). Transcript written on math.log.

具有

System Message: WARNING/2 (\四元-\frac m-1 2 \leq n \leq \frac m-1 2,)

latex exited with error [stdout] This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian) (preloaded format=latex) restricted \write18 enabled. entering extended mode (./math.tex LaTeX2e <2018-12-01> (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2018/09/03 v1.4i Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo)) (/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amscls/amsthm.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texlive/texmf-dist/tex/latex/anyfontsize/anyfontsize.sty) (/usr/share/texlive/texmf-dist/tex/latex/tools/bm.sty) (./math.aux) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) ! Undefined control sequence. <argument> \split@tag \begin {split}\� ��元-\frac m-1 2 \leq n \leq \frac m-... l.14 ...-1 2 \leq n \leq \frac m-1 2,\end{split} ! Package inputenc Error: Invalid UTF-8 byte "9B. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...-1 2 \leq n \leq \frac m-1 2,\end{split} ! Package inputenc Error: Invalid UTF-8 byte "9B. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...-1 2 \leq n \leq \frac m-1 2,\end{split} ! Package inputenc Error: Unicode character 元 (U+5143) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...-1 2 \leq n \leq \frac m-1 2,\end{split} ! Package inputenc Error: Unicode character , (U+FF0C) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...-1 2 \leq n \leq \frac m-1 2,\end{split} ! Undefined control sequence. <argument> \split@tag \begin {split}\� ��元-\frac m-1 2 \leq n \leq \frac m-... l.14 ...-1 2 \leq n \leq \frac m-1 2,\end{split} ! Package inputenc Error: Invalid UTF-8 byte "9B. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...-1 2 \leq n \leq \frac m-1 2,\end{split} ! Package inputenc Error: Invalid UTF-8 byte "9B. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...-1 2 \leq n \leq \frac m-1 2,\end{split} ! Package inputenc Error: Unicode character 元 (U+5143) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...-1 2 \leq n \leq \frac m-1 2,\end{split} ! Package inputenc Error: Unicode character , (U+FF0C) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...-1 2 \leq n \leq \frac m-1 2,\end{split} [1] (./math.aux) ) (see the transcript file for additional information) Output written on math.dvi (1 page, 440 bytes). Transcript written on math.log.

在哪里? I_0 是修正的零阶贝塞尔函数。

凯撒是以吉姆·凯撒命名的,他发现了基于贝塞尔函数的DPSS窗口的简单近似。Kaiser窗是一个非常好的近似数字长圆形序列,或Sleepian窗,这是一个转换,最大化的能量在窗口主瓣相对于总能量。

皇帝可以通过改变beta参数来近似许多其他窗口。

贝塔

窗口形状

0

矩形

5

类似于吊床

6

类似于汉宁

8.6

类似于黑人

beta值为14可能是一个很好的起点。请注意,当beta变大时,窗口会缩小,因此样本的数量需要足够大,以对越来越窄的尖峰进行采样,否则nan会返回。

大多数对Kaiser窗口的引用来自信号处理文献,它被用作平滑值的许多窗口函数之一。它也被称为变迹(意思是“消除脚”,即在采样信号的开始和结束处平滑不连续)或渐缩函数。

工具书类

1

J.F.Kaiser,《数字滤波器》——第7章,载于《数字计算机系统分析》,编辑:F.F.Kuo和J.F.Kaiser,第218-285页。约翰威利父子,纽约,(1966)。

2

E.R.Kanasewich,“地球物理学中的时序分析”,阿尔伯塔大学出版社,1975年,第177-178页。

3

维基百科,“窗口函数”,https://en.wikipedia.org/wiki/window_function

实例

>>> import matplotlib.pyplot as plt
>>> np.kaiser(12, 14)
 array([7.72686684e-06, 3.46009194e-03, 4.65200189e-02, # may vary
        2.29737120e-01, 5.99885316e-01, 9.45674898e-01,
        9.45674898e-01, 5.99885316e-01, 2.29737120e-01,
        4.65200189e-02, 3.46009194e-03, 7.72686684e-06])

绘制窗口和频率响应:

>>> from numpy.fft import fft, fftshift
>>> window = np.kaiser(51, 14)
>>> plt.plot(window)
[<matplotlib.lines.Line2D object at 0x...>]
>>> plt.title("Kaiser window")
Text(0.5, 1.0, 'Kaiser window')
>>> plt.ylabel("Amplitude")
Text(0, 0.5, 'Amplitude')
>>> plt.xlabel("Sample")
Text(0.5, 0, 'Sample')
>>> plt.show()
../../_images/numpy-kaiser-1_00_00.png
>>> plt.figure()
<Figure size 640x480 with 0 Axes>
>>> A = fft(window, 2048) / 25.5
>>> mag = np.abs(fftshift(A))
>>> freq = np.linspace(-0.5, 0.5, len(A))
>>> response = 20 * np.log10(mag)
>>> response = np.clip(response, -100, 100)
>>> plt.plot(freq, response)
[<matplotlib.lines.Line2D object at 0x...>]
>>> plt.title("Frequency response of Kaiser window")
Text(0.5, 1.0, 'Frequency response of Kaiser window')
>>> plt.ylabel("Magnitude [dB]")
Text(0, 0.5, 'Magnitude [dB]')
>>> plt.xlabel("Normalized frequency [cycles per sample]")
Text(0.5, 0, 'Normalized frequency [cycles per sample]')
>>> plt.axis('tight')
(-0.5, 0.5, -100.0, ...) # may vary
>>> plt.show()
../../_images/numpy-kaiser-1_01_00.png