view Code/Descriptors/PRAAT/shimmer-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 shimmer value of the singing database
#All jitter results would be saved into a txt file for each sample


for folder from 1 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 5

	  if ( method = 1 )
	    theMethod$ = "apq3"
	  elsif ( method = 2 )
	    theMethod$ = "apq5"
	  elsif ( method = 3 )
	    theMethod$ = "apq11"
	  elsif ( method = 4 )
	    theMethod$ = "dda"
          elsif ( method = 5 )
	    theMethod$ = "local"
	  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
	    plus Sound 'newFileName$'

	    
	    if ( method = 1 )
	      c$ = Get shimmer (local)... 0.0 0 0.0001 0.02 1.3 1.6
	    elsif ( method = 2 )
	      c$ = Get shimmer (apq5)... 0.0 0 0.0001 0.02 1.3 1.6
	    elsif ( method = 3 )
	      c$ = Get shimmer (apq11)... 0.0 0 0.0001 0.02 1.3 1.6
	    elsif ( method = 4 )
	      c$ = Get shimmer (dda)... 0.0 0 0.0001 0.02 1.3 1.6
            elsif ( method = 5 )
	      c$ = Get shimmer (apq3)... 0.0 0 0.0001 0.02 1.3 1.6
	    endif

	    newfolder$ = newFileName$ + "_metrics"
	    metricFilename$ = newFileName$ + "_FullShimmer_" + 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