📄 glotarea.m
字号:
% glotarea.m
% glottal area waveform generation
if (get(gloaream_h,'Value')==1)
% generate triangular glottal area
t0 = 1.0/FG_f0(sfno);
td = get(wavedur_h,'Value')*0.01*t0;
t1 = 0.5*(t0 - td);
t2 = t1 + td*get(opendur_h,'Value')*0.01;
t3 = t2 + td*get(closedur_h,'Value')*0.01;
smpFs = 10000.0;
T1 = floor(t1*smpFs);
T2 = floor((t2-t1)*smpFs);
T3 = floor((t3-t2)*smpFs);
T4 = sampf - T1 - T2 - T3;
for j=1:T1,
Agpulse(j) = 0.0;
end
for j=T1+1:T1+T2,
Agpulse(j) = 0.01*(j-T1)*get(maxglo_area_h,'Value')/T2;
end
for j=T1+T2+1:T1+T2+T3,
Agpulse(j)=0.01*get(maxglo_area_h,'Value')*(1.0-(j-T1-T2)/T3);
end
for j=T1+T2+T3+1:sampf,
Agpulse(j) = 0.0;
end
elseif (get(gloaream_h,'Value')==2)
% generate sine glottal area
t0 = 1.0/FG_f0(sfno);
td = get(wavedur_h,'Value')*0.01*t0;
t1 = 0.5*(t0 - td);
smpFs = 10000.0;
T1 = round(floor(t1*smpFs));
Td = round(sampf*get(wavedur_h,'Value')*0.01);
for j=1:T1,
Agpulse(j) = 0.0;
end
for j=1:Td+1,
Agpulse(T1+j) = 0.01*get(maxglo_area_h,'Value')*sin(pi*(j-1)/Td);
end
for j=T1+Td+2:sampf,
Agpulse(j) = 0.0;
end
elseif (get(gloaream_h,'Value')==3)
% generate raised cosine glottal area
t0 = 1.0/FG_f0(sfno);
td = get(wavedur_h,'Value')*0.01*t0;
t1 = 0.5*(t0 - td);
t2 = t1 + td*get(opendur_h,'Value')*0.01;
smpFs = 10000.0;
T1 = floor(t1*smpFs);
T2 = floor((t2-t1)*smpFs);
Td = round(sampf*get(wavedur_h,'Value')*0.01);
for j=1:T1,
Agpulse(j) = 0.0;
end
for j=0:T2,
Agpulse(T1+j+1) = 0.01*get(maxglo_area_h,'Value')*0.5*(1.0-cos(pi*j/T2));
end
for j=T2+1:Td-1,
Agpulse(T1+j+1) = 0.01*get(maxglo_area_h,'Value')*cos(pi*(j-T2)/(2.0*(Td-T2)));
end
for j=T1+Td:sampf-1,
Agpulse(j+1) = 0.0;
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -