function times=read_pm(filename); 
%
% Syntax: times=read_pm(filename); 
%
% Reads Pitch Marker file from Mike Bacon, returns times (probably)
% in seconds
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

ff = fopen (filename,'r');

% reading and skipping header
while 1
  S = fscanf(ff,'%s',1);
  if strcmp(S, 'EST_Header_End') 
    break
  end
end

% reading data
aux = fscanf (ff, '%f %f', [2 inf]);
fclose (ff);

times = aux (1,:);


