资源简介
使用matlab编写,提取音频特征值,如短时过零率,短时能量,频谱质心等,程序完事。
代码片段和文件信息
function FF = computeAllStatistics(fileName win step)
% This function computes the average and std values for the following audio
% features:
% - energy entropy
% - short time energy
% - spectral rolloff
% - spectral centroid
% - spectral flux
%
% ARGUMENTS:
% fileName: the name of the .wav file in which the signal is stored
% win: the processing window (in seconds)
% step: the processing step (in seconds)
%
% RETURN VALUE:
% F: a 12x1 array containing the 12 feature statistics
%
[x fs] = wavread(fileName);
EE = Energy_Entropy_Block(x win*fs step*fs 10);
E = ShortTimeEnergy(x win*fs step*fs);
Z = zcr(x win*fs step*fs fs);
R = SpectralRollOff(x win*fs step*fs 0.80 fs);
C = SpectralCentroid(x win*fs step*fs fs);
F = SpectralFlux(x win*fs step*fs fs);
FF(1) = statistic(EE 1 length(EE) ‘std‘);
FF(2) = statistic(Z 1 length(Z) ‘stdbymean‘);
FF(3) = statistic(R 1 length(R) ‘std‘);
FF(4) = statistic(C 1 length(C) ‘std‘);
FF(5) = statistic(F 1 length(F) ‘std‘);
FF(6) = statistic(E 1 length(E) ‘stdbymean‘);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 7072 2008-03-17 03:22 Documentation.html
文件 584 2006-03-07 16:39 Energy_Entropy_Block.m
文件 672 2006-02-16 13:01 ShortTimeEnergy.m
文件 620 2006-02-23 15:32 SpectralCentroid.m
文件 665 2006-01-30 20:38 SpectralEntropy.m
文件 599 2008-02-05 04:08 SpectralFlux.m
文件 659 2006-09-12 18:20 SpectralRollOff.m
文件 1093 2008-02-05 20:39 computeAllStatistics.m
文件 2830 2008-03-17 03:24 computeFeaturesDirectory.m
文件 563 2008-02-05 19:49 computeHistError.m
文件 96676 2008-03-17 02:34 example.jpg
文件 1345 2009-05-19 17:09 license.txt
文件 860 2008-02-11 20:07 myHist.m
文件 1895 2007-01-22 04:43 statistic.m
文件 497 2006-01-30 20:38 zcr.m
- 上一篇:数据预处理 剔除奇异点 matlab程序
- 下一篇:回馈整流MATLAB仿真
评论
共有 条评论