function [x,mc,mn,mx]=melbankm(p,n,fs,fl,fh,w)
%MELBANKM determine matrix for a mel/erb/bark-spaced filterbank [X,MN,MX]=(P,N,FS,FL,FH,W)
%
% Inputs:
% p number of filters in filterbank or the filter spacing in k-mel/bark/erb [ceil(4.6*log10(fs))]
% n length of fft
% fs sample rate in Hz
% fl low end of the lowest filter as a fraction of fs [default = 0]
% fh high end of highest filter as a fraction of fs [default = 0.5]
% w any sensible combination of the following:
% 'b' = bark scale instead of mel
% 'e' = erb-rate scale
% 'l' = log10 Hz frequency scale
% 'f' = linear frequency scale
%
% 'c' = fl/fh specify centre of low and high filters
% 'h' = fl/fh are in Hz instead of fractions of fs
% 'H' = fl/fh are in mel/erb/bark/log10
%
% 't' = triangular shaped filters in mel/erb/bark domain (default)
% 'n' = hanning shaped filters in mel/erb/bark domain
% 'm' = hamming shaped filters in mel/erb/bark domain
%
% 'z' = highest and lowest filters taper down to zero [default]
% 'y' = lowest filter remains at 1 down to 0 frequency and
% highest filter remains at 1 up to nyquist freqency
%
% 'u' = scale filters to sum to unity
%
% 's' = single-sided: do not double filters to account for negative frequencies
%
% 'g' = plot idealized filters [default if no output arguments present]
%
% Note that the filter shape (triangular, hamming etc) is defined in the mel (or erb etc) domain.
% Some people instead define an asymmetric triangular filter in the frequency domain.
%
% If 'ty' or 'ny' is specified, the total power in the fft is preserved.
%
% Outputs: x a sparse matrix containing the filterbank amplitudes
% If the mn and mx outputs are given then size(x)=[p,mx-mn+1]
% otherwise size(x)=[p,1+floor(n/2)]
% Note that the peak filter values equal 2 to account for the power
% in the negative FFT frequencies.
% mc the filterbank centre frequencies in mel/erb/bark
% mn the lowest fft bin with a non-zero coefficient
% mx the highest fft bin with a non-zero coefficient
% Note: you must specify both or neither of mn and mx.
%
% Examples of use:
%
% (a) Calcuate the Mel-frequency Cepstral Coefficients
%
% f=rfft(s); % rfft() returns only 1+floor(n/2) coefficients
% x=melbankm(p,n,fs); % n is the fft length, p is the number of filters wanted
% z=log(x*abs(f).^2); % multiply x by the power spectrum
% c=dct(z); % take the DCT
%
% (b) Calcuate the Mel-frequency Cepstral Coefficients efficiently
%
% f=fft(s); % n is the fft length, p is the number of filters wanted
% [x,mc,na,nb]=melbankm(p,n,fs); % na:nb gives the fft bins that are needed
% z=log(x*(f(na:nb)).*conj(f(na:nb)));
%
% (c) Plot the calculated filterbanks
%
% plot((0:floor(n/2))*fs/n,melbankm(p,n,fs)') % fs=sample frequency
%
% (d) Plot the idealized filterbanks (without output sampling)
%
% melbankm(p,n,fs);
%
% References:
%
% [1] S. S. Stevens, J. Volkman, and E. B. Newman. A scale for the measurement
% of the psychological magnitude of pitch. J. Acoust Soc Amer, 8: 185�19, 1937.
% [2] S. Davis and P. Mermelstein. Comparison of parametric representations for
% monosyllabic word recognition in continuously spoken sentences.
% IEEE Trans Acoustics Speech and Signal Processing, 28 (4): 357�366, Aug. 1980.
% Copyright (C) Mike Brookes 1997-2009
% Version: $Id: melbankm.m,v 1.11 2010/01/02 20:02:22 dmb Exp $
%
% VOICEBOX is a MATLAB toolbox for speech processing.
% Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You can obtain a copy of the GNU General Public License from
% http://www.gnu.org/copyleft/gpl.html or by writing to
% Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Note "FFT bin_0" assumes DC = bin 0 whereas "FFT bin_1" means DC = bin 1
if nargin < 6
w='tz'; % default options
if nargin < 5
fh=0.5; % max freq is the nyquist
if nargin < 4
fl=0; % min freq is DC
end
end
end
sfact=2-any(w=='s'); % 1 if single sided else 2
wr=' '; % default warping is mel
for i=1:length(w)
if any(w(i)=='lebf');
wr=w(i);
end
end
if any(w=='h') || any(w=='H')
mflh=[fl fh];
else
mflh=[fl fh]*fs;
end
if ~any(w=='H')
switch wr
case 'f' % no transformation
case 'l'
if fl<=0
error('Low frequency limit must be >0 for l option');
end
mflh=log10(mflh); % convert frequency limits into log10 Hz
case 'e'
mflh=frq2erb(mflh); % convert frequency limits into erb-rate
case 'b'
mflh=frq2bark(mflh); % convert frequency limits into bark
otherwise
mflh=frq2mel(mflh); % convert frequency limits into mel
end
end
melrng=mflh*(-1:2:1)'; % mel range
fn2=floor(n/2); % bin index of highest positive frequency (Nyquist if n is even)
if isempty(p)
p=ceil(4.6*log10(fs)); % default number of filters
end
if any(w=='c') % c option: specify fiter centres not edges
if p<1
p=round(melrng/(p*1000))+1;
end
melinc=melrng/(p-1);
mflh=mflh+(-1:2:1)*melinc;
else
if p<1
p=round(melrng/(p*1000))-1;
end
melinc=melrng/(p+1);
end
%
% Calculate the FFT bins corresponding to [filter#1-low filter#1-mid filter#p-mid filter#p-high]
%
switch wr
case 'f'
blim=(mflh(1)+[0 1 p p+1]*melinc)*n/fs;
case 'l'
blim=10.^(mflh(1)+[0 1 p p+1]*melinc)*n/fs;
case 'e'
blim=erb2frq(mflh(1)+[0 1 p p+1]*melinc)*n/fs;
case 'b'
blim=bark2frq(mflh(1)+[0 1 p p+1]*melinc)*n/fs;
otherwise
blim=mel2frq(mflh(1)+[0 1 p p+1]*melinc)*n/fs;
end
mc=mflh(1)+(1:p)*melinc; % mel centre frequencies
b1=floor(blim(1))+1; % lowest FFT bin_0 required might be negative)
b4=min(fn2,ceil(blim(4))-1); % highest FFT bin_0 required
%
% now map all the useful FFT bins_0 to filter1 centres
%
switch wr
case 'f'
pf=((b1:b4)*fs/n-mflh(1))/melinc;
case 'l'
pf=(log10((b1:b4)*fs/n)-mflh(1))/melinc;
case 'e'
pf=(frq2erb((b1:b4)*fs/n)-mflh(1))/melinc;
case 'b'
pf=(frq2bark((b1:b4)*fs/n)-mflh(1))/melinc;
otherwise
pf=(frq2mel((b1:b4)*fs/n)-mflh(1))/melinc;
end
%
% remove any incorrect entries in pf due to rounding errors
%
if pf(1)<0
pf(1)=[];
b1=b1+1;
end
if pf(end)>=p+1
pf(end)=[];
b4=b4-1;
end
fp=floor(pf); % FFT bin_0 i contributes to filters_1 fp(1+i-b1)+[0 1]
pm=pf-fp; % multiplier for upper filter
k2=find(fp>0,1); % FFT bin_1 k2+b1 is the first to contribute to both upper and lower filters
k3=find(fp<p,1,'last'); % FFT bin_1 k3+b1 is the last to contribute to both upper and lower fil
没有合适的资源?快使用搜索试试~ 我知道了~
MATLAB实现基于K近邻分类算法的语音情感识别实验【语音信号处理实战】.zip
共285个文件
wav:250个
m:25个
mat:10个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 147 浏览量
2023-04-14
13:13:23
上传
评论
收藏 17.5MB ZIP 举报
温馨提示
MATLAB实现语音信号处理实战。 项目代码可直接编译运行~
资源推荐
资源详情
资源评论
收起资源包目录
MATLAB实现基于K近邻分类算法的语音情感识别实验【语音信号处理实战】.zip (285个子文件)
melbankm.m 11KB
melcepst.m 4KB
lpcauto.m 4KB
featvector.m 4KB
pick_peak.m 4KB
featvector.m 3KB
KnnRecognition.m 3KB
smoothing.m 3KB
lpcar2fm.m 3KB
frq2mel.m 2KB
mel2frq.m 2KB
rdct.m 2KB
enframe.m 2KB
rfft.m 2KB
lpcar2zz.m 1KB
pre.m 1KB
formant_get.m 1KB
find_peak.m 1KB
voicemark.m 878B
N_neutral.m 424B
T_sadness.m 424B
F_hapiness.m 415B
W_anger.m 410B
A_fear.m 403B
mapzo.m 104B
N_neutral.mat 50KB
N_neutral.mat 50KB
T_sadness.mat 50KB
T_sadness.mat 50KB
F_happiness.mat 50KB
F_happiness.mat 50KB
A_fear.mat 50KB
A_fear.mat 50KB
W_anger.mat 50KB
W_anger.mat 50KB
08b03Tc.wav 281KB
08b02Tc.wav 240KB
08b09Tb.wav 211KB
14b02Tc.wav 194KB
12b03Ta.wav 187KB
11b03Td.wav 185KB
11a05Td.wav 177KB
08a05Ta.wav 176KB
14b03Ta.wav 172KB
12b09Td.wav 169KB
12a05Ta.wav 168KB
03b03Tc.wav 166KB
03b02Tb.wav 160KB
14a05Tc.wav 157KB
13b03Td.wav 156KB
11b09Td.wav 153KB
08b10Tc.wav 146KB
10b03Wb.wav 140KB
13a05Tc.wav 139KB
09b03Ta.wav 128KB
08b03Wd.wav 128KB
08a07Tb.wav 126KB
12b01Ta.wav 125KB
03b09Tc.wav 123KB
13b03Fd.wav 123KB
11a05Fc.wav 123KB
09a05Tb.wav 122KB
11b10Td.wav 122KB
03b03Wc.wav 120KB
08a04Tb.wav 120KB
11b03Fc.wav 120KB
09b03Nb.wav 119KB
14b09Td.wav 118KB
10b03Tb.wav 117KB
10a05Wb.wav 117KB
14a05Ta.wav 117KB
08b03Nb.wav 116KB
09b03Wb.wav 116KB
09b02Tb.wav 114KB
03b03Nb.wav 114KB
11b03Nb.wav 113KB
08b03Fe.wav 113KB
11b02Td.wav 113KB
08b02Wd.wav 112KB
11a05Fb.wav 111KB
16b09Fb.wav 109KB
03a05Tc.wav 109KB
08a07Ta.wav 108KB
13b02Fb.wav 108KB
03a05Wa.wav 108KB
14b10Tc.wav 107KB
09a05Wb.wav 106KB
03b01Td.wav 106KB
10a05Tb.wav 104KB
11a05Na.wav 104KB
09b03Fd.wav 104KB
08b09Wc.wav 104KB
13b03Ac.wav 103KB
14a07Tc.wav 102KB
08a05Nb.wav 102KB
14a05Fa.wav 101KB
12a05Ab.wav 101KB
16b03Ad.wav 101KB
10b09Wb.wav 100KB
03a05Fc.wav 100KB
共 285 条
- 1
- 2
- 3
资源评论
- m0_378268702024-03-19资源很受用,资源主总结的很全面,内容与描述一致,解决了我当下的问题。
不脱发的程序猿
- 粉丝: 24w+
- 资源: 5761
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- RB3605A-DFN1X1-4L封装 单节锂电池保护IC 可芯电子有限公司.pdf
- 使用Java语言实现【模拟退火算法】的编程+编程知识+开发技术
- RB3701AD-DFN1X1-4L封装 单节锂电池保护IC 深圳市可芯电子有限公司.pdf
- 后端开发框架:教程&案例&相关项目.md
- C++大型流媒体项目-从底层到应用层千万级直播系统实战
- C语言AVL树的创建,功能函数具有,左旋右旋,前序遍历,插入数据等等
- springboot网页时装购物系统
- RB3701A-DFN1X1-4L封装单节锂电池保护IC 深圳市可芯电子有限公司.pdf
- PotPlayer.rar
- springboot003图书个性化推荐系统的设计与实现
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功