Praat PitchTier object: a sequence of time-value points describing a pitch contour.
Details
PitchTiers are used together with Manipulation objects to modify the pitch contour of sounds. Unlike Pitch objects, which hold sampled data, PitchTiers hold discrete time-value pairs that can be edited directly.
Query methods
get_number_of_points()- number of pitch pointsget_value_at_time(time)- interpolated F0 at a timeget_value_at_index(index)- F0 of a specific pointget_time_from_index(index)- time of a specific pointget_minimum(),get_maximum()- F0 rangeget_mean(tmin, tmax)- mean F0 (interpolated curve)get_standard_deviation(tmin, tmax)- standard deviationget_area(tmin, tmax)- area under the curve
Modification
add_point(time, value)- add a pitch point (Hz)remove_point(index)- remove a point by indexremove_points_between(tmin, tmax)- remove points in a time rangemultiply_frequencies(factor)- scale all frequenciesmultiply_frequencies_in_range(tmin, tmax, factor)- scale in a rangeshift_frequencies(shift, unit)- add to all frequenciesshift_frequencies_in_range(tmin, tmax, shift, unit)- shift in a rangestylize(frequency_resolution, use_semitones)- simplify the contourinterpolate_quadratically(points_per_parabola, logarithmically)- smooth the contour
Conversion
to_sound_pulse_train(sample_rate)- synthesize a pulse trainto_sound_phonation(sample_rate)- synthesize phonationto_sound_sine(sample_rate)- synthesize a sine wavedown_to_point_process()- extract time pointsto_pitch(time_step, pitch_floor, pitch_ceiling)- convert to a Pitch object
Export
as_data_frame()- convert to a data.tableas_matrix()- convert to a matrixsave(path)- write to file
Examples
# Create empty PitchTier and add points
pt <- PitchTier(0, 1)
pt$add_point(0.1, 120)
pt$add_point(0.5, 150)
pt$add_point(0.9, 100)
# Create from Pitch
sound <- Sound$create_tone(frequency = 150, duration = 0.5)
pitch <- sound$to_pitch()
pitch_tier <- pitch$down_to_pitch_tier()
# Modify pitch
pitch_tier$multiply_frequencies(1.5) # Raise pitch 50%
# Query
f0_at_mid <- pitch_tier$get_value_at_time(0.25)
n_points <- pitch_tier$get_number_of_points()
f0_min <- pitch_tier$get_minimum()
f0_max <- pitch_tier$get_maximum()
# Synthesize
synth <- pitch_tier$to_sound_sine(16000)
# Export
df <- pitch_tier$as_data_frame()