function write_hnm(FileName,ta,Pitch,NbHarm,Gain, k,amp, phase, ceps) % % function write_hnm(FileName,ta,Pitch,NbHarm,Gain, k,amp, phase, ceps) % % FileName : The file name of the analysis HNM without the % default extensions % % USAGE : write_hnm(FileName,ta,Pitch,NbHarm,Gain, k,amp, phase, ceps) % needs the dsc file ! % % Defaults values % MAXHARM = 200; % the maximum number of harmonics EXT_RES = '_hnma.res'; EXT_DSC = '_hnma.dsc'; fpdsc = fopen([FileName EXT_DSC], 'rt'); Size = fscanf(fpdsc, '%d %ld %d\n'); % jan: the same... fclose (fpdsc); NumFr = Size(2); CepsSize = Size(3); SizeLPC = Size(5)+1; disp ([' NumFr ' num2str(NumFr) ' CepsSize ' num2str(CepsSize) ... ' SizeLPC ' num2str(SizeLPC)]); %size (par) fpres = fopen([FileName EXT_RES], 'wb'); Step = 1; for i=1:NumFr fwrite (fpres, ta(i), 'float'); fwrite (fpres, Pitch(i), 'float'); fwrite (fpres, NbHarm(i) - 1, 'float'); % invesre from lect_hnm fwrite (fpres, Gain(i), 'float'); fwrite (fpres, k(i,:), 'float'); fwrite (fpres, amp(i,1:NbHarm(i)), 'float'); fwrite (fpres, phase(i,1:NbHarm(i)), 'float'); fwrite (fpres, ceps(i,:), 'float'); % pause end fclose (fpres);