Week 4: Consonants in the spectrogram

Dr. Fernanda Barrientos

November 22, 2022

1 Plosives

Let’s recall that a plosive is a consonant made by a momentary closure of the articulators (e.g. lips, or the tongue against the palate),followed by a sudden release of the air. We can look at a plosive in the spectrogram and analyze them in different ways:

2 Nasals

Nasals are easy to identify as there is an abrupt change in the spectrogram: you will be able to see one formant at a low frequency (say, 250 Hz), and an empty spot above it, with no energy. A second formant can be seen, though rather faint, at about 2000 Hz. Similar to plosives, you can tell the place of articulation of a nasal by looking at the following vowel: its formants will lower if a bilabial nasal comes, or will show the velar pinch if it’s a velar nasal. The image below shows how nasals [m], [ɲ], and [n] in the word mañana look in the spectrogram.

Fig. 3: Nasals [m], [ɲ], and [n] in the Spanish word mañana.

3 Fricatives

Fricatives look like little black clouds of aperiodic energy. They can be distinguished in two ways:

4 Taps and trills

Taps look essentially like a voiced plosive (i.e. a dark vertical bar), although the bar is crossed by formants. Trills, on the other hand, are easy to observe since they show a sequence of 3 little vertical bars, one followed by the other.

Fig. 5: A tap (left) and a trill, in Spanish words pero (left) and perro.

5 Approximants

Approximants are wery vowel-like sounds, both articulatorily and acoustically. We will distinguish between laterals, English [r], and glides.

6 Measuring consonants

6.1 Exercise 1: VOT (and time dimension in general)

