汉明窗有什么用? [英] What is the Hamming window for?

查看:82
本文介绍了汉明窗有什么用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一些执行傅立叶变换的代码(以计算音频样本的倒谱).在计算傅立叶变换之前,它对样本应用汉明窗:

I'm working with some code that does a Fourier transform (to calculate the cepstrum of an audio sample). Before it computes the Fourier transform, it applies a Hamming window to the sample:

for(int i = 0; i < SEGMENTATION_LENGTH;i++){
    timeDomain[i] = (float) (( 0.53836 - ( 0.46164 * Math.cos( TWOPI * (double)i  / (double)( SEGMENTATION_LENGTH - 1 ) ) ) ) * frameBuffer[i]);
}

为什么要这样做?我在代码中或在线找不到任何理由来执行此操作.

Why is it doing this? I can't find any reason for it to do this in the code, or online.

推荐答案

无论何时进行有限傅立叶变换,您都是在隐式地将其应用于无限重复的信号.因此,例如,如果您的有限样本的开始和结束不匹配,那么这看起来就像信号中的不连续性,并在傅立叶变换中显示为大量高频废话,而您没有真的很想要如果您的样本恰好是一个漂亮的正弦曲线,但整数个周期恰好不适合有限样本,那么您的 FT 将在远​​离实际频率的各种地方显示可观的能量.你不想要任何这些.

Whenever you do a finite Fourier transform, you're implicitly applying it to an infinitely repeating signal. So, for instance, if the start and end of your finite sample don't match then that will look just like a discontinuity in the signal, and show up as lots of high-frequency nonsense in the Fourier transform, which you don't really want. And if your sample happens to be a beautiful sinusoid but an integer number of periods don't happen to fit exactly into the finite sample, your FT will show appreciable energy in all sorts of places nowhere near the real frequency. You don't want any of that.

窗口化数据可确保两端匹配,同时保持一切合理平滑;这大大减少了上一段中描述的那种光谱泄漏".

Windowing the data makes sure that the ends match up while keeping everything reasonably smooth; this greatly reduces the sort of "spectral leakage" described in the previous paragraph.

这篇关于汉明窗有什么用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