【问题标题】:Attribute Error (Python PNCC using Spafe) module 'scipy' has no attribute 'fftpack'属性错误(使用 Spafe 的 Python PNCC)模块“scipy”没有属性“fftpack”
【发布时间】:2021-05-01 16:21:28
【问题描述】:

我正在尝试使用此处提供的 Spafe 项目提取语音特征

https://github.com/SuperKogito/spafe/blob/master/examples/features_pncc_example.ipynb.

我使用了 spafe 项目中提供的 PNCC 特征提取程序。

我收到以下错误。请帮忙。

pnccs = scipy.fftpack.dct(V)[:, :num_ceps] AttributeError:模块“scipy”没有属性“fftpack”

代码如下。

import scipy
from spafe.utils import vis
from spafe.features.pncc import pncc
import scipy.io.wavfile as wav

# init input vars
num_ceps = 13
low_freq = 0
high_freq = 2000
nfilts = 24
nfft = 512
dct_type = 2,
use_energy = False,
lifter = 5
normalize = True

# read wav
(fs, sig) = wav.read("sample.wav")

# compute features
pnccs = pncc(sig=sig,
             fs=fs,
             num_ceps=num_ceps,
             nfilts=nfilts,
             nfft=nfft,
             low_freq=low_freq,
             high_freq=high_freq,
             dct_type=dct_type,
             use_energy=use_energy,
             lifter=lifter,
             normalize=normalize)

# visualize spectogram
vis.spectogram(sig, fs)
# visualize features
vis.visualize_features(pnccs, 'PNCC Index', 'Frame Index')

【问题讨论】:

    标签: python-3.x error-handling attributes extract speech


    【解决方案1】:

    我认为你应该避免scipy.fftpack

    传统离散傅里叶变换 (scipy.fftpack)

    警告:这个子模块现在被认为是旧的,新代码应该使用 scipy.fft。

    https://docs.scipy.org/doc/scipy/reference/fftpack.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-26
      • 1970-01-01
      • 2022-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-29
      • 2014-07-23
      相关资源
      最近更新 更多