No BSD License  

Highlights from
HNM-speech anlysis/synthsis model

from HNM-speech anlysis/synthsis model by xu ning
a routine for HNM model

s=SyHNM(pitchArray,amCell)
function s=SyHNM(pitchArray,amCell)
%synthesizing of HNM
%Input:
%pitchArray-----record pitch in synchronization
%amCell---------amplitude and phase information
%Output:
%s-----------------synthesized speech

lengthOfPA=length(pitchArray);
lengthOfAC=length(amCell);
pitchArray=round(pitchArray*1);
SYSP=[];
for ii=1:lengthOfPA
    if pitchArray(ii)==0
        %unvoiced frame
        whiteNoise=randn(1,160);
        arFilter=amCell{ii}(1:13);
        var=amCell{ii}(14);
        syFrameSpeech=sqrt(var)*filter(1,arFilter,whiteNoise);
        SYSP=[SYSP,syFrameSpeech];
    else
        %voiced frame
        syFrameSpeech=zeros(1,pitchArray(ii));
        a=abs(amCell{ii});
        b=angle(amCell{ii});
        L=length(amCell{ii});
        for jj=1:L
            syFrameSpeech=syFrameSpeech+...
                a(jj)*cos(2*pi*jj*[0:pitchArray(ii)-1]/pitchArray(ii)+b(jj));
        end
        SYSP=[SYSP,syFrameSpeech];
    end
end
s=SYSP;
end

Contact us at files@mathworks.com