📄 mexcite2.m
字号:
% MATLAB SIMULATION OF NSA FS-1016 CELP v3.2
% COPYRIGHT (C) 1995-99 ANDREAS SPANIAS AND TED PAINTER
%
% This Copyright applies only to this particular MATLAB implementation
% of the FS-1016 CELP coder. The MATLAB software is intended only for educational
% purposes. No other use is intended or authorized. This is not a public
% domain program and distribution to individuals or networks is strictly
% prohibited. Be aware that use of the standard in any form is goverened
% by rules of the US DoD. Therefore patents and royalties may apply to
% authors, companies, or committees associated with this standard, FS-1016. For
% questions regarding the MATLAB implementation please contact Andreas
% Spanias at (602) 965-1837. For questions on rules,
% royalties, or patents associated with the standard, please contact the DoD.
%
% ALL DERIVATIVE WORKS MUST INCLUDE THIS COPYRIGHT NOTICE.
%
% ******************************************************************
% MEXCITE2
%
% PORTED TO MATLAB FROM CELP 3.2a C RELEASE
% 7-8-94
%
% ******************************************************************
%
% DESCRIPTION
%
% Modify the stochastic codebook excitation gain
%
% DESIGN NOTES
%
% Depending on the current system state, the stochastic code book
% excitation is reduced to a level that is low enough to produce
% positive perceptual effects, yet is high enough so as not to upset
% the dynamics of the system. The main effect of the method is that
% during sustained voiced sounds, the excitation level is attenuated
% and in unvoiced and transition regions the level is amplified to a
% level slightly more than that of standard CELP.
%
% The relative adaptive code book excitation component is
% increased in voiced regions by decreasing the stochastic code book
% excitation component. The amount of decrease in the stochastic
% component depends on the efficiency of the adaptive component.
% More reconstruction burden is placed on the adaptive component as
% its efficiency increases. The efficiency is measured by the
% closeness (in the crosscorrelation sense) of the residual signals
% before and after pitch prediction. When the efficiency is high
% (e.g., > 0.9), the stochastic component is amplified slightly
% (e.g., one quantizer level).
%
% The procedure for modifying the stochastic gain outside the
% search loop is:
%
% 1) Measure the efficiency of the adaptive component (ccor)
% 2) Search the stochastic code book for the optimum codeword
% 3) Modify the stochastic code book gain
%
% REFERENCES
%
% 1) Shoham, Yair, "Constrained-Stochastic Excitation Coding of Speech
% at 4.8 kbps," in Advances in Speech Coding, ed. B. Atal, V.
% Cuperman, and A. Gersho, submitted to Kluwer Academic Publishers.
%
% 2) Shoham, Yair, "Constrained-Stochastic Excitation Coding of Speech,"
% Abstracts of the IEEE Workshop on Speech Coding for
% Telecommunications, 1989, p. 65.
%
% VARIABLES
%
% INPUTS
% l - Length of error signal
%
% GLOBALS
% e0 - Error signal
% e0save - Copy of first error signal
% e1 - Euclidean norm of the first error signal
% ccor - Crosscorrelation of the residual signals
%
% ******************************************************************
function mexcite2( l )
% DECLARE GLOBALS
global e0 e0save e1 ccor
% CCOR = CROSSCORRELATION OF THE RESIDUAL SIGNALS BEFORE AND AFTER
% PITCH PREDICTION. (NOTE: THE ERROR SIGNAL ARRAY E0 IS REUSED)
ccor = 1e-6 + sum( e0(1:l) .* e0save(1:l) );
% NORMALIZE THE CROSSCORRELATION
ccor = ccor / e1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -