【问题标题】:How to preform the Matlab function "pspectrum" in Python (possibly with numpy)如何在 Python 中执行 Matlab 函数“pspectrum”(可能使用 numpy)
【发布时间】:2019-07-08 10:26:53
【问题描述】:

我想分析几秒钟的声音,并直观地查看整个声音中使用的每个频率的功率。在 matlab 中,我可以使用函数 pspectrum 并得到类似的东西

this

有没有办法在 python 中使用 numpy 或类似的库来做到这一点?

【问题讨论】:

  • 在 Matlab 中,我过去使用过spectrogrampspectrum 是一个非常新的函数)。所以 Python 的 scipy.signal.spectrogram 看起来很有希望

标签: python matlab numpy signal-processing


【解决方案1】:

有两种方法可以在 python 中执行频谱图。首先,使用 scipy 库,其次使用 matplotlib 库。 scipy 库是最常用的,因为整个 scipy 库都是用于信号处理的。此外,matplotlib 谱图函数比 scipy 具有更多的功能。

我会说使用 matpoltlib 函数,因为 matplotlib 库是专门用于可视化的。请找到这两个库文档的链接。

为频谱安装 python 库: 1.)scipy库= pip install scipy(文档-https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.spectrogram.html

2.) matplotlib 库 = pip install matplotlib (Documentation-https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.specgram.html#matplotlib.axes.Axes.specgram)

免费提出与此主题相关的更多问题。祝你好运!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-14
    • 1970-01-01
    • 2022-01-18
    • 2016-09-05
    相关资源
    最近更新 更多