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

📄 lspdecod.m

📁 FS1016源代码
💻 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.
%
% ******************************************************************
% LSPDECOD
%
% PORTED TO MATLAB FROM CELP 3.2a C RELEASE
% 8-2-94
%
% ******************************************************************
%
% DESCRIPTION
%
% Independent nonuniform lsp decoder
%
% DESIGN NOTES
%
% Uses Kang's tables modified for no preemphasis and bit allocation
%
% VARIABLES
%
% INPUTS
%   findex   -      Quantized LSP table indicies
%   no       -      Order (predictor order)
%
% OUTPUTS
%   freq     -      Quantized LSPs
%
% INTERNALS
%   Q        -      LSP quantization table, reorganized into a column vector
%                   for : based index computation
%
% GLOBALS
%   lspQ      -     LSP quantization table
%
% CONSTANTS
%   FSCALE   -      Frequency scale factor (system sample rate)
%
% ******************************************************************

function freq = lspdecod( findex, no )

% DECLARE GLOBAL VARIABLES
global lspQ

% DEFINE CONSTANTS
FSCALE = 8000.00;

% QUANTIZE LSP FREQUENCIES USING INDICIES FOUND ABOVE
% RESHAPE TO EXPLOIT : BASED INDEXING FOR COLUMN VECTOR INSTEAD OF
% LOOP INDEXING IN A TWO-DIMENSIONAL ARRAY
Q = reshape( lspQ',160,1);
freq( 1:no, 1 ) = Q( ((0:no-1)'*16)+findex(1:no)+1 ) / FSCALE;



⌨️ 快捷键说明

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