我是 DSP 的新手,试图为f(0)
音频文件的每个分段帧计算基频( )。F0估计的方法可以分为三类:
基于信号时域的时间动态;
基于频率结构频域,以及
混合方法。
大多数示例都是基于频率结构频域估计基频,我正在寻找基于信号时域的时间动态。
本文提供了一些信息,但我仍然不清楚如何在时域中计算它?
https://gist.github.com/endolith/255291
这是我发现的到目前为止使用的代码:
def freq_from_autocorr(sig, fs):
"""
Estimate frequency using autocorrelation
"""
# Calculate autocorrelation and throw away the negative lags
corr = correlate(sig, sig, mode='full')
corr = corr[len(corr)//2:]
# Find the first low point
d = diff(corr)
start = nonzero(d > 0)[0][0]
# Find the next peak after the low point (other than 0 lag). This bit is
# not reliable for long signals, due to the desired peak occurring between
# samples, and other peaks appearing higher.
# Should use a weighting function to de-emphasize the peaks at longer lags.
peak = argmax(corr[start:]) + start
px, py = parabolic(corr, peak)
return fs / px
如何在时域进行估计?
提前致谢!
慕容3067478
相关分类