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

📄 gci_dis.m

📁 这是一个用于语音信号处理的工具箱
💻 M
字号:
% FUNCTION: GCI_DIS distributes the GCI sequence over a region.
% 
% USUAGE: ngci=gci_dis(p00,p01, gci_s, gci_e);
%
% OUTPUT : gci == the determined GCI sequence
% INPUT :  p00 == the pitch period in the preceding frame
%          p01 == the pitch period in the following frame
%          gci_s == the left gci indxe
%          gci_e == the right gci index
% See also: pctour.

function ngci=gci_dis(p00,p01,gci_s,gci_e);

pts=gci_e-gci_s;

if pts<0
   ngci=[];
   return;
end

if p00==0  % the preceding frame is unvoiced
   gci_num=round(pts/p01+0.2);
   ngci=gci_e- round( p01*(gci_num:-1:1)+rand(1,gci_num)-0.5 );

elseif p01==0 % the following frame is  unvoiced
   gci_num=round(pts/p00+0.2);
   ngci= p00*(1:1:gci_num)+rand(1,gci_num)-0.5;
   ngci=gci_s+ round(ngci);

else  % both frames are voiced
   rat0=pts/p00;
   rat1=pts/p01;
   gci_num=max(fix(rat0),fix(rat1)); % number of GCIs inserted
   dev=(rat1/2+rat0/2-gci_num-1)/(gci_num);
   ratio=gci_num+1;

   for ll=1:gci_num
        ratio=ratio+(-1)^ll*dev;
        if ll==1
           ngci(ll)=round( pts/ratio );
        else
           ngci(ll)=ngci(ll-1)+round( pts/ratio );
        end
   end
 
   ngci=ngci+gci_s;
end

⌨️ 快捷键说明

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