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