Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Praat call #237

Open
berndmoos opened this issue Jan 23, 2025 · 2 comments
Open

Praat call #237

berndmoos opened this issue Jan 23, 2025 · 2 comments
Assignees

Comments

@berndmoos
Copy link
Member

berndmoos commented Jan 23, 2025

To get pitch contour, to be combined with MAUS call (#236)

@berndmoos berndmoos self-assigned this Jan 23, 2025
berndmoos added a commit that referenced this issue Jan 23, 2025
@berndmoos
Copy link
Member Author

To do:

  • Use the same way of drawing the pitch contour as Praat

From a discussion on the Praat list:

Praat is quite clever about how to handle missing values that occur in the middle of a pitch track. The first data point isn't plotted at all (in matplotlib line plots, only segments connecting adjacent data points are drawn, so a "good" data point that is between to NaNs, or between one NaN and the end of the data, will be omitted).

None of the Python (or so) packages that I know will draw a pitch curve in the same way as Praat, i.e. with both linear interpolation (only between defined points) and constant extrapolation (from the middle of an edge frame to the beginning or end of an edge frame). If anybody knows a combination of arguments to matplotlib.pyplot.plot (or so) that will draw a single-frame pitch as a frame-long horizontal line, for instance (as Praat does), then I would like to hear about it.

The idea in Praat is that if a frame is voiced, the whole frame should be drawn as voiced. Surprisingly, no plotting functions that I know of do this, except those that draw "steps", but those don't interpolate linearly between adjacent frames.

The invariant that pitch plotting in Praat implements is that the area under a voiced part of the pitch curve, divided by its duration (which is the time step multiplied by the number of voiced frames), has to equal the average of the frames' pitch values.

@berndmoos
Copy link
Member Author

Praat must be prevented from opening the GUI when a command is called. This can be done with a flag

--no-pref-window

berndmoos added a commit that referenced this issue Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant