function makepitchtier (M,fname) % MAKEPITCHTIER creates Praat PitchTier file given times and values % % makepitchtier (M,fname) % M is a N x 2 matrix representing N measurements % The first column has the times (in seconds) of each measurement % and the second column has each measurement. % fname is the name of the PitchTier file you want created % and should include the '.PitchTier' extension if wanted. % % The PitchTier file is in Short Text format. % % dinoj@cs.uchicago.edu Tue Oct 11 14:30:34 CDT 2005 N = size(M,1); T = M(N,1); fid = fopen(fname,'wt'); fprintf(fid,'File type = "ooTextFile short"\n"PitchTier"\n\n0\n%0.2f\n%d\n',T,N); for i=1:N fprintf(fid,'%0.4f\n%0.8f\n',M(i,1),M(i,2)); end fclose(fid);