?? psolaf.m
字號(hào):
function out=psolaF(in,m,alpha,beta,gamma)
% . . .
% gamma newFormantFreq/oldFormantFreq
% . . .
% the internal loop as
P = diff(m); %compute pitch periods
if m(1)<=P(1), %remove first pitch mark
m=m(2:length(m));
P=P(2:length(P));
end
if m(length(m))+P(length(P))>length(in) %remove last pitch mark
m=m(1:length(m)-1);
else
P=[P P(length(P))];
end
Lout=ceil(length(in)*alpha);
out=zeros(1,Lout); %output signal
tk = P(1)+1; %output pitch mark
while round(tk)<Lout
[minimum i]=min(abs(alpha*m-tk) ); % find analysis segment
pit=P(i);
pitStr=floor(pit/gamma);
gr=in(m(i)-pit:m(i)+pit).*hanning(2*pit+1);
gr=interp1(-pit:1:pit,gr,-pitStr*gamma:gamma:pit);% stretch segm.
iniGr=round(tk)-pitStr;endGr=round(tk)+pitStr;
if endGr>Lout, break; end
out(iniGr:endGr)=out(iniGr:endGr)+gr; % overlap new segment
tk=tk+pit/beta;
end % end of while
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -