· Back to homepage ·


Bert Remijsen's Praat scripts

Below I have listed a number of Praat scripts which I am using regularly in the acoustic analysis of prosodic contrasts. The function of these scripts is either to automate measurements, or to facilitate 'by hand' measurements, as appropriate. I have posted several of these previously on the online forum for Praat users. These scripts are freely available to anyone who can use them, as is or, more likely, after modification. Please acknowledge where appropriate.

I have included some input to illustrate the working of each script. The scripts themselves are plain ascii; sound materials and Praat objects have been zipped using Winzip. I am using these scripts on a pc, running the Windows XP operating system. It is possible that some scripts need to be modified slightly so as to work correctly on other operating systems.

This Powerpoint presentation provides some background information relating to acoustic measurements relating to prosody using Praat. I used it in a lecture on this topic at the Experimental Prosody Research workshop (Leipzig, 7-9 October 2004).



1. Script to extract duration measurements

Script:
msr_duration.psc (pc)
msr_duration_lx.psc (linux, unix)

Input (example):
- testlist1.txt
- testdata1.zip
Description:
This script extracts the duration of a segment labeled "n" (for nucleus) from a TextGrid object and writes it to a textfile, together with the filename. This operation is carried on each item in a list files (batch processing). The script is full of comments, to make it suitable as a first acquaintance with Praat scripting.


2. Script to open files

Script:
openlist.psc

Input (example):
- testlist1.txt
- testdata1.zip
Description:
This script opens selected objects associated with items in a list.


3. Script to open files, with pattern matching

Script:
openlist_specificitem.psc

Input (example):
- testlist1.txt
- testdata1.zip
Description:
This script searches on the code of the item, which is the third field in the name, and consists of either two or three characters, starting from the 6th character. If the third field matches the required item (as specified in form window) then the selected items are read into the Object window.


4. Script to measure & check formants (based on intervaltier)

Script:
msr&check_f1f2_indiv_interv.psc

Input (examples):
- testdata1.zip

NB Here is an otherwise identical script, that does batch processing. The F1 and F2 values are written to file:
- msr&check_f1f2_batch_interv.psc [updated 13/12/2011]
Description:
This script calculates F1 and F2 at the midpoint of a specific segment in a TextGrid file. The procedure is repeated made for each occurrence of that segment in the TextGrid. The label needs to be specified by the user. F1 and F2 are calculated using 'To formant (burg)' and and the tracker. Both of these algorithms set parameters as a function of speaker sex. This parameter is controlled by the user. The Picture window shows the spectrogram and formant tracks (F1 & F2), and The rounded F1 and F2 values appear at the top.
As a additional check, and for voice quality measurements, the script displays the spectrum, the Long-term average spectrum (Ltas) and the LPC spectrum at the bottom. The LPC spectrum at the bottom uses the 'autocorrelation' algorithm, which is differen from the 'burg' algorithm by means of which the values at the top are computed.
When the 'To formant' and 'Track...' procedures do not produce plausible formant values, the user can (1) run the script again with new tracking values, (2) on the basis of the spectrum/Ltas/LPC display at the bottom part of the Picture window, determine F1 and F2 by hand using the Spectrum/Ltas/LPC in the Object window.


5. Script to measure & check formants (based on pointtier)

Script:
msr&check_f1f2_indiv_point.psc

Input (examples):
- testdata1.zip
Description:
Similar to previous script, but uses a pointtier rather than an intervaltier to determine the location of the measurement. As such it is more suitable for the analysis of diphthongs.


6. Script to measure & check formants and voice quality measures (based on intervaltier)

Script:
msr&check_spectr_indiv_interv.psc

Input (examples):
- testdata1.zip
Description:
This is an extension of msr&check_f1f2_indiv_interv.psc. The script additionally puts in markers at H1, H2, A1, A2, A3, and writes the values for H1-H2, H1-A1/2/3 to the Info window.


7. Calculate & check f0 tracks

Script:
lst2f0&check.psc

Input (example):
- testlist2.txt
- testdata2.zip
Description:
This script carries out all the repetitive actions involved in the checking of F0 tracks. The scripts calculates the Pitch object, plots it in the Picture window, gives time to check and fix if need be, and then writes the (fixed) Pitch object to a file. Batch processing using file list.


8. Automatic detection of f0 turning points using MOMEL

Script:
momel_modif.psc

Input (example):
- sound1.wav
Description:
The MOMEL (Hirst & Espesser) Algorithm produces turning points of f0 tracks on the basis of mathematically modelled (quadratic spline function) approximation of the contour. Guillaume Roland wrote a Praat implementation. See here for details. I have modified his Praat implementation, so that it gives the turning points in a TextGrid and in PitchTier object.


9. Producing time-normalized f0 tracks

Script:
pp_show_series10.psc

Input (example):
- testlist3.txt
- testdata3.zip
Description:
This is a script to produce time-normalized f0 tracks - i.e., with a fixed number of measurements within each segment. Such a script is necessarily highly specific to the dataset. The script given here can therefore only serve as an illustration of how to write such a script, rather than it would be directly applicable. In its present form, the script handles a target word consisting of four segments. The script measures f0 at eight equidistant points in each of these segments, and writes the values to a text file. The script takes voicing at the edges into consideration. That is, if voicing sets in late in to the initial segment, the first of the eight measurement points will be located at the onset of voicing, rather than at the starting point of the interval marking off the initial segment. The f0 tracks should be checked beforehand (e.g. using lst2f0&check.psc).






bert@ling.ed.ac.uk
Last change: December 13, 2011