【问题标题】:MFCC Sampling frequencyMFCC 采样频率
【发布时间】:2017-02-28 22:44:03
【问题描述】:

我想获取我的 wav 文件的 MFCC 值。这是我的代码:

> import numpy as np 
> import scipy.io.wavfile 
> from scikits.talkbox.features import mfcc
> sr1,x1=scipy.io.wavfile.read("filename.wav")
> ceps1,mspec1,spec1=mfcc(x1)

sr1=22050 的值。但在 scikit.talkbox 库中, mfcc() 使用 fs=16000 作为默认值。我该如何解决?或者它会给我带来什么问题吗?

【问题讨论】:

    标签: python numpy audio scipy scikit-learn


    【解决方案1】:

    看看the docstring for mfcc。函数的签名是

    def mfcc(input, nwin=256, nfft=512, fs=16000, nceps=13):
    

    正如您在问题中所述,fs 的默认值为 16000。您可以在代码中使用 fs=sr1 覆盖它:

    ceps1, mspec1, spec1 = mfcc(x1, fs=sr1)
    

    (有关 python 函数的关键字参数的更多信息,请参阅,例如,4.7.2. Keyword Arguments in the python tutorial。)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-04
      • 2017-03-04
      • 2015-12-16
      • 2011-01-06
      • 2019-02-06
      • 1970-01-01
      • 2018-06-08
      相关资源
      最近更新 更多