主要内容

blackmanharris

最小四项布莱克曼-哈里斯窗

说明

w = blackmanharris(L) 返回一个长度为 L 个点的对称四项布莱克曼-哈里斯窗。

示例

w = blackmanharris(L,sflag) 使用由 sflag 指定的窗采样方法返回一个布莱克曼-哈里斯窗。

w = blackmanharris(___,typeName) 指定以单精度或双精度返回窗 w 的选项。

示例

全部折叠

创建一个长度为 32 个点的对称布莱克曼-哈里斯窗。使用 wvtool 显示结果。

L = 32;
wvtool(blackmanharris(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.

输入参数

全部折叠

窗长度,指定为正整数。

注意

如果将 L 指定为非整数,该函数会将其舍入为最接近的整数值。

数据类型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

窗采样方法,指定为:

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

  • "periodic" - 在使用窗进行频谱分析时使用此选项。指定 "periodic" 时,blackmanharris 计算长度为 L +1 的窗,并返回前 L 个点。缺失端点是序列的周期性扩展的下一个周期的起点。因此,序列满足离散傅里叶变换的周期性假设。

数据类型: char | string

自 R2024b 起

输出数据类型(类),指定为以下类型之一:

  • "double" - 使用此选项返回双精度输出 w

  • "single" - 使用此选项返回单精度输出 w

数据类型: char | string

输出参量

全部折叠

布莱克曼-哈里斯窗,以列向量形式返回。

算法

长度为 N 的对称四项布莱克曼-哈里斯窗的方程为

w(n)=a0a1cos(2πnN1)+a2cos(4πnN1)a3cos(6πnN1),0nN1

长度为 N 的周期性四项布莱克曼-哈里斯窗的方程为:

w(n)=a0a1cos2πnN+a2cos4πnNa3cos6πnN,0nN1

周期性窗以长度 N 为周期。

系数
a00.35875
a10.48829
a20.14128
a30.01168

参考

[1] harris, fredric j. “On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform.” Proceedings of the IEEE®. Vol. 66, January 1978, pp. 51–83.

扩展功能

全部展开

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

版本历史记录

在 R2006a 之前推出

全部展开