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

📄 lfmodel.m

📁 这是一个用于语音信号处理的工具箱
💻 M
字号:
%FUNCTION: model and generate the glottal pulse using the simplified LF model.
%       [Rd,Ee,gpulse]=lfmodel(gflow) returns the extimated glottal waveform and the
%        coefficient vector which fits the polynomial model.
% INPUT: gflow = the glottal flow , i.e. the integral of the residual signal for 
%                 inverse filtering.
% OUTPUT:  Rd = basic shape parameter for LF model 
%          Ee = max negative differential waveform value 
%       gpulse = an estimated differential glottal waveform
%
% SEE ALSO: lfpuls.

function [Rd,Ee,gpulse]=lfmodel(gflow);

lens=length(gflow);
F0=10000/lens;

% 1. find Ee

 dgf=filter([1 -1],1,gflow);
 Ee=min(dgf);
 Ee=-Ee;

% 2. find U0
 U0=max(gflow);
 U0=U0-min(gflow);

 Rd=U0/Ee*F0/1100; %%% original 110 => adjusted to 1100

% 3. estimated other parameters
if nargout>2

  Ra=(-1+4.8*Rd)/100;
  Rk=(22.4+11.8*Rd)/100;
  Rg=Rk/4/( 0.11*Rd/(0.5+1.2*Rk)-Ra);

  T0=lens-1;
  Ta=T0*Ra;
  Tp=T0/2/Rg;
  Te=floor(Tp*Rk+Tp);
  Tc=T0;

  [alpha,eps1,ece,wg,e0]=lfsrc(Tp,Te,Ta,Tc,Ee);


% 4. gererate the LF pulse
  for i=1:Te
      gp(i)=e0*exp(alpha*i)*sin(wg*i);
  end

  for i=Te:T0
      gp(i)=-Ee*exp((-eps1*(i-Te)-ece))/(eps1*Ta);
      if gp(i)>0.0
         gp(i)=0;
      end
  end 

  gp=gp-mean(gp);
  gpulse=[gp(Te:T0) gp(1:Te)];

% 5. produce high-energy pulse at the glottal closure (follow Dr.Hu's approach)

  % create a pulse swing
  gpulse(3)=0.6*gpulse(2)+0.4*gpulse(1);
  gpulse(6)=0.5*gpulse(6)+0.5*gpulse(3);

  % Remove the spectral tilt of the excitation pulse by inverse filtering
  ss=gpulse(2:lens);
  ss=ss(:);
  energy=ss'*ss;
  rc1=ss(1:lens-2)'*ss(2:lens-1)/energy; % first order reflect coefficient
  gpulse=filter([1 -.8*rc1],1,gpulse);  % first-order inverse filtering

end

⌨️ 快捷键说明

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