Mercurial > hg > emotion-detection-top-level
annotate 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 |
rev | line source |
---|---|
Dawn@4 | 1 #This file is used to extract all the jitter value of the singing database |
Dawn@4 | 2 #All formant results would be saved into a txt file for each sample |
Dawn@4 | 3 |
Dawn@4 | 4 |
Dawn@4 | 5 for folder from 1 to 4 |
Dawn@4 | 6 |
Dawn@4 | 7 if ( folder = 1 ) |
Dawn@4 | 8 folderName$ = "WangXinnong\pos\" |
Dawn@4 | 9 elsif ( folder = 2 ) |
Dawn@4 | 10 folderName$ = "WangXinnong\neg\" |
Dawn@4 | 11 elsif ( folder = 3 ) |
Dawn@4 | 12 folderName$ = "ZhangShuo\pos\" |
Dawn@4 | 13 elsif ( folder = 4 ) |
Dawn@4 | 14 folderName$ = "ZhangShuo\neg\" |
Dawn@4 | 15 endif |
Dawn@4 | 16 |
Dawn@4 | 17 for method from 1 to 3 |
Dawn@4 | 18 |
Dawn@4 | 19 if ( method = 1 ) |
Dawn@4 | 20 theMethod$ = "robust" |
Dawn@4 | 21 elsif ( method = 2 ) |
Dawn@4 | 22 theMethod$ = "Burg" |
Dawn@4 | 23 elsif ( method = 3 ) |
Dawn@4 | 24 theMethod$ = "all" |
Dawn@4 | 25 endif |
Dawn@4 | 26 |
Dawn@4 | 27 dirPath$ = "C:\Users\Dawn\Dropbox\BUPTResearch2011\Data\Opera\PaperDatabase\" + folderName$ |
Dawn@4 | 28 Create Strings as file list... list 'dirPath$'\*.wav |
Dawn@4 | 29 fileNum = Get number of strings |
Dawn@4 | 30 for ifile to fileNum |
Dawn@4 | 31 select Strings list |
Dawn@4 | 32 fileName$ = Get string... ifile |
Dawn@4 | 33 newFileName$ = fileName$ |
Dawn@4 | 34 Read from file... 'dirPath$''fileName$' |
Dawn@4 | 35 newfilePath$ = dirPath$ |
Dawn@4 | 36 |
Dawn@4 | 37 newFileName$ = newFileName$-".wav" |
Dawn@4 | 38 #To PointProcess (extrema)... 1 yes no Sinc70 |
Dawn@4 | 39 |
Dawn@4 | 40 if ( method = 1 ) |
Dawn@4 | 41 To Formant (robust)... 0.01162 3 20000 0.001 50 1.5 5 0.000001 |
Dawn@4 | 42 elsif ( method = 2 ) |
Dawn@4 | 43 To Formant (burg)... 0.01162 3 20000 0.001 50 |
Dawn@4 | 44 elsif ( method = 3 ) |
Dawn@4 | 45 To Formant (keep all)... 0.01162 3 20000 0.001 50 |
Dawn@4 | 46 endif |
Dawn@4 | 47 |
Dawn@4 | 48 Down to FormantTier |
Dawn@4 | 49 newfolder$ = newFileName$ + "_metrics" |
Dawn@4 | 50 metricFilename$ = newFileName$ + "_Formant_" + theMethod$ |
Dawn@4 | 51 #c$ > 'dirPath$''newfolder$'\'metricFilename$'.txt |
Dawn@4 | 52 Write to text file... 'dirPath$''newfolder$'\'metricFilename$'.txt |
Dawn@4 | 53 |
Dawn@4 | 54 select Sound 'newFileName$' |
Dawn@4 | 55 Remove |
Dawn@4 | 56 select Formant 'newFileName$' |
Dawn@4 | 57 Remove |
Dawn@4 | 58 select FormantTier 'newFileName$' |
Dawn@4 | 59 Remove |
Dawn@4 | 60 |
Dawn@4 | 61 endfor |
Dawn@4 | 62 select Strings list |
Dawn@4 | 63 Remove |
Dawn@4 | 64 endfor |
Dawn@4 | 65 endfor |