主要内容

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

flattopwin

平顶加权窗

说明

w = flattopwin(L) 返回一个长度为 L 个点的对称平顶窗

示例

w = flattopwin(L,sflag) 使用 sflag 指定的窗采样方法返回一个长度为 L 个点的对称平顶窗。

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

示例

全部折叠

创建一个长度为 64 个点的对称平顶窗。使用 wvtool 查看结果。

N = 64;
w = flattopwin(N);
wvtool(w)

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" 时,flattopwin 计算长度为 L +1 的窗,并返回前 L 个点。缺失端点是序列的周期性扩展的下一个周期的起点。因此,序列满足离散傅里叶变换的周期性假设。

数据类型: char | string

自 R2024b 起

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

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

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

数据类型: char | string

输出参量

全部折叠

平顶窗,以列向量形式返回。

算法

平顶窗是对余弦的求和。平顶窗的系数通过以下方程计算:

w(n)=a0a1cos(2πnL1)+a2cos(4πnL1)a3cos(6πnL1)+a4cos(8πnL1),

其中 0nL1。系数值为:

系数
a00.21557895
a10.41663158
a20.277263158
a30.083578947
a40.006947368

平顶窗具有极低的通带波纹 (< 0.01 dB),主要用于标定目的。其带宽大约是汉宁窗的 2.5 倍。

参考

[1] D’Antona, Gabriele, and A. Ferrero. Digital Signal Processing for Measurement Systems. New York: Springer Media, 2006, pp. 70–72.

[2] Gade, Svend, and Henrik Herlufsen. “Use of Weighting Functions in DFT/FFT Analysis (Part I).” Windows to FFT Analysis (Part I): Brüel & Kjær Technical Review. Vol. x, Number 3, 1987, pp. 1–28.

扩展功能

全部展开

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

GPU 代码生成
使用 GPU Coder™ 为 NVIDIA® GPU 生成 CUDA® 代码。

版本历史记录

在 R2006a 之前推出

全部展开

另请参阅

App

函数