为什么我需要到窗口函数应用于样本建立的音频信号的功率谱是什么时候? [英] Why do I need to apply a window function to samples when building a power spectrum of an audio signal?

查看:257
本文介绍了为什么我需要到窗口函数应用于样本建立的音频信号的功率谱是什么时候?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经找到了好几次<一个href=\"http://stackoverflow.com/questions/2881583/how-to-extract-semi-$p$pcise-frequencies-from-a-wav-file-using-fourier-transforms/2885833#2885833\">following指南获得音频信号的功率谱:

I have found for several times the following guidelines for getting the power spectrum of an audio signal:


  • 收集N个样本,其中N是2
  • 的功率
  • 申请一个合适的窗函数的样本,如寒凝

  • 传递窗采样到FFT例行 - 最好你想要一个真正的到复杂FFT,但如果你有一个复杂到复杂FFT那么对于所有的虚拟输入部分传递0

  • 计算你的FFT输出箱(重*重+ IM * IM)
  • 的平方幅度
  • (可选)计算出每个幅度平方输出纸盒10 * log10的获得在dB的幅度值

  • 现在,你有你的功率谱,你只需要确定峰(S),这应该是pretty简单,如果你有一个合理的S / N比率。注意,频率分辨率与较大N.改善有关的44.1千赫采样率上面的例子和N = 32768每个仓的频率分辨率为44100/32768 = 1.35赫兹。

  • collect N samples, where N is a power of 2
  • apply a suitable window function to the samples, e.g. Hanning
  • pass the windowed samples to an FFT routine - ideally you want a real-to-complex FFT but if all you have a is complex-to-complex FFT then pass 0 for all the imaginary input parts
  • calculate the squared magnitude of your FFT output bins (re * re + im * im)
  • (optional) calculate 10 * log10 of each magnitude squared output bin to get a magnitude value in dB
  • Now that you have your power spectrum you just need to identify the peak(s), which should be pretty straightforward if you have a reasonable S/N ratio. Note that frequency resolution improves with larger N. For the above example of 44.1 kHz sample rate and N = 32768 the frequency resolution of each bin is 44100 / 32768 = 1.35 Hz.

可是......为什么我需要到窗口函数应用于样本?那么这到底意味着什么?

But... why do I need to apply a window function to the samples? What does that really means?

有关的功率谱是什么,它​​是在采样率范围内每个频率的威力? (例如:Windows声音的媒体播放器的可视化工具)

What about the power spectrum, is it the power of each frequency in the range of sample rate? (example: windows media player visualizer of sound?)

推荐答案

作为@ cyco130说,你的样品是由一个长方形的功能已经窗。由于傅立叶变换假设周期性,在最后一个采样和重复第一样品之间的任何不连续性将导致伪像的光谱(例如,峰的拖尾)。这被称为频谱泄漏。为了减少这一点,我们采用锥形窗口功能的影响,如它可平顺任何这样的不连续性,从而降低了 Hann窗文物在频谱。

As @cyco130 says, your samples are already windowed by a rectangular function. Since a Fourier Transform assumes periodicity, any discontinuity between the last sample and the repeated first sample will cause artefacts in the spectrum (e.g. "smearing" of the peaks). This is known as spectral leakage. To reduce the effect of this we apply a tapered window function such as a Hann window which smooths out any such discontinuity and thereby reduces artefacts in the spectrum.

这篇关于为什么我需要到窗口函数应用于样本建立的音频信号的功率谱是什么时候?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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