view Code/Descriptors/PRAAT/jitter-singing @ 4:92ca03a8fa99 tip

Update to ICASSP 2013 benchmark
author Dawn Black
date Wed, 13 Feb 2013 11:02:39 +0000
parents
children
line wrap: on
line source
#This file is used to extract all the jitter value of the singing database
#All jitter results would be saved into a txt file for each sample


for folder from 2 to 4

	if ( folder = 1 )
	  folderName$ = "WangXinnong\pos\"
	elsif ( folder = 2 )
	  folderName$ = "WangXinnong\neg\"
	elsif ( folder = 3 )
	  folderName$ = "ZhangShuo\pos\"
	elsif ( folder = 4 )
	  folderName$ = "ZhangShuo\neg\"
	endif

	for method from 1 to 4

	  if ( method = 1 )
	    theMethod$ = "rap"
	  elsif ( method = 2 )
	    theMethod$ = "ddp"
	  elsif ( method = 3 )
	    theMethod$ = "local"
	  elsif ( method = 4 )
	    theMethod$ = "ppq5"
	  endif

	  dirPath$ = "C:\Users\Dawn\Dropbox\BUPTResearch2011\Data\Opera\PaperDatabase\" + folderName$
  	  Create Strings as file list... list  'dirPath$'\*.wav
	  fileNum = Get number of strings
	  for ifile to fileNum
	    select Strings list
	    fileName$ = Get string... ifile
	    newFileName$ = fileName$
	    Read from file... 'dirPath$''fileName$'
  	    newfilePath$ = dirPath$

  	    newFileName$ = newFileName$-".wav"
	    To PointProcess (extrema)... 1 yes no Sinc70

	    
	    if ( method = 1 )
	      c$ = Get jitter (rap)... 0.0 0 0.0001 0.02 1.3
	    elsif ( method = 2 )
	      c$ = Get jitter (ddp)... 0.0 0 0.0001 0.02 1.3
	    elsif ( method = 3 )
	      c$ = Get jitter (local)... 0.0 0 0.0001 0.02 1.3
	    elsif ( method = 4 )
	      c$ = Get jitter (ppq5)... 0.0 0 0.0001 0.02 1.3
	    endif

	    newfolder$ = newFileName$ + "_metrics"
	    metricFilename$ = newFileName$ + "_FullJitter_" + theMethod$
	    #c$ > 'dirPath$''newfolder$'\'metricFilename$'.txt
	    Write to text file... 'dirPath$''newfolder$'\'metricFilename$'.txt

	    select PointProcess 'newFileName$'
	    Remove
	    select Sound 'newFileName$'
	    Remove
	  endfor
	  select Strings list
	  Remove
	endfor
endfor