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

📄 celpexec.m

📁 实现fs1016w的CELP的低速率语音编解码功能的基于vc开发环境的原代码。
💻 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 (480) 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.
%
% ******************************************************************
% CELPEXEC
%
% NSA CELP 3.2a VOICE CODER EXECUTIVE LOOP
%
% PORTED TO MATLAB FROM CELP 3.2a C RELEASE
% 6-7-94
%
% ******************************************************************
%
% DESCRIPTION
%
% CELP 3.2a simulation executive, or main loop. CELPEXEC drives analysis,
% transmission, synthesis, and graphical user interface (GUI).
%
% DESIGN NOTES
%
% Due to the incorporation of a graphical user interface and MATLAB ui
% control objects with their associated callback structures, the executive
% loop structure is slightly different here than in the CELP 3.2a C code.
% Depending upon the type of session selected by a user, celpexec.m will
% run either of two ways:
%
% METHOD 1 : Status Output Only - No plotting or user interaction
%            If the user selects status output only, celpexec.m will
%            only be called once, at simulation startup. It will run in an
%            infinite while loop until input file EOF forces a break
%            and drops control to the termination else clause.
%
% METHOD 2 : Interactive Graphical And Status Output
%            celpexec.m will be called once per frame, via the callback
%            action associated with the NEXT frame button in the gui
%            output window.  Because this method generates a call for
%            every frame, the infinite while loop is broken out of after
%            each execution.  A call to gui causes the cycle to repeat
%            by creating a new NEXT button.
%
% In addition, this simulation will run analysis-synthesis or
% synthesis only.  Synthesis only simulations use .cha hex files generated
% by previous Analysis-Synthesis simulations.
%
% Among the many variables in this simulation, those associated with gui
% functions are distinguished by the prefix 'gui', e.g., guiState.
% gui variables are all global since the gui program is
% often invoked via callback, where many variables are not in scope.
%
% VARIABLES
%
% INTERNALS
%   iarf             -   Unprocessed frame of input speech
%   status           -   File access status, input speech file
%   fpi              -   File pointer, input speech file
%   SimType          -   Analysis-synthesis or synthesis only flag
%   line             -   Synthesis only input frame from ASCII hex bitstream
%   linecount        -   Stnthesis only number of input lines (frames) read
%
% CONSTANTS
%    ANALYSIS        -   Simulation type flag; Analysis-synthesis
%    LFRAME          -   Frame size
%    EOF             -   End of file flag
%    READ            -   Control flag, diskio routine
%    STREAMBITS      -   Bits per frame of CELP analysis output
%
% ******************************************************************

% DECLARE GLOBAL CONSTANTS
global EOF LFRAME READ;

% OPEN INPUT AND OUTPUT FILES
[ fpi, fpo, fpnpf, fphpf ] = setup;

% INITIALIZE STATUS OR TUTORIAL WINDOW, DEPENDING UPON GUI STATE
guiinit(1);

while 1 == 1

    % READ AN INPUT FRAME
    [ iarf, status ] = diskio( READ, fpi, [], LFRAME );

    % CASE 1 : NOT YET EOF, PROCESS A NEW FRAME
    if ( status ~= EOF )

        % RUN ANALYSIS, THEN SYNTHESIS.  THIS PRODUCES AN ASCII HEX
        % FILE FOR CELP ANALYSIS PARAMETERS AND SEVERAL BINARY
        % FILES FOR SYNTHETIC OUTPUT SPEECH
        celpstat
        celpanal
        celpsyn

    % CASE 2 : EOF, CLOSE FILES AND TERMINATE SIMULATION
    else

        % CLOSE FILES
        fclose( 'all' );

        % DISPLAY TERMINATION WINDOW
        guiinit( 2 );

        % EXIT EXECUTIVE LOOP
        break;
    end
end

⌨️ 快捷键说明

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