pitch to table - missing pitch values#error


lea-marie.tewald@...
 

Hi all,

I'm new to writing Praat scripts and would very much appreciate your help with the following bug.
I'm trying to extract pitch values into a table that assigns the correct values to specific points in time. The whole wav file is about 24 seconds long. My problem is that the table obviously does not contain all pitch values, which should definitely meet the settings of the script (75>x >600Hz)). However, if I run the same code over just a piece of my file(which again was read in and saved as a single wav file), the pitch values that were missing before appear in the table. I am using the same script with the same time settings. As you can see in the shared images for the test section, which shows the sequence from 8.5 to 9.2 seconds of the 24 s file. In the pitch file of the smaller file(pitch test snippet), the pitch is still included, while it is missing in the window extracted directly in the large file(pitch). 
Does anyone have any idea what could be the error in extracting the pitch?
 
Thank you in advance
Lea

This was my code:
 ## extract pitch
selectObject: mySound
myDur = Get total duration
 
selectObject: mySound
myPitch  = To Pitch: 0.001, 75, 600
myPitch2 = Kill octave jumps
 
selectObject: mySound
myInt = To Intensity: 75, 0.001, "yes"
 
myTable = Create TableOfReal: "table", 1, 3
for i to myDur/0.01
    time = 0 + i * 0.01
 
selectObject: myPitch2
    pitch = Get value at time: time, "Hertz", "Linear"
 
selectObject: myInt
    cint = Get value at time: time, "Cubic"
 
selectObject: myTable
Insert row (index): i
Set value: i, 1, time
Set value: i, 2, pitch
Set value: i, 3, cint
endfor
 


files attached include
table(2 =timepoints;3=pitch ): and pitch extracted from whole file (0,9-9,2s)
table and pitch of small snippet( 0,4-0,7^= same timepoints approx. 8.8-9,2s in big file)
 


Boersma Paul
 

dear Lea-Marie

one of the most Frequently Asked Questions on the list used to be why pitch points seem to move when you zoom and scroll, the basic answer being that pitch is measured at slightly different time points as you scroll and that the amount of signal included will change as you zoom.

But in your case something different seems to be going on: the pitch candidates look very different in your two Pitch windows. It doesn't seem likely that these are from identical signals at all. Can you send me the sound file (off the list) and explain *precisely* what you did to get these two pictures?

By the way, using "Kill octave jumps" is not good if you want to have correct pitch values. "Kill octave jumps" can cause most of your pitch curve to be in an undetermined octave, i.e. easily one or two or three octaves lower or higher than the actual pitch.

best wishes,
Paul

On 10 Feb 2023, at 10:08, lea-marie.tewald via groups.io <lea-marie.tewald@...> wrote:

Hi all,

I'm new to writing Praat scripts and would very much appreciate your help with the following bug.
I'm trying to extract pitch values into a table that assigns the correct values to specific points in time. The whole wav file is about 24 seconds long. My problem is that the table obviously does not contain all pitch values, which should definitely meet the settings of the script (75>x >600Hz)). However, if I run the same code over just a piece of my file(which again was read in and saved as a single wav file), the pitch values that were missing before appear in the table. I am using the same script with the same time settings. As you can see in the shared images for the test section, which shows the sequence from 8.5 to 9.2 seconds of the 24 s file. In the pitch file of the smaller file(pitch test snippet), the pitch is still included, while it is missing in the window extracted directly in the large file(pitch). 
Does anyone have any idea what could be the error in extracting the pitch?
 
Thank you in advance
Lea

This was my code:
 ## extract pitch
selectObject: mySound
myDur = Get total duration
 
selectObject: mySound
myPitch  = To Pitch: 0.001, 75, 600
myPitch2 = Kill octave jumps
 
selectObject: mySound
myInt = To Intensity: 75, 0.001, "yes"
 
myTable = Create TableOfReal: "table", 1, 3
for i to myDur/0.01
    time = 0 + i * 0.01
 
selectObject: myPitch2
    pitch = Get value at time: time, "Hertz", "Linear"
 
selectObject: myInt
    cint = Get value at time: time, "Cubic"
 
selectObject: myTable
Insert row (index): i
Set value: i, 1, time
Set value: i, 2, pitch
Set value: i, 3, cint
endfor
 


files attached include
table(2 =timepoints;3=pitch ): and pitch extracted from whole file (0,9-9,2s)
table and pitch of small snippet( 0,4-0,7^= same timepoints approx. 8.8-9,2s in big file)
 
<Screenshot 2023-02-10 095506_pitch_whole table.png><Screenshot 2023-02-10 095632_missing pitch_whole file.png><Tale_pitch extracted_snippet.png><download.png>

_____

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