• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

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

python 搞代码 4年前 (2022-01-07) 18次浏览 已收录 0个评论

在本文里我们给大家分享了关于Python提取频域特征的相关知识点以及基础内容,需要的朋友们跟着学习下。

在多数的现代语音识别系统中,人们都会用到频域特征。梅尔频率倒谱系数(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 imp来源gaodaimacom搞#^代%!码&网ort mfcc, logfbank     import matplotlib.pylab as plt

读取音频文件:

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

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

     mfcc_features = mfcc(audio, samplimg_freq)

     filterbank_features = logfbank(audio, samplimg_freq)

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

 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]) 

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

 mfcc_features = mfcc_features.T plt.matshow(mfcc_features) plt.title('MFCC') 

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

 filterbank_features = filterbank_features.T plt.matshow(filterbank_features) plt.title('Filter bank') plt.show() 

以上就是Python提取频域特征知识点浅析的详细内容,更多请关注gaodaima搞代码网其它相关文章!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Python提取频域特征知识点浅析

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址