Mercurial > hg > emotion-detection-top-level
diff Code/Descriptors/PRAAT/formant-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 diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Code/Descriptors/PRAAT/formant-singing Wed Feb 13 11:02:39 2013 +0000 @@ -0,0 +1,65 @@ +#This file is used to extract all the jitter value of the singing database +#All formant 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 3 + + if ( method = 1 ) + theMethod$ = "robust" + elsif ( method = 2 ) + theMethod$ = "Burg" + elsif ( method = 3 ) + theMethod$ = "all" + 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 ) + To Formant (robust)... 0.01162 3 20000 0.001 50 1.5 5 0.000001 + elsif ( method = 2 ) + To Formant (burg)... 0.01162 3 20000 0.001 50 + elsif ( method = 3 ) + To Formant (keep all)... 0.01162 3 20000 0.001 50 + endif + + Down to FormantTier + newfolder$ = newFileName$ + "_metrics" + metricFilename$ = newFileName$ + "_Formant_" + theMethod$ + #c$ > 'dirPath$''newfolder$'\'metricFilename$'.txt + Write to text file... 'dirPath$''newfolder$'\'metricFilename$'.txt + + select Sound 'newFileName$' + Remove + select Formant 'newFileName$' + Remove + select FormantTier 'newFileName$' + Remove + + endfor + select Strings list + Remove + endfor +endfor \ No newline at end of file