?? nspuls.m
字號(hào):
%FUNCTION: generate the excitation waveform by the noise component.
% gpulse=nspulse(amp1,offset,amp2,duration,lens,aspgain,fgain)
% returns the noise component wavform.
%
% INPUT: amp1,offset,amp2, duration = four timing parameter for aspiration
% noise
% lens = the length of the pitch period
% aspgain = gain for aspiration noise
% fgain = gain for fricative noise
%
% OUTPUT:
% gpulse = an estimated differential glottal waveform
%
% Author: Albert Hsiao 2/97
function gpulse=nspuls(amp1,offset,amp2,duration,lens,aspgain,fgain);
if nargin<6
aspgain=0;
fgain=0;
elseif nargin==6
fgain=0;
end
% issue warning message
if (offset+duration)>1
disp('Error in noise timing parameters!')
disp('The sum of the offset and duration should be less than 1.');
disp(['offset=' num2str(offset) ' duration=' num2str(duration) ]);
return;
end
% 1. generate the aspration noise signal
noise=10*( rand(1,lens)-0.5 );
offset=fix(offset*lens);
duration=fix(duration*lens);
ns1=amp1*ones(1,offset);
ns2=amp2*ones(1,duration);
ns3=zeros(1,lens-offset-duration);
noise=noise.*[ns1 ns2 ns3];
gm= aspgain;
if (amp1==0) & (amp2==0)
amp=0;
else
amp=gm;
end
noise=amp*noise;
% 2. gererate the fricative noise signal
W=cshift(gauss(-1:2/lens:1,0,.25),floor(lens/2))+.5;
fnoise=(rand(1,lens+1)-.5).*W;
fnoise=fnoise(1:lens);
amp=fgain;
fnoise=amp*fnoise;
% 3. combine the two noise signals
gpulse=noise+fnoise;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -