Dawn@4
|
1 function [] = get_Formants( dirName, statsFileID )
|
Dawn@4
|
2
|
Dawn@4
|
3 % this function collates the results of all values calculated using the PRAAT software
|
Dawn@4
|
4
|
Dawn@4
|
5 % For jitter and shimmer PRAAT returns only a single value, not a
|
Dawn@4
|
6 % frame-by-frame calculation. Therefore we cannot find the varience etc.
|
Dawn@4
|
7
|
Dawn@4
|
8
|
Dawn@4
|
9 % identify the speaker in the stats file
|
Dawn@4
|
10 fprintf( statsFileID, '%s ', dirName );
|
Dawn@4
|
11
|
Dawn@4
|
12
|
Dawn@4
|
13 %-------------- get the formant metrics ----------------------
|
Dawn@4
|
14 % PRAAT returns a frame-by-frame value
|
Dawn@4
|
15 % need to discard all formant information for unvoiced and silent frames.
|
Dawn@4
|
16 vuv = detect_VoicedUnvoiced( [dirName '.wav'], 0 );
|
Dawn@4
|
17
|
Dawn@4
|
18 metricName = '_Formant_Burg';
|
Dawn@4
|
19 metricFileName = [ dirName metricName '.txt'];
|
Dawn@4
|
20 readFormantValueFromFile( statsFileID, metricFileName, metricName, vuv );
|
Dawn@4
|
21
|
Dawn@4
|
22 metricName = '_Formant_all';
|
Dawn@4
|
23 metricFileName = [ dirName metricName '.txt'];
|
Dawn@4
|
24 readFormantValueFromFile( statsFileID, metricFileName, metricName, vuv );
|
Dawn@4
|
25
|
Dawn@4
|
26 metricName = '_Formant_robust';
|
Dawn@4
|
27 metricFileName = [ dirName metricName '.txt'];
|
Dawn@4
|
28 readFormantValueFromFile( statsFileID, metricFileName, metricName, vuv );
|
Dawn@4
|
29
|
Dawn@4
|
30
|
Dawn@4
|
31 fprintf( statsFileID, '\n');
|
Dawn@4
|
32
|
Dawn@4
|
33 |