⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plcupdate.m

📁 ITU-T G.723.1 Speech Coder: Matlab implementation This package implements the speech coder and de
💻 M
字号:
function [uvGain, L] = PLCUpdate (L, eMem, Pulseval, PLCpar)% Calulate an appropriate gain for unvoiced PLC excitation and a lag for% voiced PLC excitation.% $Id: PLCUpdate.m 1.4 2004/08/06 G.723.1-v2r1a $% Unvoiced gain from pulse amplitudes (interpolated from the last two% subframesuvGain = PLCpar.uvGainTable(Pulseval(end).gC+1, Pulseval(end-1).gC+1);% Pitch lag for PLC mode, set to zero if none.L = VuV_PLC (L(end-1), eMem, PLCpar);return% ------------function L = VuV_PLC (L, e, PLCpar)% Look at a block of samples in e (last N values). Search pitch lags% around L to find the best correlation with past values. If the relative% correlation exceeds a given value, return the lag that gives the% highest correlation. Otherwise return the lag as zero.% Input:  e, excitation signal, where the last N values represent the%         current subframe.% Output: L (lag), set to NaN for "unvoiced" frames.LOffs = PLCpar.LOffs;Lc = min (L, PLCpar.PMax - max (LOffs));N = PLCpar.N;% Start of blockiS1 = length (e) - N + 1;iSN = iS1 + N - 1;e0 = e(iS1:iSN);CLMax = 0;L = NaN;for (Lt = Lc+LOffs)  CL = e0' * e(iS1-Lt:iSN-Lt);  if (CL > CLMax)    CLMax = CL;    L = Lt;  endendif (~ isnan (L))  % Zero lag energy  E0 = e0' * e0;  % Lopt lag energy  EL = e(iS1-L:iSN-L)' * e(iS1-L:iSN-L);  % Test Prediction gain  CThr = (PLCpar.PGMin - 1) / PLCpar.PGMin;  if (CThr * EL * E0 > CLMax^2)    L = NaN;  endendreturn

⌨️ 快捷键说明

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