Formants In Sapphire Documentation

Sridevi V. Sarma
August 25, 1997




1 Pre-Processing

This document describes how to incorporate estimates of F0, F1, F2 and F3 into your sapphire recognizer. You must be running the v3.2 version of sapphire (actually right now- you must be running mine which is a modified version of v3.2 [~sree/sls]). Before simply adding objects in the .rec file, it is necessary (at this time) to do some pre-processing. Please note that all pre-processing MUST be done on a SUN machine. First, you have to create formant files (which are in the spectrum format) for every waveform file. To do this, simply copy to your own directory, modify and run the following script:

/usr/users/sree/bin/waveform_to_formant.cmd
At the top of the script, a list of the options available to the formant function (ESPS) is given (you can also do a 'man' on formant on a SUN machine). For example, if you would like to compute formant files that contain all 4 estimates, using a window size of 20 msec, a frame interval of 5 msec, a rate of 16Khz, and a pre-emphasis of 97%, then you would call the function formant as follows:
/usr/local/entropic/bin/formant -p 0.97 -f 16000 -n 4 -i 0.005 -w .02 foo.fsd
foo.fsd is a temporary output file that will be fed into c-code that converts the file into a spectrum file. All of this is done in the script itself.

2 Incorporating into Recognizer

Once you have formant (spectrum) files for every waveform, you are ready to incorporate the estimates as features in your recognizer. To do so, first add the following input to your espec file:

-formant_file_in foo.fmt ;
Next, add the following to the .rec file:
s_formant_file f
Now, you are ready to create features from the object 'f'. For example,
s_avg_vector pitch_ave \
    -segs segs \
    -boundsorsegstype segs \
    -parent f(0) \
    -starttime start \
    -endtime end

takes the average estimate of F0 over the entire segment. The object 'f' is really a spectrum object, however take caution in executing it with pre-existing spectrum functions.


3 Bugs & Suggestions

Feel free to forward all bugs and suggestions to me (although I am leaving in one month). Afterwards, feel free to bug Jim Glass.