First, download the sound tigermouse2.wav from this link and its corresponding TextGrid from this other link here and open them with Praat (you can do this manually, since it's just two files).

Let's inspect these files. Select both files together and go to View and Edit. You should see something like this:

Fig. 9: When you select both a Sound and a TextGrid object together, you can see and edit the TextGrid.

This TextGrid has three tiers: the first is called words, the second phone, and the third VOT. This sentence has only three plosives: the /t/ and /g/ in tiger, and the /t/ in to. However, and upon closer inspection of the Textgrid, the /g/ does not have an explosion bar, which suggests that this was actually produced as a fricative sound.

Now we measure both VOTs with the following script:

selectObject: "Sound tigermouse2"
plusObject: "TextGrid tigermouse2"
appendInfoLine: "sound", tab$, "start", tab$, "end", tab$,"VOT"
Extract intervals where: 3, "yes", "starts with", "VOT"
n = numberOfSelected ("Sound")
for i to n
    sound [i] = selected ("Sound", i)
endfor
for i to n
        selectObject: sound [i]
        start= Get start time
        end= Get end time
        vot = Get total duration
appendInfoLine: i, tab$, start, tab$, end, tab$, vot
endfor

Note that lines 1 and 2 are selecting two elements together: Sound tigermouse2 and TextGrid tigermouse2. We are doing this because we will extract parts from the Sound tigermouse2 by taking the time stamps on the TextGrid as reference points.

The third line is an appendInfoLine that prints the column names of a table that the script will start filling up as we go through the for loop at the end. The column names are Sound, start, end, and VOT. They are separated by a tab, which can be scripted as a string variable: tab$.

Line 4 performs the extraction: it will take all the intervals marked on Tier 3 of the TextGrid with the label VOT. This will create a bunch of Sound objects, which will be queried along the time dimension (i.e. we will only look at durations; we won't be measuring formant values or anything else).

Now note that we have two for loops. Since the Extract intervals function finishes with all the extracted sounds selected at once (you may just run the first 4 lines of the script to see what I mean), we will take advantage of that and we will run a for loop that gives the selected sounds a name, i.e. Sound [1] and Sound [2]. After that, we run a second for loop that iterates through the selected sounds.

Measuring along the time dimension is rather simple: we mostly use the functions Get start time, Get end time, and Get total duration, which take no arguments. After the query, we add an info line with the sound name and the start, end, and total duration. Since this action is inside the loop, it will repeat for each one of the sounds in the vector.

6.2 Exercise 2: Formants in consonants

Let’s try this script:

selectObject: "Sound tigermouse2"
plusObject: "TextGrid tigermouse2"
appendInfoLine: "sound", tab$, "F1", tab$, "F2", tab$,"F3"
Extract intervals where: 2, "yes", "matches (regex)", "n|l|m"
n = numberOfSelected ("Sound")
for i to n
    sound [i] = selected ("Sound", i)
endfor
for i to n
    selectObject: sound [i]
    form= To Formant (burg): 0, 5, 5500, 0.025, 50
    f1mean= Get mean: 1, 0, 0, "hertz"
    f2mean= Get mean: 2, 0, 0, "hertz"
    f3mean= Get mean: 3, 0, 0, "hertz"
    appendInfoLine: i, tab$, f1mean, tab$, f2mean, tab$, f3mean
endfor

This script gives you the formant values of laterals and nasals, which are stable throughout time; hence measuring the mean values is ok.

Now look at the script. The Extract intervals where line is now set to the ”matches (regex)” option. This allows you to make searches based on string patterns using regular expressions. A regular expression is a sequence of characters that specifies a search patterns. For instance, you can use a regex to find through a text something like: "all the words that start with a C and end with a D". These are common to many computer languages, so for those of you who are familiar with other programming languages, you can check the Praat manual and notice that most of them will ring a bell. In Praat, the pipe bar stands for ”or”. So basically, here we are telling the script to look for TextGrid intervals on the tier number 2 that are labeled as [n] OR [l] OR [m]. Apart from this, the structure of this script up to line 7 is very similar to the one above.

Now let's look into the second for loop. Line 8 creates a Formant object, just like the one we used in the previous week for measuring vowels. After that, lines 9 to 11 query the Formant object: since F3 is also important when analyzing nasals and laterals, we have three lines of code getting the values for F1, F2, and F3. Finally, line 12 collects the information.

6.3 Exercise 3: COG

Now this script is a bit more complicated as it does various things:

selectObject: "Sound tigermouse2"
 plusObject: "TextGrid tigermouse2"
 appendInfoLine: "sound", tab$, "intensity", tab$, "COG", tab$,"dispersion"
 Extract intervals where: 2, "yes", "matches (regex)", "^f|^s"
 n = numberOfSelected ("Sound")
for i to n
    sound [i] = selected ("Sound", i)
endfor
for i to n
    selectObject: sound [i]
    int = Get intensity (dB)
    Multiply by window... Gaussian1
    To Spectrum: "no"
    Cepstral smoothing: 200
    cog = Get centre of gravity: 2
    std = Get standard deviation: 2
    appendInfoLine: i,tab$, int,tab$,cog, tab$, std
 endfor

Now let’s pay attention once more to the Extract intervals where line. It has a little caret before [f] and [s]. The caret stands for ”beginning of string”. So the search will not take into account any TextGrid intervals where there might be an f or an s that are NOT at the very beginning of the string (can you guess why this is necessary? Remove the carets and see what happens).

PRO TIP: You can use regular expressions in Praat (but beware the backslash)

#I want to extract intervals with vowels i and \ic (the second stands for the high, front, lax, unrounded vowel).
Extract intervals where: 2, "yes", "matches (regex)", "i|\\ic"

7 Homework

Download the .zip file tigermouse3 from this link. Unzip it and open the files with Praat (they are a Sound and a TextGrid). Now modify today's first script so that you know which sound from which word you're getting the data from (as you might have already noticed, the script only gives you a number for the sound column). Here are some hints:

Once you're done, create a pdf with the script and the table that you created (remember that you can save the output of the Info window by going to the Menu on that window and go to File > Save as... and save as .csv file.