I am performing some large-corpus analyses in Praat and have been extracting formant (F1, F2, F3) values at every 10% interval for my textgrids, but have decided that a much more even-handed measure would be to extract these parameters once every half-second or so in each of my intervals, but I can't seem to figure out how to automate this. I am trying to pull relatively randomized formant samples from my intervals as the corpus is far too large to reasonably annotate each vowel.

Does anyone know how to script this in Praat (specifically just the time-series)? Thanks.

For reference this is how I've been sampling:

    .time [1] = start + 0.1*(end-start)
    .time [2] = start + 0.2*(end-start)
    .time [3] = start + 0.3*(end-start)
    .time [4] = start + 0.4*(end-start)
    .time [5] = midpoint
  • Why 500 msc? I can't think of a language where a segment is so long, so what linguistic unit would the formant values represent?
    – user6726
    Commented Jan 28, 2019 at 19:02
  • The textgrid intervals are breath groups. We could certainly go way shorter than 500msc (this was just an example I was throwing out there), but we are sampling the corpus for overall formant space - whether these are real vowels does not necessarily matter.
    – user23747
    Commented Jan 28, 2019 at 19:07

1 Answer 1


The rest of the script is there: http://praatscriptingtutorial.com/filesExtendedExample

I haven't tested this script and my answer in Praat, so I cannot ensure that it will work.

# We had made a variable intNum, now
# we'll use that as the counter variable
for intNum from 1 to numIntervals

    ###### Get F1 and F2 from midpoint

    selectObject: tg

    #Get its label
    label$ = Get label of interval: tierNum, intNum 

    # If not blank
    if label$ <> ""
        beg = Get starting point: tierNum, intNum
        end = Get end point: tierNum, intNum
                    length = end - beg
                    if length > 0.5
        midPoint = beg + 0.5

        selectObject: formantObj
        # First argument is formant number
        f1 = Get value at time: 1, midPoint, "Hertz", "Linear"
        f2 = Get value at time: 2, midPoint, "Hertz", "Linear"
                    f3 = Get value at time: 3, midPoint, "Hertz", "Linear"

        # Format the values and convert to string, 
        # to make it easier to write to the spreadsheet
        f1$ = fixed$: f1, 0
        f2$ = fixed$: f2, 0
                    f3$ = fixed$: f3, 0

                    beg = midpoint

                   until midpoint >= end



For further information about loops method in Praat: http://www.fon.hum.uva.nl/praat/manual/Scripting_5_4__Loops.html

  • 1
    Thank you for this. I will run this on a subset of my data and let you know if this did what I needed, but based on my reading this might do the trick....thank you for this :D
    – user23747
    Commented Jan 28, 2019 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.