?? g729decodermain.asv
字號:
%G729A解碼main函數
%將碼流文件讀入內存中,準備轉換成幀輸入參數
function G729decodermain
%clear all;
%clc;
fid=fopen('speech.bit');
speechin= fread(fid,'int16');
fclose(fid);
for i=1:length(speechin)
if speechin(i)==127 % 0x7f
speechin(i)=0;
else if speechin(i)==129 % 0x81
speechin(i)=1;
end
end
end
bitstream=enframe(speechin,82);
bitstream=(bitstream(:,3:end));
QuanJuValuedecode();
s=zeros(1,80);
speechout=[];
tic
%/*-----------------------------------------------------------------*
% * Main decoder routine *
% *-----------------------------------------------------------------*/
for i=1:size(bitstream,1)
a=dec2bin(bitstream(i,:));
a=a';
%接下來將C1 C2 P0 P1 P2 S1 S2轉成10進制數
[L0,L1,L2,L3,P1,P0,S1,C1,GA1,GB1,P2,S2,C2,GA2,GB2]=destream(a);
%接下來進行解碼
[s,Az_dec,T2]=G729decode(L0,L1,L2,L3,P1,P0,S1,C1,GA1,GB1,P2,S2,C2,GA2,GB2);
%round(Az_dec*2^12)'
%T2
syn_pst=Post_Filter(s, Az_dec, T2); %/* Post-filter */
synth=Post_Process(syn_pst);
speechout=[speechout,synth];
end
toc
speechout=speechout/2^15;
wavwrite(speechout,'test110');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -