📄 codegain.m
字号:
function CGC = CodeGain (ACBbIB, Pulseval, Pitchpar)% Combined codes for the adaptive codebook gains and the multipulse gains.% $Id: CodeGain.m 1.3 2004/08/03 G.723.1-v2r1a $GModV = Pitchpar.GModV;NSubframe = length (Pulseval);for (i = 1:NSubframe) % Code the gains for the pitch and the multipulse contributions ShiftC = (~ isinf (Pulseval(i).ShiftLag)); CGC(i) = SubframeGainC (ACBbIB(:,i), Pulseval(i).gC, ShiftC, GModV); endreturn%--------------------function CGC = SubframeGainC (ACBbIB, gC, ShiftC, GModV)% Form the combined gain code for the adaptive codebook gain and the% multipulse gain.% ACBbIB: Adaptive codebook gain (index, codebook). The index takes on% 85 levels (codebook 1) or 170 levels (codebook 2)% gC: Multipulse amplitude code code (24 levels)% ShiftC: Multipulse shift flag for shift and repeat operation. The use of% shift and repeat is only available if the pitch filter uses% codebook 1.% The total number of combinations is 4080, which can be coded with 12 bitsACBbC = ACBbIB(1) - 1;CBookI = ACBbIB(2);if (CBookI == 1) % Choose 85 or 170 levels CGC = CombineVals ([gC, ACBbC, ShiftC], GModV{CBookI});else CGC = CombineVals ([gC, ACBbC], GModV{CBookI});endreturn
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -