Topics Map > Resources for collaborators

General analysis guide for formant tracking

This is a general explanation of how to analyze formant data

1. Load data

  • In Matlab under Current Folder, Navigate to the data you plan on analyzing by using the ‘browse for folder’ icon
  • smng->experiments -> 'experiment name' ->acoustic data-> 'subject ID' -> 'condition'
  • Double-click on the expt.mat file to load it into your Workspace

2. Check audio for bad trials

  • In the command window, type check_audio
  • When it says ‘Start trial? [1]:’ , click enter
  • It will open a new window which you will use to listen to all trials
  • You are listening for trials in which the subject did not say the correct word (wrong word, coughed, hiccuped, clipped, etc.)
  • Select ‘play all’ (or press ‘a’ on keyboard)
  • If they did not say the correct word, mark the trial as bad by clicking the green box (or by pressing the number next to the replay button on keyboard); It will turn red if you have marked it as bad
  • Select the ‘>>’ on the screen to go onto the next 10 trials (or use the right arrow key on keyboard)
  • Continue until all trials have been checked
  • Click exit (or press ‘e’ on keyboard)
check_audio

3. Initial analysis with ‘audioGUI’

  • In the command window, type audioGUI
  • When it says ‘Start trial? [1]:’ , click enter
  • It will open a new window in which you will begin to adjust the parameters
  • Under "framespec: formants", select ‘72/3.0ms, more narrowband’
  • Adjust other parameters to get a clean formant track
    • ampl threshold (amplitude threshold) -- any time the amplitude of the signal was above this value, there will be formant values tracked. The amplitude of the signal is plotted in the fourth-from-the-top figure labeled "ampl."
    • LPC order -- The Linear Predictive Coding order determines the most likely values for formants. A higher/bigger value, such as 13 or 11, corresponds to a longer vocal tract, meaning the predicted formants are lower -- this is typical for men. A smaller/lower value like 11 or 9 corresponds to a shorter vocal tract, which predicts higher F1/F2 values and is typical for women
    • preemphasis -- This impacts the weighting of high frequencies vs low frequencies in the signal. A positive number will emphasize high frequencies; a negative number will emphasize lower frequencies. This is helpful when you know the LPC order is correct, but the formant track is jumping and you need to nudge it one way or the other. Values between -0.3 and 0.8 are generally good.
  • Go through about 10-20 trials until the formant tracking is near perfect with the previously set parameters
  • Exit GUI by clicking the ‘END’ button
  • Save wave_viewer_params.mat by clicking Overwrite
audioGUI

4. Set all trials to adjusted parameters

  • In the command window, type: waverunner([],[],[],0,{'nlpc', 'ampl_thresh4voicing', 'preemph', 'ms_framespec_form'})
  • If you adjust any other parameters, you will need to add them into the above command
  • It will take a few minutes to apply the parameters to all trials.

5. Check all trials

  • In the command window, type audioGUI([],[],[],[],0)
  • Go through all the trials to make sure the formant track is correct
  • Mark any bad ones as ‘bad,’ or try to fix it. To fix bad formant values, try adjusting the preemphasis but not LPC order. To fix the onset and offset, adjust the amplitude threshold or add user events.
  • To add user events:
    • Adjust the green and red bars to the beginning of the vowel
    • Use the ‘e’ key to expand the view
    • Move the yellow bar to where the vowel starts, and press ‘a’ to add the user event
    • Use the ‘w’ key to widen back to the normal view
    • Follow the same steps to mark the end of the vowel
  • If you find you are having to adjust the parameters often, then you may need to re-analyze and run the new parameters on all the trials.
  • You may be prompted "Do you want to overwrite smng/.../wave_viewer_params.mat?" Only click Overwrite if you plan on running waverunner again on this set of trials. You will almost never be running waverunner again, so by default, you should click Cancel. (For more info, [Link for document 114231 is unavailable at this time].)

6. If your experiment has multiple vowels, repeat steps 3-5 for each vowel. 

 

7.  Final check of all trials

  • Once you have gone through all the trials in audioGUI: in the command window, type check_dataVals
  • This will open a new window which you can use to see if there are any trials with errors
  • Check all the error trials. Click on the type of error you want to check (on left, under error types). The User guide for check_dataVals has a description of each error type and how to address it
  • Use the ‘launch_GUI’ button to either fix the error for each trial (change parameters or add user events) or mark it as a bad trial.
  • Once you have gone through all the error trials in each error type, use the ‘reload_dataVals’ button to make sure all errors have been fixed
  • Check the good trials
    • Click on ‘goodTrials’
    • If you can see any outliers on the plots, select that trail by clicking on it
    • Use ‘launch_GUI’ to check the trial
    • If the formant track is accurate and correct, leave it
    • If it is not, fix it (if possible) or mark it as bad
  • Use ‘reload_dataVals’ one more time to make sure everything has been fixed
  • Exit window when finished
check_dataVals
 

8. Mark your progress on the appropriate sheet

  • When you are done or have to leave the data, go to the Data Analysis Tracking google sheet
  • Select the experiment sheet that you are working on (at the bottom of the page)
  • Fill in the correct cell or cells for the data you have analyzed


Keywords:
general, analysis, formant, formants, tracking, formant tracking, how to, wave runner, check_audio, audioGUI, check_dataVals, model, demo 
Doc ID:
89601
Owned by:
Chris N. in SMNG Lab Manual
Created:
2019-02-08
Updated:
2024-04-05
Sites:
Speech Motor Neuroscience Group