Find regions with F0


AndyWedel
 

I'm looking for an example of a script that can go through a wav file and identify all regions above some duration threshold that have pitch, and create intervals in a texgrid for these regions. For example if I have a wav file with 'tatata' and a textgrid, a script that can find the regions with pitch from each 'a' and add corresponding intervals to the textgrid with some label. Apologies if this is obvious - I've searched online and not found something that does this, and I'm new to praatscripting. 


Daniel McCloy
 


-------- Original Message --------
On Mar 14, 2023, 19:17, AndyWedel < wedel@...> wrote:

I'm looking for an example of a script that can go through a wav file and identify all regions above some duration threshold that have pitch, and create intervals in a texgrid for these regions. For example if I have a wav file with 'tatata' and a textgrid, a script that can find the regions with pitch from each 'a' and add corresponding intervals to the textgrid with some label. Apologies if this is obvious - I've searched online and not found something that does this, and I'm new to praatscripting. 


Daniel McCloy
 

Actually never mind, I realize that's different than what you're asking for. I thought there was a "Sound: To TextGrid (Voicing)" or similar that annotated periods where a pitch was detected but now I can't find that command (at least not searching online via phone... You may have better luck searching the Praat manual directly).

-------- Original Message --------
On Mar 14, 2023, 20:53, Daniel McCloy via groups.io < dan@...> wrote:

There's a built in command that might work for you:

https://www.fon.hum.uva.nl/praat/manual/Sound__To_TextGrid__voice_activity____.html

-------- Original Message --------
On Mar 14, 2023, 19:17, AndyWedel < wedel@...> wrote:

I'm looking for an example of a script that can go through a wav file and identify all regions above some duration threshold that have pitch, and create intervals in a texgrid for these regions. For example if I have a wav file with 'tatata' and a textgrid, a script that can find the regions with pitch from each 'a' and add corresponding intervals to the textgrid with some label. Apologies if this is obvious - I've searched online and not found something that does this, and I'm new to praatscripting. 


Philip Spaelti
 

With the sound selected look in “Annotate -.”

---------------------------------------------------
Philip Spaelti
Kobe Shoin Women's University, Graduate school
---------------------------------------------------

On Mar 15, 2023, at 11:03, Daniel McCloy via groups.io <dan@...> wrote:

Actually never mind, I realize that's different than what you're asking for. I thought there was a "Sound: To TextGrid (Voicing)" or similar that annotated periods where a pitch was detected but now I can't find that command (at least not searching online via phone... You may have better luck searching the Praat manual directly).
-------- Original Message --------
On Mar 14, 2023, 20:53, Daniel McCloy via groups.io < dan@...> wrote:

There's a built in command that might work for you:

https://www.fon.hum.uva.nl/praat/manual/Sound__To_TextGrid__voice_activity____.html

-------- Original Message --------
On Mar 14, 2023, 19:17, AndyWedel < wedel@...> wrote:

I'm looking for an example of a script that can go through a wav file and identify all regions above some duration threshold that have pitch, and create intervals in a texgrid for these regions. For example if I have a wav file with 'tatata' and a textgrid, a script that can find the regions with pitch from each 'a' and add corresponding intervals to the textgrid with some label. Apologies if this is obvious - I've searched online and not found something that does this, and I'm new to praatscripting. 


Matt Winn
 

The command that Dan was alluding to is available indirectly after you create a PointProcess object. 
For example, select the sound, then click Analyse periodicity -> To PointProcess (periodic, cc). Then with the PointProcess object selected, click Analyse -> To TextGrid (vuv)

Then, you'll see a nicely formatted textgrid that you can open up with the sound, where the voiced regions are marked with V and the unvoiced regions are marked with U. 

Paul, perhaps this option could be made visible from the "Annotate" menu and bypass the PointProcess command?

Matt 

