lpcgain.m

来自「语音工具箱」· M 代码 · 共 51 行

M
51
字号
function G = lpcgain(xi,P)%  lpcgain --> Gain estimation from prediction error energy.%%  <Synopsis>%    G = lpcgain(xi,P)%%  <Description>%    The gain across speech frames, returned in vector G, can be%    estimated from the prediction error energies in vector xi and%    the pitch periods in vector P as%%      G = sqrt(xi),         unvoiced case%      G = sqrt(P*xi),       voiced case%%  <See Also>%    lpcauto  --> Linear Predictor Coefficients.%    lpcpitch --> Pitch estimation from prediction error sequence.%  <References>%  [1] J.R Deller, J.G. Proakis and F.H.L. Hansen, "Discrete-Time%      Processing of Speech Signals", IEEE Press, p. 325, (2000).%%  <Revision>%    Peter S.K. Hansen, IMM, Technical University of Denmark%%    Last revised: September 30, 2000%-----------------------------------------------------------------------% Check the required input arguments.if (nargin < 2)  error('Not enough input arguments.')end% Number of frames.F = length(xi);% Initialize output argument.G = zeros(F,1);for (f=1:F)  if (P(f))    G(f) = sqrt(P(f)*xi(f));            % Voiced frame.  else    G(f) = sqrt(xi(f));                 % Unvoiced frame.  endend%-----------------------------------------------------------------------% End of function lpcgain%-----------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?