Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

hann

汉宁窗

说明

示例

w = hann(L) 返回一个长度为 L 个点的对称汉宁窗。

w = hann(L,sflag) 使用 sflag 所指定的窗采样返回汉宁窗。

示例

全部折叠

创建一个长度为 64 个点的汉宁窗。使用 wvtool 显示结果。

L = 64;
wvtool(hann(L))

Figure Window Visualization Tool contains 2 axes objects and other objects of type uimenu, uitoolbar, uipanel. Axes object 1 with title Time domain, xlabel Samples, ylabel Amplitude contains an object of type line. Axes object 2 with title Frequency domain, xlabel Normalized Frequency (\times\pi rad/sample), ylabel Magnitude (dB) contains an object of type line.

输入参数

全部折叠

窗长度,指定为正整数。

数据类型: single | double

窗采样,指定为以下项之一:

  • 'symmetric' - 在使用窗进行滤波器设计时使用此选项。

  • 'periodic' - 此选项对于频谱分析很有用,因为它使加窗信号可具有离散傅里叶变换中固有的完美周期延拓。当指定 'periodic' 时,hann 计算长度为 L + 1 的窗,并返回前 L 个点。

输出参数

全部折叠

汉宁窗,以列向量形式返回。

算法

以下方程可生成汉宁窗的系数:

w(n)=0.5(1cos(2πnN)),0nN.

窗长度 L = N + 1。

参考

[1] Oppenheim, Alan V., Ronald W. Schafer, and John R. Buck. Discrete-Time Signal Processing. Upper Saddle River, NJ: Prentice Hall, 1999.

扩展功能

C/C++ 代码生成
使用 MATLAB® Coder™ 生成 C 代码和 C++ 代码。

版本历史记录

在 R2006a 之前推出

另请参阅

App

函数