function hnm2ceps(FileName, TYPE, SAVE) % % function hnm2ceps(FileName, TYPE) % % FileName : The results file from HNMa without extensions % TYPE : 'float' [default] or 'double' % SAVE : format of output file 't' (text) [default] 'b': (binary) % % default output directory PATHci = '/nfs/srv5_d4/parole/PROG/SP_ANA/TEST/HNM2CI/'; if(nargin < 2) TYPE = 'float'; end if(nargin < 3) SAVE = 't'; end % retrieve the results ... [time,pitch,nb_harm,gain,ki,amp,phase,ceps] = loadHNM(FileName, TYPE); % number of frames & size of ceps [NumFr, CepsSize] = size(ceps); % output file name file_ob =[PATHci FileName '.ci'] if(SAVE=='t') fid_ob = fopen(file_ob, 'w'); if fid_ob == -1 break; end; fprintf(fid_ob,'%s\n',int2str(CepsSize)); for i=1:NumFr for j=1:CepsSize fprintf(fid_ob,'%s ',num2str(ceps(i,j))); end; fprintf(fid_ob,'\n'); end; elseif (SAVE=='b') fid_ob = fopen(file_ob, 'wb'); if fid_ob == -1 break; end; fwrite(fid_ob, CepsSize, 1, 'short'); for(i=1:NumFr) fwrite(fid_ob, ceps(i,:), CepsSize, TYPE); end else disp('No valued SAVE format. Please type hnm2ceps for help.'); end