On Tue, Mar 14, 2023 at 9:03 PM Daniel McCloy via groups.io <dan=mccloy.info@groups.io> wrote:
Actually never mind, I realize that's different than what you're asking for. I thought there was a "Sound: To TextGrid (Voicing)" or similar that annotated periods where a pitch was detected but now I can't find that command (at least not searching online via phone... You may have better luck searching the Praat manual directly).
-------- Original Message --------
On Mar 14, 2023, 20:53, Daniel McCloy via groups.io < dan=mccloy.info@groups.io> wrote:

There's a built in command that might work for you:

https://www.fon.hum.uva.nl/praat/manual/Sound__To_TextGrid__voice_activity____.html

-------- Original Message --------
On Mar 14, 2023, 19:17, AndyWedel < wedel@...> wrote:

I'm looking for an example of a script that can go through a wav file and identify all regions above some duration threshold that have pitch, and create intervals in a texgrid for these regions. For example if I have a wav file with 'tatata' and a textgrid, a script that can find the regions with pitch from each 'a' and add corresponding intervals to the textgrid with some label. Apologies if this is obvious - I've searched online and not found something that does this, and I'm new to praatscripting. 



--
Matthew Winn, AuD, PhD
Associate Professor
Speech-Language-Hearing Sciences
University of Minnesota


Piet Mertens
 

The situation mentioned in the initial question (by AndyWedel), where the goal is to "identify [...] regions [...] that have pitch" in pseudo-words such as [tatata], is actually the simple case of alternations of voiceless and voiced sounds. In natural speech, which includes voiced consonants, glides, consonant clusters, contiguous vowels, etc., V/UV detection is just one aspect of the task.

If the goal is to segment natural speech into voiced regions (including voiced consonants) or into syllables (or syllable peaks), then the segmentation included in the Prosogram script can be useful. It makes a first segmentation based on voicing, intensity (of band-pass filtered speech), and dip importance, then adjusts syllable nucleus boundaries to exclude voiceless frames at boundaries, pitch perturbations at voiceless consonants, octave jumps, etc.  

Script and manual available at: https://sites.google.com/site/prosogram 


Boersma Paul
 

The answer can be just two clicks away from viewing the Sound in the Sound window (with "Show pulses" on):

1. Choose "Extract visible pulses" from the Pulses menu.

2. In the Objects window, choose "To TextGrid (vuv)..." from the Analyse window.

If you insist on writing a script for this (instead of clicking twice), you would work in the Objects window entirely:

1. Select the Sound and choose "To Pitch (ac)..." from the Periodicity menu.

2. Select the Sound and the Pitch together, and choose "To PointProcess (cc)".

3. Choose "To TextGrid (vuv)..." from the Analyse window.

This procedure has the additional advantage that you can edit the Pitch after step 1, and the PointProcess after step 2, if you need the strongest accommodation to your wishes. You would also use this explicit procedure if you want to automate this analysis on a thousand recordings.

For normal use, I advise the two-click scenario, in which case you are using the pitch and pulses settings of the Sound window.

Once you have the voiced–unvoiced TextGrid, you will be able to combine it with another TextGrid if needed (select the two TextGrids together and choose Merge).

It might seem that it would also make sense if we could create a voiced–unvoiced TextGrid from the Pitch object itself, because a Pitch contains information about the voicing of each frame. However, this goes in steps of 10 milliseconds or so, whereas the procedures above look at the actual periods derived from a cross-correlation process on the original Sound, guided by the Pitch, so they are more precise.

On 15 Mar 2023, at 01:17, AndyWedel via groups.io <wedel@...> wrote:

I'm looking for an example of a script that can go through a wav file and identify all regions above some duration threshold that have pitch, and create intervals in a texgrid for these regions. For example if I have a wav file with 'tatata' and a textgrid, a script that can find the regions with pitch from each 'a' and add corresponding intervals to the textgrid with some label. Apologies if this is obvious - I've searched online and not found something that does this, and I'm new to praatscripting. 

_____

Paul Boersma
Professor of Phonetic Sciences
University of Amsterdam
Spuistraat 134, room 632
1012VB Amsterdam, The Netherlands
http://www.fon.hum.uva.nl/paul/