Contents
- 3 Praat basics
- 3.2 Opening, playing, recording, and editing audio files in Praat
- 3.3 Viewing spectrograms, pitch tracks, formants
Introduction
- Praat is a freely available program written by Paul Boersma and David Weenink.
- It is primarily intended for acoustic analysis of speech, but it has some additional functions such as speech synthesis and some constraint-based grammar learners. It can even run some basic perceptual experiments.
- The program is very powerful and has many features, with new ones being added all the time. There are only a few features that a beginning phonetician would need; this tutorial covers them.
Installing Praat
Praat (/ prɑːt /; Dutch: praːt (listen), 'talk') is a free computer software package for speech analysis in phonetics. It was designed, and continues to be developed, by Paul Boersma and David Weenink of the University of Amsterdam. A version of the “smoothed cepstral peak prominence” (ie, CPPS) has recently been implemented in the program Praat. The present study therefore estimated the correspondence between the original CPPS from the program SpeechTool and Praat 's version of the CPPS.
- Go to http://www.fon.hum.uva.nl/praat/ and follow the instructions for your operating system.
- Mac users–drag the Praat.app file into your Applications folder. You may then add a link to the program onto your dock so you can enjoy looking at this icon every day.
- Not enough space on your disk? This is an issue that Chrome OS users sometimes report. (Chrome OS stores everything in the cloud so the machines often have very little physical storage.)
- Try to free up space on your machine. I would start with your browser’s data, which can be huge.
- Chrome OS runs Praat inside a Linux installation, which you might already have. If not, see the instructions here for how to do it.
- My Linux installation of Praat is 25MB, plus another 25 for the no-GUI version (my installation is on Linux Mint, not inside Chrome OS, so your mileage might vary).
Praat basics
The two windows
- When you open Praat, two windows appear: the Objects window and the Picture window. You won’t need the Picture window most of the time, so close it. We’ll come back to it at the end of this tutorial.
- The Objects window starts out empty, but once you open sound files and manipulate them, it will contain sounds, spectrograms, text grids and any other objects that you work with:
- Important: the objects in the Object window are temporary and only exist in Praat’s working memory. If you change the content of an audio file using Praat, it won’t automatically save the changes. If you try quitting without saving the objects, Praat will prompt you to do so.
Opening, playing, recording, and editing audio files in Praat
Opening an existing sound file
- Open Praat, click on “Open”, then “Read from file”. You will see a “Sound” object appear in the window, which you can then “View and Edit”.
- In Mac OS, you can also drag your audio file or files onto the Praat icon. All of the files will then appear as sound objects in the list at once. See if your OS supports drag-and-drop opening of files.
- Depending on the length of the recording, you will see either the waveform with an empty window below it or a waveform above the spectrogram.
Converting stereo to mono
- If you are seeing two waveforms, your file is in stereo (was recorded with two microphones):
The two lines of black squiggles labeled “Channel 1” and “Channel 2” are your two stereo channels.
Here, we extracted just one channel (the top one, recorded with the “left” microphone). Now we have a mono sound.
- For speech analysis, you do not need stereo, since the vast majority of humans have only one mouth.
- To get a mono file, you can extract one of the audio channels, like this:
- Return to the Objects window.
- Select the stereo Sound object.
- Click on “Convert”.
- Select “Extract one channel”. Unless the two channels are really different from each other, you can just accept the default, “1/left” channel.
- The new object will have the same name as the old but with “_ch1” appended at the end. Don’t forget to save it if you want to use it again.
Recording an audio file right into Praat
- You can record right into Praat, as long as your computer has a built-in microphone. Most likely the recording will not be of awesome quality, but it’s fine for practicing with the program.
- To record a sound, click on “New>Record Mono Sound”, and hit “Record” in the window that opens. You can accept all the defaults in that window.
- One tip about recording: if you are using your laptop, you might not know exactly where the microphone is on it. I have no idea where the mic is on my laptop, actually. I just leaned in and talked close to the laptop. Here is the resulting recording of me saying a sentence in Russian, [napʲisənə lʲdotʲexnʲikə pʲatʲ ras] “The word ‘ice technology’ is written five times.”
A waveform and spectrogram of a sentence I recorded straight into my MacBook Air using Praat.
Recording: a note about clipping
- When you record audio for speech analysis, you want the signal to be as loud as possible without exceeding the range of your microphone’s sensitivity.
- Look at the black number in the upper left-hand corner of the screen, next to the waveform. Your recording should get as close to 1 as possible, but the waveform should not protrude above it. If the amplitude of the recording exceeds the range of the microphone, you get clipping.
- A clipped recording is missing parts of the signal, and it sounds awful. Avoid.
- Here is what clipping looks and sounds like. I had to pretty much yell at my laptop to get this to happen, so you’ve been warned. Your Praat recording widget has a meter display that stays green while you’re in good range and turns red when you are in the clipping range.
The last “clipping” is clipped. See how the waveform extends outside the waveform window?
https://www.gouskova.com/wp-content/uploads/2016/09/clipping.wavPlaying audio
- Once you have a Sound object, you could just hit “Play”. Usually, we want to play only portions of a file, sometimes repeatedly as we try to transcribe or determine the boundaries of a segment.
- To play portions of a file, click on “View & Edit”, and make a selection with your mouse.
- The playback options are in the “View” menu. Yep. I actually had to look for this just now because I usually play back the selection using the Tab key. Tab will also stop playback. Shift+Tab plays the visible window.
- For Mac users: I’ve used a Mac for over a decade now but I still cannot keep track of the little symbols that apps use for keys. Here is a reference.
Editing a file
- There are many things you can do to edit a file. Perhaps the most basic function, and one that you might find useful long after this class ends, is to cut out parts of a file.
- First, open the Sound object of your file in the View & Edit window.
- Make a selection you want to keep, using the mouse.
- If you want to make a really neat cut, you can “Move start of selection to nearest zero crossing”–this is an option at the bottom of the “Select” menu. Then do the same for the end of the selection. What this will do is adjust the selection so that it starts and ends with a silence (zero amplitude).
- Then click on “File”, and you have several options here.
- You can put the selected sound into its own sound object, if you want to keep doing things to it (“Extract selected sound”, either preserving the time markings from the original file or resetting them to zero seconds).
- You can also save the file to disk. There is a range of options, but a .WAV extension is the basic one.
- The options above do not alter the original file or the Sound object in Praat’s memory.
- If you want to modify the Sound object or the file, you can cut a portion of it out–useful if you have a long period of silence, or if you want to make someone say “got” instead of “Scott” or whatever. This is done via “Edit>Cut”.
- Once you cut a portion out, it is placed on your clipboard (computer’s working memory); if you then save the Sound object to the original file again, the file will be permanently altered. If you do not want that, save it under a new name instead.
- You’ll see other options in the menus, which are more or less self-explanatory. Feel free to play around with them, and remember that nothing is permanent until you save to disk.
Viewing spectrograms, pitch tracks, formants
- Praat can only display spectrograms for relatively small chunks of audio, so if you want to see a spectrogram for a word, zoom in on it.
- You can select a part of the recording with the mouse, and then use the View menu to zoom to that selection. The View menu is fairly self-explanatory.
- There are keyboard shortcut hints in the View menu and many other places in Praat! Use them. I use Cmd+N to view the selections on Mac OS.
- Here is a waveform and a spectrogram of a female Russian speaker (not me) saying [napʲisənə lʲdotʲexnʲikə pʲatʲ ras] “The word “ice technology” is written five times.” This sentence is a bit over 2 seconds long.
A waveform and a spectrogram of a 2-second Russian sentence.
Making a spectrogram look good
- If you are working with a fresh install of Praat, your spectrograms most likely will look a lot more gray than the ones you see above. This is because the dynamic range is set very high in Praat by default–at 70 db. You want something like 30-50 for a recording that has some background noise.
- The obligatory metaphor: Dynamic range refers to how low the cut-off is for the volume of frequencies that the spectrogram visualizes. The lower the number, the less you see. Think of it as taking pond water out of a bucket. The deeper you dip, the more muck you’ll scoop up. If your pond (=recording) is very clean, then you can dip pretty low (i.e., have a high number dynamic range). If your pond is mucky and dirty, then you better skim from the top (i.e., have a low number in your dynamic range).
- Of course, just because you are skimming from the top doesn’t mean you have clean water. Here is what the laptop audio I recorded looks like with the defaults. You can clearly see two bands of air conditioner noise, the lower of which is around 2400 Hz. This kind of noise really interferes with acoustic analysis of speech:
The same recording of me saying that “ice technology” sentence, with a default dynamic range of 70 db. The two bands of noise are from the air conditioner in the background.
- To set the dynamic range, click on “Spectrum>Spectrogram settings”. Change it in 5 db increments until it looks good.
- You can also change how high the frequencies go in the spectrogram display. The default is 0-5000 Hz. You can expand it quite a bit–some fricatives have noise at frequencies above 12000 Hz.
Viewing pitch tracks, intensity, and formants
- Pitch.
- This is pretty simple. While you have the Sound object open, click on “Pitch>Show pitch”. You will see a curvy blue line appear in the spectrogram window.
- In Pitch Settings, click on “drawing method” and select “speckles”. I think it looks better than Praat’s default, “automatic”.
- Intensity.
- Click on “Intensity>Show intensity”. A yellow line will appear in the spectrogram window.
- Formants.
- Praat can also show you formants, and you can probably figure out the procedure for those on your own.
- There is one thing you will have to change in the Formant settings depending on whether you are looking at a male or female voice: the maximum formant should be set for 5500 Hz for female speakers, and 5000 Hz for male ones.
- These formant dots are estimated by Praat; you cannot always trust them.
- Pulses.
- This method visualizes glottal pulses that show up in voicing. If you turn “view pulses” on, you’ll see vertical blue lines wherever Praat thinks the glottal pulses occur.
- Here is the Russian word [bʲitonəmʲiʂalkə] ‘concrete mixer’ with the pitch track, intensity, formants, and pulses turned on. You would rarely need to see all of these things at once, this is just for demonstration.
Pitch track: blue line, intensity: yellow line/green numbers, formants: red dots, glottal pulses: blue vertical lines in the waveform window.
Annotating an audio file with TextGrids
- A TextGrid object allows you to mark certain periods or time points in a sound file.
- You can have several tiers in a TextGrid: one to mark word boundaries, another to mark consonants, vowels, whatever you want.
- You can type into the TextGrid using IPA fonts. See this page for more information on how to set up your computer so that you can do this painlessly and quickly.
- Praat distinguishes between “point tiers” and interval tiers.
- To create a TextGrid, start from the Objects window. Select your sound object and click on the “Annotate” button to the right.
- You’ll see this window. Why the program suggests “Mary John bell” as the default tier names is a mystery to me.
- You can either name all your tiers at once, as shown here, or name the first one and add more later.
- I named my three tiers “word, segments, vowels”–you see them in the screenshot below.
- Now comes one of the Praat gotchas: “View & edit with sound” is highlighted, and you would think that this would allow you to view your sound file and edit the TextGrid at the same time, but no. Clicking on that button just tells you that in order to do what you want to do, you have to select both the sound and the TextGrid in the objects window and click on the “View & Edit” button.
- You can select the TextGrid and Sound objects with the mouse or with your keyboard keys. On a Mac, Shift + arrow (up, down) will let you select two adjacent objects in the window.
- If you have more than one object in the list, make sure you select the TextGrid that goes with your sound file!
- Once you are in TextGrid edit mode, you can add text on tiers, copy interval boundaries from one tier to another, and navigate between tiers and between intervals using either the mouse or just your keyboard–make sure to poke around the “Select”, “Interval”, and “Boundary” menus to see all the options.
A TextGrid with three interval tiers, labeled in the International Phonetic Alphabet. Total war: warhammer ii - the warden & the paunch for mac.
- Make sure you save your TextGrid when you are done. By default, the TextGrid will be given the same name as your sound file, and the extension is .TextGrid.
- Advanced note for the computationally curious: open a TextGrid in a text editor such as TextWrangler, and you’ll see that it’s just a Unicode text file with detailed information about the time points when a tier begins and ends, and its label and type. It looks like this:
That Picture window
- Finally, we get to the mysterious Picture window. The point of the Picture window is to make professional, publication-quality images from your spectrograms, waveforms, and whatever other aspect of speech that you use Praat to visualize.
- Whenever you see a “Draw” or “Paint” option associated with an object, it refers to the Picture window.
- For example, open a sound file and click on the Spectrum menu–you’ll see “Paint visible spectrogram” as an option. The same “paint” option is available for intensity, pitch, formants, and other views.
- To make a spectrogram picture with a pitch track overlaid on top, I “painted the visible spectrogram” and then “painted the visible pitch” while unchecking the “erase first” box. This superimposes the pitch track on top of the spectrogram picture.
- Poke around the menus, check out the options, and see what “Garnish” does.
A nice picture of the word [bʲitonəmʲiʂalkə], with a speckled pitch track superimposed in black.
Beyond basics
- To get a sense of the full power of this program, you can just look at the various collections of Praat scripts that people have made available.
- Praat uses its own scripting language, which is based on the commands in the program’s menus.
- You can automate a lot of tasks:
- Record a word list, cut it up into smaller files at silences automatically and label all the smaller files from a text file you specify.
- Normalize the intensity of a bunch of different audio files, so they all sound approximately equally loud
- If you have to label a lot of audio files, you can automate opening and TextGrid creation.
- You can also automate the collection of durations, intensities/pitch at various time points, Praat-estimated formant values, and so on.
- To get a sense of all the options, do a web search for “Praat scripts”. I really like Mietta Lennes’ page, but there are many others, such as this Google Sites archive.
- There is also the actual Praat Help, which you can search.
Using Praat to find vowel formants
The assignment is to use the Praat computer program to measure F1 and F2 for three tokens of several English vowels. You should hand in:
- your written records of each measurement. (This is referred to below as your 'lab book', since in the real world, you'd be doing this in an official-type lab book where all of your measurements go. For this assignment, a sheet of looseleaf is fine.)
- the recordings you used for your measurements (on a diskette or CD)
- a graph of the vowels, plotting F1 by F2
Installing Praat
Download Praat from Paul Boersma's website at www.praat.org. Follow the instructions there.
Choose your words
Record three words for each of the following vowels. One word should use the [h__d] frame, the second the [b__t] frame (except for [ʊ]), and the third can be any word of your own choosing.
[h__d] | [b__t] | Your choice: |
[i] | heed | beat |
[ɪ] | hid | bit |
[e] | hayed | bait |
[ɛ] | head | bet |
[æ] | had | bat |
[ɑ] | hawed/hod | bought |
[o] | hoed | boat |
[ʊ] | hood | book |
[u] | who'd | boot |
[ʌ] | Hudd | but |
In choosing your own words, avoid:
- neighbouring consonants that are nasal
- velars or [l] as the following consonant
Recording the sound
Start the Praat program. You'll see three windows: a title window that disappears right away, the main 'objects' window (where most of the work gets done), and a 'picture' window for drawing fancy printable diagrams. You don't need the picture window, so close it.
Make sure you have a microphone hooked up to your computer. From the main window, choose 'New' from the window, then 'Record mono sound'.
This will open up a new 'SoundRecorder' window. Click the 'Record' button when you're ready to start speaking. While you're speaking, you should see some green bouncing up and down in the vertical white 'Meter' stripe (otherwise your computer isn't getting any sound from your microphone). Speak the list of words. Use a natural speech rate and style -- not too fast, not too slow, not artificially careful. Don't worry if you make a mistake -- just repeat the word and you can skip over the error when you're doing the measurements.
Download Pratt
When you've finished speaking, click the 'Stop' button. Click 'Play' and listen to the results to make sure they're OK. Then click the 'Save to list' button near the bottom. This sends the newly recorded recording off to the list of objects in Praat's main window (where you should now see 'Sound sound' in the list).
Saving the sound file
Save the recording to a sound file by the choosing the 'Write' menu, then 'Write to WAV file..'
Praat Program Guide
Name the file after yourself (e.g., 'JohnSmith.wav') and hand it in on a diskette or a CD with the rest of your assignment.
Navigating around the sound editor
Click the 'Edit' button in the main Praat window. This will open a new sound-editor window -- you won't be editting the sound, but the window shows you a lot stuff conveniently in one place.
The scrollbar at the bottom lets you move the part of the spectrogram that is visible forward and backward in time.
Clicking on one of the three grey horizontal bars near the bottom will play the sound -- the bottom bar plays the entire sound, the middle bar just the part of the sound whose spectrogram is in the window right now, and the top bar various subparts of the visible sound.
The four buttons in the lower left let you zoom the spectrogram in and out to cover shorter and longer periods of time. (The 'in' and 'out' buttons are self-explanatory. The 'sel' button will zoom in on the selected part of the spectrogram, which you select by clicking and dragging on the spectrogram.)
From the 'Formants' menu at the top, make sure that the 'Show formants' item has a check-mark:
(While you're at it, you might as well go to the 'Pitch', 'Intensity', and 'Pulses' menus and make sure that 'Show pitch', 'Show intensity', and 'Show pulses' don't have check-marks. You don't want too many irrelevant coloured lines cluttering up the spectrogram.)
By clicking and dragging horizontally on the spectrogram or the waveform, you can select a stretch of time, which will then be highlighted in pink.
You can then zoom in on this selection with the 'sel' button in the lower left, or you can listen to just that stretch of time by clicking that part of the uppermost of the three sound-playing bars at the bottom. It's a good idea to listen to each vowel like this before you measure any formants, just to make sure you're really measuring the vowel you think you are.
Measuring formants
When you're sure you've got the vowel you want, click on the point of time within the vowel where you want to measure the formants. The time you chose will be indicated by a vertical dotted red line. Write down the time shown at the top of the red line. (In the diagram below, the time is '0.509880'. It's okay to round this to three decimal places, so you could write '.510'.)
Now you're ready to find out the formants. Press the F1 key on the keyboard, and the frequency for F1 will pop up in a dialogue box:
Download Praat For Windows
Write down the frequency to the nearest Hertz. (Here, you'd write down '260'.) Repeat for F2 with the F2 key.
Your complete record for the vowel should have:
- the vowel's IPA symbol
- the word it's in (in English spelling)
- the time you recorded the formants at
- the frequency of F1, and
- the frequency of F2
For example, the line in your lab book for the above vowel would look like:
Repeat for all the vowels.
On choosing when to measure formants
Usually you'll want to pick a time that's close to the centre of the vowel. Avoid the very beginning and the very end, since the formant frequencies there will be heavily influenced by the neighbouring consonant.
Try to pick a spot where the formants seem to be stable and flat for a while.
For vowels that are likely to be diphthongs in your speech (especially [e], [o], and even [u]), you want to measure the starting point of the diphthong, not the ending point. Choose a spot closer to the beginning of the vowel, but not so close that the preceding consonant will interfere.
If the computer's guesses are obviously wrong
If the computer's guesses about the formants (the red tracks on the spectrogram) are jumping all over the place during a vowel, you may need to check your microphone and try doing the recording again. This is especially true if:
- the recording conditions were bad, for example, lots of background noise
- the spectrogram looks faint (which probably means the microphone wasn't picking up enough sound)
- you were speaking with an abnormal voice quality, such as too much creakiness
Sometimes if two formants are very close together (as F1 and F2 likely to be for back vowels), the computer will think it's just one big formant and only give you one track. If this happens, you'll have to tell Praat to look harder for more formants. Choose the 'Formant' menu item, then 'Formant settings..' You'll get the following dialogue box:
Increase the 'Number of formants' entry from 5 to 6 -- or even 7 if 6 doesn't work. (Record in your lab book any time you have to do this.)
Occasionally you'll get the opposite problem, where the computer is hallucinating a formant where you know there shouldn't be one. You can use the same dialogue box to tell Praat to look for fewer formants (4 instead of 5). Or else you can just ignore the extra formant and, for example, ask Praat for F3 and record it as F2. Again, make a note in your lab book any time you have to do this.
Graph the results
Create a graph of the results. Use F1 as the vertical axis (high F1 at the bottom, low at the top) and F2 as the horizontal axis (high F2 to the left, low F2 to the right), so that the graph will more closely resemble a traditional vowel chart.
For each vowel token, place the IPA symbol at the appropriate place given its F1 and F2. Draw an oval around the three [i] points, and the same for all the other vowels. Some of your ovals may overlap -- this is normal.
[COMING SOON: an example graph -- once I draw one and get to campus to scan it in.]