Python提取频域特征知识点浅析

作者:laozhang 时间:2021-10-31 08:01:31 

在多数的现代语音识别系统中,人们都会用到频域特征。梅尔频率倒谱系数(MFCC),首先计算信号的功率谱,然后用滤波器和离散余弦变换的变换来提取特征。本文重点介绍如何提取MFCC特征。

首先创建有一个Python文件,并导入库文件:     from scipy.io import wavfile     from python_speech_features import mfcc, logfbank     import matplotlib.pylab as plt1、首先创建有一个Python文件,并导入库文件:     from scipy.io import wavfile     from python_speech_features import mfcc, logfbank     import matplotlib.pylab as plt

读取音频文件:

samplimg_freq, audio = wavfile.read("data/input_freq.wav")

Python提取频域特征知识点浅析

提取MFCC特征和过滤器特征:

     mfcc_features = mfcc(audio, samplimg_freq)

     filterbank_features = logfbank(audio, samplimg_freq)

Python提取频域特征知识点浅析

Python提取频域特征知识点浅析

打印参数,查看可生成多少个窗体:


  print('\nMFCC:\nNumber of windows =', mfcc_features.shape[0])

print('Length of each feature =', mfcc_features.shape[1])

print('\nFilter bank:\nNumber of windows=', filterbank_features.shape                                                         [0])

print('Length of each feature =', filterbank_features.shape[1])

Python提取频域特征知识点浅析

将MFCC特征可视化。转换矩阵,使得时域是水平的:


  mfcc_features = mfcc_features.T

plt.matshow(mfcc_features)

plt.title('MFCC')

Python提取频域特征知识点浅析

将滤波器组特征可视化。转化矩阵,使得时域是水平的:


  filterbank_features = filterbank_features.T

plt.matshow(filterbank_features)

plt.title('Filter bank')

plt.show()

Python提取频域特征知识点浅析

标签:Python,频域特征
0
投稿

猜你喜欢

  • python调用DLL与EXE文件截屏对比分析

    2022-06-01 08:19:15
  • 服务器端jupyter notebook映射到本地浏览器的操作

    2023-10-30 12:06:20
  • nodejs简单实现TCP服务器端和客户端的聊天功能示例

    2024-05-03 15:55:56
  • Python进程间通信Queue消息队列用法分析

    2021-11-28 03:04:18
  • 教你轻松了解MySQL数据库中的结果字符串

    2009-02-23 17:29:00
  • python中pip安装、升级以及升级固定的包

    2021-07-08 02:29:11
  • 轻松实现TensorFlow微信跳一跳的AI

    2021-11-24 10:35:40
  • javascript记住用户名和登录密码(两种方式)

    2024-05-02 16:16:44
  • MySQL中 LBCC 和 MVCC 的理解及常见问题示例

    2024-01-23 18:51:01
  • python Canny边缘检测算法的实现

    2023-04-23 20:41:55
  • 解决MySQL主从数据库没有同步的两种方法

    2024-01-15 03:34:44
  • Python的PIL库中getpixel方法的使用

    2022-01-06 09:08:51
  • OpenCV+Imutils实现图像的旋转操作

    2021-07-25 20:39:42
  • 利用python程序生成word和PDF文档的方法

    2023-08-26 13:31:44
  • asp如何创建一个PDF文件?

    2009-11-14 20:53:00
  • python pdb调试方法分享

    2022-02-15 22:39:22
  • 一些让Python代码简洁的实用技巧总结

    2022-02-06 11:03:25
  • Python 限制线程的最大数量的方法(Semaphore)

    2022-03-02 06:24:09
  • MySQL 自定义函数CREATE FUNCTION示例

    2024-01-26 00:48:07
  • 如何使用django的MTV开发模式返回一个网页

    2023-07-04 21:47:06
  • asp之家 网络编程 m.aspxhome.com