This script enables a vowel chart to be plotted for a given speaker. It works with both diphthongs and monophthongs.
It is a Python re-implementation of Listen Lab's make_vowel_space. Functional changes:
- Updated to allow processing of IPA symbols.
- Removed the latin abbreviation to IPA conversion in order to make it applicable to a wider range of applications.
- Added the functionality to batch process files.
- Made the script more robust to Praat output issues.
- Consistent graph scaling to allow comparison across speakers / studies.
An example use case is given below. Comparing the two images, you can very quickly tell that most of my Italian vowels are very roughly in the right place but my u
vowel is out of place and my e
vowel has a bit of a glide to it. Note for those comparing their own vowels: the exact frequencies vary depending on the individual speaker's voice and cultural background (interesting video here). Therefore, you should be comparing the relative shape of the chart instead of the exact frequencies.
Click on the image below to view a step-by-step Youtube tutorial. Alternatively, scroll further down this readme for a written guide.
The following instructions assume that you have Praat installed and that you have basic familiarity with it. If not, there are plenty of tutorials that you can read / watch.
-
Download this repository and extract it.
-
Open a terminal / command window in the folder where your extracted the files. Type the following to install the required python modules:
pip install -r requirements.txt
-
Import your recording or record directly into Praat.
-
Within Praat, create a TextGrid and label each of the vowels with a note of your choosing in a single tier. This label could be an IPA symbol, lexical set word or any other unique label that you like. If you are unsure of how to do this, the tutorial for the original script is a good place to start.
- This is an example of what a labelled vowel in the text grid should look like.
- While in here, you should check that Praat is highlighting your formants correctly. It's likely that you will have to update the settings.
- For my own (male) voice, I have mostly been using 4200 Hz, 4 formants and a 0.04s window for my formant settings.
- My formants for
o
are very close in value and Praat can struggle to separate them. Increasing formants to 5 can fix it at the cost of messing up the higher order formants. Since we only need F1 and F2, that's not an issue for this script. - If you are struggling to get good formant tracking, this video is a good reference.
-
In the main Praat window, create a formant object from the sound file.
- Click on the sound item, "Analyse Spectrum" then "To Formant (burg)". Image for reference
- Enter the formant settings that you used in the previous step into the window that appears. Hit OK.
- Rename the new formant object to match the name of your TextGrid.
-
Within Praat, run the
Extract_formants.praat
script (this is one of the files that was included in the zip file that you extracted earlier). Make sure to update the following line (that is near the top of the script) to match the name of your TextGrid and Formant objects, making sure to keep the quotation marks:name$ = "name_of_your_object"
-
Save the generated formant table as a
csv
(comma separated values) file within thedata
subfolder of this repository. -
Update the paths and settings at the top of
build_plots.py
using a text editor. If you find that parts of your graph are cut off, you will need to tweak the axis scaling variablesX_SCALE
(representing formant 2) andY_SCALE
(representing formant 1). -
Go back to the terminal / command window that you opened in step 2 (or open a new one in the folder where you extracted the files). Run the python script using:
python build_plots.py
-
A
.png
file will be generated within thedata
subfolder. If the chart looks messy, it's very likely that your formant settings are incorrect in Praat or that the TextGrid boundaries need tweaking. Go back to Step 3 and try again!
If you have a set of formant frequencies, you can generate a plot without the use of Praat.
- Open examples/build_formant_table_from_numbers.xlsx
- Update the frequencies on the sheet
vowel_data
. - If you don't have a variance from your dataset, just set this to 50. The purpose is to make sure that there is a visible line since the script plots with markers disabled.
- F3 isn't used by the script. It is just included for compatibility with the original
Extract_formants.praat
. - Check the sheet
csv_output
doesn't have any obvious errors and export it to.csv
with a name of your choice. You can then follow the basic instructions from step 5.