function [enhanced_speech] = spendred(input_speech,fs,algo_params)
% SPENDRED Speech Enhancement and Dereverberation by Doire
%
% Usage : (1) [enhanced_speech] = spendred(corrupted_speech,fs) % performs enhancement in order to denoise and dereverberate the input speech file
% (2) [enhanced_speech] = spendred(corrupted_speech,fs,algo_params) % performs enhancement using the custom parameters specified in 'algo_params'
%
%
% Inputs:
% input_speech Noisy and reverberant input speech signal (single-channel)
% fs Sample frequency in Hz
% algo_params algorithm parameters [optional]
%
%
% Outputs:
% enhanced_speech Enhanced output speech file
%
% Algorithm Parameters:
% The following parameters are defined in 'algo_params'. Default values are shown below.
%
% algo_params.of=6 % Overlap factor [6]
% algo_params.ti=0.005 % Desired frame increment in seconds [0.005]
% algo_params.ri=1 % Set to 1 to round ti to the nearest power of 2 samples [1]
% algo_params.sg=1 % Type of spectral subtraction gain to apply : 1=Wiener Gain, 2=Power Spectral Subtraction, 3=MMSE speech estimate [1]
% algo_params.sc=0.95 % Smoothing constant for computation of the spectral gain [0.95]
% algo_params.sf=1e-5; % Floor for the spectral gain [1e-5]
% algo_params.os=2; % Interference Over-subtraction factor [2]
% algo_params.cl=6; % Number of HMM states to use (minimum is 2 - maximum is 6) [6]
% algo_params.ds=1; % Way of computing posterior distributions : 1 = max track , 2 = weighted sum of tracks
% algo_params.mo=1; % Mode : 'fast' = 1 or 'slow' = 0 [1]
%
%
% References:
%
% [1] C.S.J. Doire, M. Brookes, P.A. Naylor, C.M. Hicks, D. Betts,
% M.A. Dmour, S.H. Jensen, "SINGLE-CHANNEL ONLINE ENHANCEMENT OF SPEECH
% CORRUPTED BY REVERBERATION AND NOISE", IEEE Trans. Audio, Speech,
% Language Processing, accepted for publication: 1�16, 2017.
%
% Author : Clement Doire
% clement.doire11@imperial.ac.uk
%
%
% Revision History:
%
% 0.5 - 16 Feb 2016 - First version, based on my PhD thesis and first draft of [1]
% 0.9 - 13 Mar 2016 - Several tweaks + improved overall performance
% 1.0 - 01 Jul 2016 - Base version used to generate results in the paper
%
% Comments:
% - By default the algorithm is in 'fast' mode, which fails in rare
% cases due to numerical errors. This can be overcome by using a Square Root implementation,
% which is done via the 'slow' mode option algo_params.mo=0.
%
% Copyright (C) Clement Doire 2016
% Version: $Id: spendred.m 9214 2016-12-17 17:13:24Z dmb $
%
% 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.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% TO DO : Deal with other sampling freqs more gracefully %%%%
if (fs ~= 16000)
input_speech = resample(mean(input_speech,2),16000,fs);
fs_ori = fs;
fs = 16000;
end
%%%% %%%%
if numel(input_speech)>length(input_speech)
error('Input speech signal must be a vector, not a matrix !');
end
%Default algorithm constants
Csts.of=6; % Overlap factor = (fft length)/(frame increment) [6]
Csts.ti=5e-3; % Desired frame increment [0.005]
Csts.ri=1; % Round ni to the nearest power of 2 [1]
Csts.sg=1; % Type of spectral subtraction gain to apply : 1=Wiener Gain, 2=Power Spectral Subtraction, 3=MMSE speech estimate [1]
Csts.sc=0.95; % Smoothing constant for computation of the spectral gain [0.95]
Csts.sf=1e-5; % Floor for the spectral gain [1e-5]
Csts.os=2; % Interference Over-subtraction factor [2]
Csts.cl=6; % Number of HMM states to use (minimum is 2 - maximum is 6) [6]
Csts.ds=1; % Way of computing posterior distributions : 1 = max track , 2 = weighted sum of tracks
Csts.mo=1; % Mode : 'fast' = 1 or 'slow' = 0 [1]
if nargin>=3 && ~isempty(algo_params)
qqn=fieldnames(Csts);
for i=1:length(qqn)
if isfield(algo_params,qqn{i})
Csts.(qqn{i})=algo_params.(qqn{i});
end
end
end
%-------------------------------------------------------------------------%
%-------------------------------------------------------------------------%
%load the dictionary
mStates = [-28.4861773669176,-19.9241782718819,-16.4426351907036,...
-13.2371952081660,-9.08277302468020,-7.94392920991245,-10.1807698459865,...
-13.0242640127927,-15.0862478706129,-17.1550659704425,-20.5281316935197,-24.6762435506711,-28.8594807710477,-32.5786959842695,-34.7893823914205,...
-36.3359261522268,-36.8192673337429,-36.4363892290271,-38.0294065203303,-42.0503710814368,-45.5963723705087,-48.2040932769337,-49.5383787887783,...
-49.1147104408592,-48.8102903134417;-55.6639981588596,-61.5127504297246,-61.7239465777425,-62.8243042292255,-63.6413685588512,-63.4686731115175,...
-63.7758454966487,-63.6874780526371,-63.8179939306919,-63.9503258211402,-63.7966111988872,-64.0463832623785,-64.0818520961556,-64.1192957981112,...
-63.8411944409695,-63.6617787810601,-63.5628614840156,-63.1631597694168,-62.5434531164831,-61.9566668567832,-61.5323786575963,-61.3910567729765,...
-61.1150168405862,-60.5161965622102,-59.9977551298916;-28.6934939143922,-19.2542393025089,-15.1143438538347,-12.7293198179762,-12.1005903838332,...
-16.5017610503493,-21.3970568254212,-25.1613543930201,-28.8424911990220,-31.5618412114192,-32.1889756387523,-29.6313245488876,-26.0094143727967,...
-23.9888695941115,-23.0689428325671,-23.6462241160502,-26.4296918344984,-27.1090165222226,-27.8756237542369,-31.1075250195298,-36.3923980939477,...
-40.8889238387664,-43.4857021995535,-43.3831690409702,-42.9845505669993;-45.3678779268938,-43.6673845369666,-41.8441402268909,-39.9311165545071,...
-37.8535557910413,-36.8469454100004,-36.6393657864992,-36.5362981350264,-36.9937748890843,-37.4953438142185,-37.0039280540463,-35.1723035151364,...
-33.6115205373159,-33.4564666785186,-32.0578128508397,-29.7739710941898,-28.4547720864261,-25.9299736823261,-23.4486089524545,-21.9613450596309,...
-21.4217191910235,-22.0225885633808,-23.1188663976374,-23.7853960376589,-24.1662738392603;-34.1432887176235,-26.3187620722736,-23.6590932454401,...
-22.8473441058075,-23.1748279271661,-26.4411088266502,-29.2521006269876,-31.1772170063613,-33.6716054384278,-36.4153183945587,-38.6110013517002,...
-39.9143397342699,-41.0618568585801,-41.5304011208901,-41.0824724701060,-42.0444890310335,-44.6508339686914,-45.7999391511713,-45.7777619091791,...
-46.4288731995784,-48.2850680725583,-50.4157570788352,-51.6879601727512,-51.5283308152838,-51.3663633824326;-27.8144244788325,-17.3617936140541,...
-13.3123479510278,-11.0494334946260,-6.50571075754786,-3.54362892667645,-4.20504911233702,-8.05475391358820,-11.8924915327701,-14.0090223475965,...
-14.4546676449037,-14.2927721880105,-15.9448322180079,-18.7341480479014,-19.59665
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
matlab语音识别的一些基础代码库 (261个子文件)
flac.exe 256KB
shorten.exe 54KB
spendred.m 100KB
psycest.m 57KB
upolyhedron.m 45KB
spgrambw.m 27KB
modspect.m 26KB
dypsa.m 26KB
stdspectrum.m 25KB
gaussmix.m 24KB
psycdigit.m 22KB
sphrharm.m 18KB
ssubmmse.m 17KB
gaussmixg.m 17KB
xyzticksi.m 17KB
ssubmmsev.m 17KB
fxrapt.m 17KB
activlev.m 16KB
fxpefac.m 16KB
readsfs.m 16KB
estnoisem.m 16KB
v_addnoise.m 16KB
readwav.m 16KB
filtbankm.m 15KB
specsub.m 14KB
Contents.m 14KB
writewav.m 14KB
readsph.m 14KB
vadsohn.m 13KB
v_windows.m 12KB
gaussmixp.m 12KB
gaussmixt.m 11KB
melbankm.m 11KB
psychofunc.m 11KB
psycestu.m 11KB
v_colormap.m 10KB
v_sigma.m 10KB
sapisynth.m 10KB
gammabank.m 10KB
voicebox.m 9KB
v_ppmvu.m 8KB
activlevg.m 8KB
gaussmixd.m 8KB
readaif.m 8KB
kmeanhar.m 8KB
estnoiseg.m 7KB
v_windinfo.m 7KB
snrseg.m 7KB
imagehomog.m 7KB
gausprod.m 7KB
gaussmixk.m 6KB
gaussmixm.m 6KB
frq2bark.m 6KB
v_findpeaks.m 6KB
lpccovar.m 6KB
enframe.m 6KB
paramsetch.m 6KB
hostipinfo.m 5KB
maxgauss.m 5KB
v_kmeans.m 5KB
writehtk.m 5KB
readhtk.m 5KB
melcepst.m 5KB
sigalign.m 5KB
fram2wav.m 5KB
randvec.m 5KB
rectifyhomog.m 5KB
maxfilt.m 5KB
minspane.m 5KB
overlapadd.m 5KB
bark2frq.m 5KB
txalign.m 5KB
quadpeak.m 5KB
histndim.m 5KB
distisar.m 5KB
figbolden.m 4KB
hypergeom1f1.m 4KB
texthvc.m 4KB
lpcconv.m 4KB
lpcauto.m 4KB
momfilt.m 4KB
distitar.m 4KB
fig2emf.m 4KB
finishat.m 4KB
importsii.m 4KB
correlogram.m 4KB
entropy.m 4KB
lambda2rgb.m 4KB
distchar.m 4KB
zoomfft.m 4KB
distispf.m 4KB
disteusq.m 4KB
lpcifilt.m 4KB
skew3d.m 4KB
specsubm.m 4KB
distitpf.m 4KB
tilefigs.m 3KB
rotqr2eu.m 3KB
filterbank.m 3KB
dualdiag.m 3KB
共 261 条
- 1
- 2
- 3
资源评论
米兰的小铁匠o0
- 粉丝: 3
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功