API Reference¶
-
parselmouth.
VERSION
= '0.5.0.dev0'¶ This version of Parselmouth.
-
parselmouth.
PRAAT_VERSION
= '6.1.38'¶ The Praat version on which this version of Parselmouth is based.
-
parselmouth.
PRAAT_VERSION_DATE
= '2 January 2021'¶ The release date of the Praat version on which this version of Parselmouth is based.
-
exception
parselmouth.
PraatError
¶ Bases:
RuntimeError
-
exception
parselmouth.
PraatFatal
¶ Bases:
BaseException
-
exception
parselmouth.
PraatWarning
¶ Bases:
UserWarning
-
class
parselmouth.
AmplitudeScaling
¶ Bases:
pybind11_builtins.pybind11_object
-
__init__
(self: parselmouth.AmplitudeScaling, value: int) → None¶ -
__init__
(self: parselmouth.AmplitudeScaling, arg0: str) → None
-
__int__
(self: parselmouth.AmplitudeScaling) → int¶
-
__str__
()¶ name(self: handle) -> str
-
INTEGRAL
= <AmplitudeScaling.INTEGRAL: 1>¶
-
NORMALIZE
= <AmplitudeScaling.NORMALIZE: 3>¶
-
PEAK_0_99
= <AmplitudeScaling.PEAK_0_99: 4>¶
-
SUM
= <AmplitudeScaling.SUM: 2>¶
-
property
name
¶
-
property
value
¶
-
-
class
parselmouth.
CC
¶ Bases:
parselmouth.TimeFrameSampled
,parselmouth.Sampled
-
class
Frame
¶ Bases:
pybind11_builtins.pybind11_object
-
__getitem__
(self: parselmouth.CC.Frame, i: int) → float¶
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
__len__
(self: parselmouth.CC.Frame) → int¶
-
__setitem__
(self: parselmouth.CC.Frame, i: int, value: float) → None¶
-
to_array
(self: parselmouth.CC.Frame) → numpy.ndarray[numpy.float64]¶
-
property
c
¶
-
property
c0
¶
-
-
__getitem__
(self: parselmouth.CC, i: int) → parselmouth.CC.Frame¶ -
__getitem__
(self: parselmouth.CC, ij: Tuple[int, int]) → float
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
__iter__
(self: parselmouth.CC) → Iterator¶
-
get_c0_value_in_frame
(self: parselmouth.CC, frame_number: Positive[int]) → float¶
-
get_frame
(self: parselmouth.CC, frame_number: Positive[int]) → parselmouth.CC.Frame¶
-
get_number_of_coefficients
(self: parselmouth.CC, frame_number: Positive[int]) → int¶
-
get_value_in_frame
(self: parselmouth.CC, frame_number: Positive[int], index: Positive[int]) → float¶
-
to_array
(self: parselmouth.CC) → numpy.ndarray[numpy.float64]¶
-
to_matrix
(self: parselmouth.CC) → parselmouth.Matrix¶
-
property
fmax
¶
-
property
fmin
¶
-
property
max_n_coefficients
¶
-
class
-
class
parselmouth.
Data
¶ Bases:
parselmouth.Thing
-
class
FileFormat
¶ Bases:
pybind11_builtins.pybind11_object
-
__init__
(self: parselmouth.Data.FileFormat, value: int) → None¶ -
__init__
(self: parselmouth.Data.FileFormat, arg0: str) → None
-
__int__
(self: parselmouth.Data.FileFormat) → int¶
-
__str__
()¶ name(self: handle) -> str
-
BINARY
= <FileFormat.BINARY: 2>¶
-
SHORT_TEXT
= <FileFormat.SHORT_TEXT: 1>¶
-
TEXT
= <FileFormat.TEXT: 0>¶
-
property
name
¶
-
property
value
¶
-
-
__copy__
(self: parselmouth.Data) → parselmouth.Data¶
-
__deepcopy__
(self: parselmouth.Data, memo: dict) → parselmouth.Data¶
-
__eq__
(self: parselmouth.Data, other: parselmouth.Data) → bool¶
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
__ne__
(self: parselmouth.Data, other: parselmouth.Data) → bool¶
-
copy
(self: parselmouth.Data) → parselmouth.Data¶
-
static
read
(file_path: str) → parselmouth.Data¶ Read a file into a
parselmouth.Data
object.- Parameters
file_path (
str
) – The path of the file on disk to read.- Returns
The Praat Data object that was read.
- Return type
See also
-
save
(self: parselmouth.Data, file_path: str, format: parselmouth.Data.FileFormat = <FileFormat.TEXT: 0>) → None¶
-
save_as_binary_file
(self: parselmouth.Data, file_path: str) → None¶
-
save_as_short_text_file
(self: parselmouth.Data, file_path: str) → None¶
-
save_as_text_file
(self: parselmouth.Data, file_path: str) → None¶
-
__hash__
= None¶
-
class
-
class
parselmouth.
Formant
¶ Bases:
parselmouth.TimeFrameSampled
,parselmouth.Sampled
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
-
class
parselmouth.
FormantUnit
¶ Bases:
pybind11_builtins.pybind11_object
-
__init__
(self: parselmouth.FormantUnit, value: int) → None¶ -
__init__
(self: parselmouth.FormantUnit, arg0: str) → None
-
__int__
(self: parselmouth.FormantUnit) → int¶
-
__str__
()¶ name(self: handle) -> str
-
BARK
= <FormantUnit.BARK: 1>¶
-
HERTZ
= <FormantUnit.HERTZ: 0>¶
-
property
name
¶
-
property
value
¶
-
-
class
parselmouth.
Function
¶ Bases:
parselmouth.Data
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
scale_x_by
(self: parselmouth.Function, scale: Positive[float]) → None¶
-
scale_x_to
(self: parselmouth.Function, new_xmin: float, new_xmax: float) → None¶
-
shift_x_by
(self: parselmouth.Function, shift: float) → None¶
-
shift_x_to
(self: parselmouth.Function, x: float, new_x: float) → None¶
-
property
xmax
¶
-
property
xmin
¶
-
property
xrange
¶
-
-
class
parselmouth.
Harmonicity
¶ Bases:
parselmouth.TimeFrameSampled
,parselmouth.Vector
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
-
class
parselmouth.
Intensity
¶ Bases:
parselmouth.TimeFrameSampled
,parselmouth.Vector
-
class
AveragingMethod
¶ Bases:
pybind11_builtins.pybind11_object
-
__init__
(self: parselmouth.Intensity.AveragingMethod, value: int) → None¶ -
__init__
(self: parselmouth.Intensity.AveragingMethod, arg0: str) → None
-
__int__
(self: parselmouth.Intensity.AveragingMethod) → int¶
-
__str__
()¶ name(self: handle) -> str
-
DB
= <AveragingMethod.DB: 3>¶
-
ENERGY
= <AveragingMethod.ENERGY: 1>¶
-
MEDIAN
= <AveragingMethod.MEDIAN: 0>¶
-
SONES
= <AveragingMethod.SONES: 2>¶
-
property
name
¶
-
property
value
¶
-
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
class
-
parselmouth.
Interpolation
¶ alias of
parselmouth.ValueInterpolation
-
class
parselmouth.
MFCC
¶ Bases:
parselmouth.CC
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
convolve
(self: parselmouth.MFCC, other: parselmouth.MFCC, scaling: parselmouth.AmplitudeScaling = <AmplitudeScaling.PEAK_0_99: 4>, signal_outside_time_domain: parselmouth.SignalOutsideTimeDomain = <SignalOutsideTimeDomain.ZERO: 1>) → parselmouth.Sound¶
-
cross_correlate
(self: parselmouth.MFCC, other: parselmouth.MFCC, scaling: parselmouth.AmplitudeScaling = <AmplitudeScaling.PEAK_0_99: 4>, signal_outside_time_domain: parselmouth.SignalOutsideTimeDomain = <SignalOutsideTimeDomain.ZERO: 1>) → parselmouth.Sound¶
-
extract_features
(self: parselmouth.MFCC, window_length: Positive[float] = 0.025, include_energy: bool = False) → parselmouth.Matrix¶
-
to_matrix_features
(self: parselmouth.MFCC, window_length: Positive[float] = 0.025, include_energy: bool = False) → parselmouth.Matrix¶
-
to_sound
(self: parselmouth.MFCC) → parselmouth.Sound¶
-
-
class
parselmouth.
Matrix
¶ Bases:
parselmouth.SampledXY
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
as_array
(self: parselmouth.Matrix) → numpy.ndarray[numpy.float64]¶
-
at_xy
(self: parselmouth.Matrix, x: float, y: float) → float¶
-
formula
(self: parselmouth.Matrix, formula: str, from_x: Optional[float] = None, to_x: Optional[float] = None, from_y: Optional[float] = None, to_y: Optional[float] = None) → None¶ -
formula
(self: parselmouth.Matrix, formula: str, x_range: Tuple[Optional[float], Optional[float]] = (None, None), y_range: Tuple[Optional[float], Optional[float]] = (None, None)) → None
-
get_column_distance
(self: parselmouth.Matrix) → float¶
-
get_highest_x
(self: parselmouth.Matrix) → float¶
-
get_highest_y
(self: parselmouth.Matrix) → float¶
-
get_lowest_x
(self: parselmouth.Matrix) → float¶
-
get_lowest_y
(self: parselmouth.Matrix) → float¶
-
get_maximum
(self: parselmouth.Matrix) → float¶
-
get_minimum
(self: parselmouth.Matrix) → float¶
-
get_number_of_columns
(self: parselmouth.Matrix) → int¶
-
get_number_of_rows
(self: parselmouth.Matrix) → int¶
-
get_row_distance
(self: parselmouth.Matrix) → float¶
-
get_sum
(self: parselmouth.Matrix) → float¶
-
get_value_at_xy
(self: parselmouth.Matrix, x: float, y: float) → float¶
-
get_value_in_cell
(self: parselmouth.Matrix, row_number: Positive[int], column_number: Positive[int]) → float¶
-
get_x_of_column
(self: parselmouth.Matrix, column_number: Positive[int]) → float¶
-
get_y_of_row
(self: parselmouth.Matrix, row_number: Positive[int]) → float¶
-
save_as_headerless_spreadsheet_file
(self: parselmouth.Matrix, file_path: str) → None¶
-
save_as_matrix_text_file
(self: parselmouth.Matrix, file_path: str) → None¶
-
set_value
(self: parselmouth.Matrix, row_number: Positive[int], column_number: Positive[int], new_value: float) → None¶
-
property
n_columns
¶
-
property
n_rows
¶
-
property
values
¶
-
-
class
parselmouth.
PeakInterpolation
¶ Bases:
pybind11_builtins.pybind11_object
-
__init__
(self: parselmouth.PeakInterpolation, value: int) → None¶ -
__init__
(self: parselmouth.PeakInterpolation, arg0: str) → None
-
__int__
(self: parselmouth.PeakInterpolation) → int¶
-
__str__
()¶ name(self: handle) -> str
-
CUBIC
= <PeakInterpolation.CUBIC: 2>¶
-
NONE
= <PeakInterpolation.NONE: 0>¶
-
PARABOLIC
= <PeakInterpolation.PARABOLIC: 1>¶
-
SINC70
= <PeakInterpolation.SINC70: 3>¶
-
SINC700
= <PeakInterpolation.SINC700: 4>¶
-
property
name
¶
-
property
value
¶
-
-
class
parselmouth.
Pitch
¶ Bases:
parselmouth.TimeFrameSampled
,parselmouth.Sampled
-
class
Candidate
¶ Bases:
pybind11_builtins.pybind11_object
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
property
frequency
¶
-
property
strength
¶
-
-
class
Frame
¶ Bases:
pybind11_builtins.pybind11_object
-
__getitem__
(self: parselmouth.Pitch.Frame, i: int) → parselmouth.Pitch.Candidate¶
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
__len__
(self: parselmouth.Pitch.Frame) → int¶
-
as_array
(self: parselmouth.Pitch.Frame) → numpy.ndarray¶
-
select
(self: parselmouth.Pitch.Frame, candidate: parselmouth.Pitch.Candidate) → None¶ -
select
(self: parselmouth.Pitch.Frame, i: int) → None
-
unvoice
(self: parselmouth.Pitch.Frame) → None¶
-
property
candidates
¶
-
property
intensity
¶
-
property
selected
¶
-
-
__getitem__
(self: parselmouth.Pitch, i: int) → parselmouth.Pitch.Frame¶ -
__getitem__
(self: parselmouth.Pitch, ij: Tuple[int, int]) → parselmouth.Pitch.Candidate
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
__iter__
(self: parselmouth.Pitch) → Iterator¶
-
count_differences
(self: parselmouth.Pitch, other: parselmouth.Pitch) → str¶
-
count_voiced_frames
(self: parselmouth.Pitch) → int¶
-
fifth_down
(self: parselmouth.Pitch, from_time: Optional[float] = None, to_time: Optional[float] = None) → None¶
-
fifth_up
(self: parselmouth.Pitch, from_time: Optional[float] = None, to_time: Optional[float] = None) → None¶
-
formula
(self: parselmouth.Pitch, formula: str) → None¶
-
get_frame
(self: parselmouth.Pitch, frame_number: Positive[int]) → parselmouth.Pitch.Frame¶
-
get_mean_absolute_slope
(self: parselmouth.Pitch, unit: parselmouth.PitchUnit = <PitchUnit.HERTZ: 0>) → float¶
-
get_slope_without_octave_jumps
(self: parselmouth.Pitch) → float¶
-
get_value_at_time
(self: parselmouth.Pitch, time: float, unit: parselmouth.PitchUnit = <PitchUnit.HERTZ: 0>, interpolation: parselmouth.ValueInterpolation = <ValueInterpolation.LINEAR: 1>) → float¶
-
get_value_in_frame
(self: parselmouth.Pitch, frame_number: int, unit: parselmouth.PitchUnit = <PitchUnit.HERTZ: 0>) → float¶
-
interpolate
(self: parselmouth.Pitch) → parselmouth.Pitch¶
-
kill_octave_jumps
(self: parselmouth.Pitch) → parselmouth.Pitch¶
-
octave_down
(self: parselmouth.Pitch, from_time: Optional[float] = None, to_time: Optional[float] = None) → None¶
-
octave_up
(self: parselmouth.Pitch, from_time: Optional[float] = None, to_time: Optional[float] = None) → None¶
-
path_finder
(self: parselmouth.Pitch, silence_threshold: float = 0.03, voicing_threshold: float = 0.45, octave_cost: float = 0.01, octave_jump_cost: float = 0.35, voiced_unvoiced_cost: float = 0.14, ceiling: Positive[float] = 600.0, pull_formants: bool = False) → None¶
-
smooth
(self: parselmouth.Pitch, bandwidth: Positive[float] = 10.0) → parselmouth.Pitch¶
-
step
(self: parselmouth.Pitch, step: float, precision: Positive[float] = 0.1, from_time: Optional[float] = None, to_time: Optional[float] = None) → None¶
-
subtract_linear_fit
(self: parselmouth.Pitch, unit: parselmouth.PitchUnit = <PitchUnit.HERTZ: 0>) → parselmouth.Pitch¶
-
to_array
(self: parselmouth.Pitch) → numpy.ndarray[parselmouth.Pitch.Candidate]¶
-
to_matrix
(self: parselmouth.Pitch) → parselmouth.Matrix¶
-
to_point_process
(self: parselmouth.Pitch, sound: parselmouth.Sound = None, method: str = 'cc', include_maxima: bool = True, include_minima: bool = False) → parselmouth.PointProcess¶ Create PointProcess from Pitch object.
Returns a new PointProcess instance which is generated from the specified Pitch object. The acoustic periodicity contour stored in the Pitch object is used as the frequency of an underlying point process (such as the sequence of glottal closures in vocal-fold vibration).
See also
-
to_point_process_cc
(self: parselmouth.Pitch, sound: parselmouth.Sound) → parselmouth.PointProcess¶ Create PointProcess from Sound and Pitch objects using crosscorrelation.
Returns a new PointProcess instance, generated from the specified Sound and Pitch instances using the cross-correlation method. The resulting instance contains voiced and unvoiced intervals according to
pitch
object, and the voiced intervals are further divided into fundamental periods of voice, identified by cross-correlating the sound samples.- Parameters
sound (
parselmouth.Sound
) – Sound object containing the target sound waveform
-
to_point_process_peaks
(self: parselmouth.Pitch, sound: parselmouth.Sound, include_maxima: bool = True, include_minima: bool = False) → parselmouth.PointProcess¶ Create PointProcess from Sound and Pitch objects using peak-picking.
Returns a new PointProcess instance, generated from the specified
Sound
andPitch
instances using the peak-picking method. The resulting instance contains voiced and unvoiced intervals according topitch
object, and the voiced intervals are further divided into fundamental periods of voice, identified by peak-picking the sound samples.The periods that are found in this way are much more variable than those found by
Pitch.to_point_process_cc()
and therefore less useful for analysis and subsequent overlap-add synthesis.- Parameters
sound (
parselmouth.Sound
) – Sound object containing the target sound waveform
-
to_sound_hum
(self: parselmouth.Pitch, from_time: Optional[float] = None, to_time: Optional[float] = None) → parselmouth.Sound¶
-
to_sound_pulses
(self: parselmouth.Pitch, from_time: Optional[float] = None, to_time: Optional[float] = None) → parselmouth.Sound¶
-
to_sound_sine
(self: parselmouth.Pitch, from_time: Optional[float] = None, to_time: Optional[float] = None, sampling_frequency: Positive[float] = 44100.0, round_to_nearest_zero_crossing: float = True) → parselmouth.Sound¶
-
unvoice
(self: parselmouth.Pitch, from_time: Optional[float] = None, to_time: Optional[float] = None) → None¶
-
property
ceiling
¶
-
property
max_n_candidates
¶
-
property
selected
¶
-
property
selected_array
¶
-
class
-
class
parselmouth.
PitchUnit
¶ Bases:
pybind11_builtins.pybind11_object
-
__init__
(self: parselmouth.PitchUnit, value: int) → None¶ -
__init__
(self: parselmouth.PitchUnit, arg0: str) → None
-
__int__
(self: parselmouth.PitchUnit) → int¶
-
__str__
()¶ name(self: handle) -> str
-
ERB
= <PitchUnit.ERB: 8>¶
-
HERTZ
= <PitchUnit.HERTZ: 0>¶
-
HERTZ_LOGARITHMIC
= <PitchUnit.HERTZ_LOGARITHMIC: 1>¶
-
LOG_HERTZ
= <PitchUnit.LOG_HERTZ: 3>¶
-
MEL
= <PitchUnit.MEL: 2>¶
-
SEMITONES_1
= <PitchUnit.SEMITONES_1: 4>¶
-
SEMITONES_100
= <PitchUnit.SEMITONES_100: 5>¶
-
SEMITONES_200
= <PitchUnit.SEMITONES_200: 6>¶
-
SEMITONES_440
= <PitchUnit.SEMITONES_440: 7>¶
-
property
name
¶
-
property
value
¶
-
-
class
parselmouth.
PointProcess
¶ Bases:
parselmouth.TimeFunction
,parselmouth.Function
Praat PointProcess.
A sequence object contain a sequence of points \(t_i\) in time, defined on a domain [
xmin
,xmax
]. The points are sorted in time, i.e., \(t_i+1 > t_i\).See also
-
__getitem__
(self: parselmouth.PointProcess, i: int) → float¶
-
__init__
(self: parselmouth.PointProcess, start_time: float, end_time: float) → None¶ -
__init__
(self: parselmouth.PointProcess, time_points: List[float], start_time: Optional[float] = None, end_time: Optional[float] = None) → None Create an empty PointProcess.
Returns an empty PointProcess instance.
- Parameters
See also
Create a PointProcess filled with time points.
Returns a new PointProcess instance that contains the time points specified.
- Parameters
times (
sequence-like
offloat
) – A sequence of time points in seconds to be added to the PointProcess.start_time (
float
, optional) – \(t_{min}\), the beginning of the time domain, in seconds. IfNone
, the smallest value fromtimes
is used.end_time (
float
, optional) – \(t_{max}\), the end of the time domain, in seconds. IfNone
, the largest value fromtimes
is used.
-
__iter__
(self: parselmouth.PointProcess) → Iterator¶
-
__len__
(self: parselmouth.PointProcess) → int¶
-
add_point
(self: parselmouth.PointProcess, time: float) → None¶ Add time point.
Add the specified time point. If the point already exists in the point process, nothing happens.
- Parameters
time (
float
) – Time point to be added.
See also
-
add_points
(self: parselmouth.PointProcess, times: List[float]) → None¶ Add time points.
Add the specified time points. If any of the points already exists in the point process, nothing happens for that point.
- Parameters
times (
np.ndarray[float]
) – Array of time points to be added.
-
static
create_poisson_process
(start_time: float, end_time: float, density: Positive[float]) → parselmouth.PointProcess¶ Create a PointProcess instance with Poisson-distributed random time points.
Returns a new PointProcess instance that represents a Poisson process. A Poisson process is a stationary point process with a fixed density \(\lambda\), which means that there are, on the average, \(\lambda\) events per second.
- Parameters
See also
-
difference
(self: parselmouth.PointProcess, other: parselmouth.PointProcess) → parselmouth.PointProcess¶ Subtract another time process.
Returns a new
PointProcess
instance containing only those points of theself
point process that do not occur in theother
point process.- Parameters
other (
parselmouth.PointProcess
) – The otherPointProcess
object to subtract fromself
.
See also
-
fill
(self: parselmouth.PointProcess, from_time: Optional[float], to_time: Optional[float], period: Positive[float] = 0.01) → None¶ Add equispaced time points.
Add equispaced time points between the specified time range separated by the specified period.
-
get_count_and_fraction_of_voice_breaks
(self: parselmouth.PointProcess, from_time: Optional[float] = None, to_time: Optional[float] = None, period_ceiling: float = 0.02) → Tuple[int, float, float, float]¶ Get voice break analysis outputs.
Returns a tuple, containing the outputs of the Praat voice break analysis:
the number of voice breaks
the degree of voice breaks (MDVP DVB)
the total duration of the voice breaks in seconds
the duration of the analysed part of the signal in seconds
- Parameters
from_time (
float
, optional) – The start time of the part of the PointProcess to be measured in seconds. IfNone
, all the points fromtmin
are included.end_time (
float
, optional) – The end time of the part of the PointProcess to be measured in seconds. IfNone
, all the points totmax
are included.period_ceiling (
float
, default:0.02
) – The longest possible interval that to be used in the computation in seconds. If an interval is longer than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). For example, if the minimum frequency of periodicity is 50 Hz, set this setting to 0.02 seconds; intervals longer than that could be regarded as voiceless stretches and will be ignored.
See also
-
get_high_index
(self: parselmouth.PointProcess, time: float) → int¶ Get nearest point above.
Returns the 1-base index of the nearest point at or after the specified time. If the point process contains no points or the specified time is after the last point, returns 0.
- Parameters
time (
float
) – The time from which a point is looked for in seconds.
-
get_interval
(self: parselmouth.PointProcess, time: float) → float¶ Get period duration.
Returns the duration of the period interval around a specified time.
- Parameters
time (
float
) – The time from which a point is looked for in seconds
See also
-
get_jitter_ddp
(self: parselmouth.PointProcess, from_time: Optional[float] = None, to_time: Optional[float] = None, period_floor: float = 0.0001, period_ceiling: float = 0.02, maximum_period_factor: Positive[float] = 1.3) → float¶ Get Praat jitter measure.
Get the average absolute difference between consecutive differences between consecutive periods, divided by the average period.
- Parameters
from_time (
float
, optional) – The start time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points fromtmin
are included.end_time (
float
, optional) – The end time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points totmax
are included.period_floor (
float
, default:0.0001
) – The shortest possible interval to be used in the computation in seconds. If an interval is shorter than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). This setting will normally be very small.period_ceiling (
float
, default:0.02
) – The longest possible interval that to be used in the computation in seconds. If an interval is longer than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). For example, if the minimum frequency of periodicity is 50 Hz, set this setting to 0.02 seconds; intervals longer than that could be regarded as voiceless stretches and will be ignored.maximum_period_factor (
float
,positive
, default:1.3
) – The largest possible difference between consecutive intervals to be used in the computation. If the ratio of the durations of two consecutive intervals is greater than this, this pair of intervals will be ignored (each of the intervals could still take part in the computation in a comparison with its neighbour on the other side).
-
get_jitter_local
(self: parselmouth.PointProcess, from_time: Optional[float] = None, to_time: Optional[float] = None, period_floor: float = 0.0001, period_ceiling: float = 0.02, maximum_period_factor: Positive[float] = 1.3) → float¶ Get jitter measure (MDVP Jitt).
Returns the average absolute difference between consecutive periods, divided by the average period. (MDVP Jitt: 1.040% as a threshold for pathology).
- Parameters
from_time (
float
, optional) – The start time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points fromtmin
are included.end_time (
float
, optional) – The end time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points totmax
are included.period_floor (
float
, default:0.0001
) – The shortest possible interval to be used in the computation in seconds. If an interval is shorter than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). This setting will normally be very small.period_ceiling (
float
, default:0.02
) – The longest possible interval that to be used in the computation in seconds. If an interval is longer than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). For example, if the minimum frequency of periodicity is 50 Hz, set this setting to 0.02 seconds; intervals longer than that could be regarded as voiceless stretches and will be ignored.maximum_period_factor (
float
,positive
, default:1.3
) – The largest possible difference between consecutive intervals to be used in the computation. If the ratio of the durations of two consecutive intervals is greater than this, this pair of intervals will be ignored (each of the intervals could still take part in the computation in a comparison with its neighbour on the other side).
-
get_jitter_local_absolute
(self: parselmouth.PointProcess, from_time: Optional[float] = None, to_time: Optional[float] = None, period_floor: float = 0.0001, period_ceiling: float = 0.02, maximum_period_factor: Positive[float] = 1.3) → float¶ Get absolute jitter measure (MDVP Jita).
Get the average absolute difference between consecutive periods, in seconds (MDVP Jita: 83.200 μs as a threshold for pathology).
- Parameters
from_time (
float
, optional) – The start time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points fromtmin
are included.end_time (
float
, optional) – The end time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points totmax
are included.period_floor (
float
, default:0.0001
) – The shortest possible interval to be used in the computation in seconds. If an interval is shorter than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). This setting will normally be very small.period_ceiling (
float
, default:0.02
) – The longest possible interval that to be used in the computation in seconds. If an interval is longer than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). For example, if the minimum frequency of periodicity is 50 Hz, set this setting to 0.02 seconds; intervals longer than that could be regarded as voiceless stretches and will be ignored.maximum_period_factor (
float
,positive
, default:1.3
) – The largest possible difference between consecutive intervals to be used in the computation. If the ratio of the durations of two consecutive intervals is greater than this, this pair of intervals will be ignored (each of the intervals could still take part in the computation in a comparison with its neighbour on the other side).
-
get_jitter_ppq5
(self: parselmouth.PointProcess, from_time: Optional[float] = None, to_time: Optional[float] = None, period_floor: float = 0.0001, period_ceiling: float = 0.02, maximum_period_factor: Positive[float] = 1.3) → float¶ Get 5-point PPQ measure (MDVP PPQ).
Get the five-point Period Perturbation Quotient, the average absolute difference between a period and the average of it and its four closest neighbours, divided by the average period (MDVP PPQ, and gives 0.840% as a threshold for pathology).
- Parameters
from_time (
float
, optional) – The start time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points fromtmin
are included.end_time (
float
, optional) – The end time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points totmax
are included.period_floor (
float
, default:0.0001
) – The shortest possible interval to be used in the computation in seconds. If an interval is shorter than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). This setting will normally be very small.period_ceiling (
float
, default:0.02
) – The longest possible interval that to be used in the computation in seconds. If an interval is longer than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). For example, if the minimum frequency of periodicity is 50 Hz, set this setting to 0.02 seconds; intervals longer than that could be regarded as voiceless stretches and will be ignored.maximum_period_factor (
float
,positive
, default:1.3
) – The largest possible difference between consecutive intervals to be used in the computation. If the ratio of the durations of two consecutive intervals is greater than this, this pair of intervals will be ignored (each of the intervals could still take part in the computation in a comparison with its neighbour on the other side).
-
get_jitter_rap
(self: parselmouth.PointProcess, from_time: Optional[float] = None, to_time: Optional[float] = None, period_floor: float = 0.0001, period_ceiling: float = 0.02, maximum_period_factor: Positive[float] = 1.3) → float¶ Get Relative Average Perturbation measure (MDVP RAP).
Get the Relative Average Perturbation, the average absolute difference between a period and the average of it and its two neighbours, divided by the average period (MDVP: 0.680% as a threshold for pathology).
- Parameters
from_time (
float
, optional) – The start time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points fromtmin
are included.end_time (
float
, optional) – The end time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points totmax
are included.period_floor (
float
, default:0.0001
) – The shortest possible interval to be used in the computation in seconds. If an interval is shorter than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). This setting will normally be very small.period_ceiling (
float
, default:0.02
) – The longest possible interval that to be used in the computation in seconds. If an interval is longer than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). For example, if the minimum frequency of periodicity is 50 Hz, set this setting to 0.02 seconds; intervals longer than that could be regarded as voiceless stretches and will be ignored.maximum_period_factor (
float
,positive
, default:1.3
) – The largest possible difference between consecutive intervals to be used in the computation. If the ratio of the durations of two consecutive intervals is greater than this, this pair of intervals will be ignored (each of the intervals could still take part in the computation in a comparison with its neighbour on the other side).
-
get_low_index
(self: parselmouth.PointProcess, time: float) → int¶ Get nearest point below.
Returns the 1-base index of the nearest point before or at the specified time. If the point process contains no points or the specified time is before the first point, returns 0.
- Parameters
time (
float
) – The time from which a point is looked for in seconds.
-
get_mean_period
(self: parselmouth.PointProcess, from_time: Optional[float] = None, to_time: Optional[float] = None, period_floor: float = 0.0001, period_ceiling: float = 0.02, maximum_period_factor: Positive[float] = 1.3) → float¶ Get mean period.
Returns the average period in the specified time range.
- Parameters
from_time (
float
, optional) – The start time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points fromtmin
are included.end_time (
float
, optional) – The end time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points totmax
are included.period_floor (
float
, default:0.0001
) – The shortest possible interval to be used in the computation in seconds. If an interval is shorter than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). This setting will normally be very small.period_ceiling (
float
, default:0.02
) – The longest possible interval that to be used in the computation in seconds. If an interval is longer than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). For example, if the minimum frequency of periodicity is 50 Hz, set this setting to 0.02 seconds; intervals longer than that could be regarded as voiceless stretches and will be ignored.maximum_period_factor (
float
,positive
, default:1.3
) – The largest possible difference between consecutive intervals to be used in the computation. If the ratio of the durations of two consecutive intervals is greater than this, this pair of intervals will be ignored (each of the intervals could still take part in the computation in a comparison with its neighbour on the other side).
-
get_nearest_index
(self: parselmouth.PointProcess, time: float) → int¶ Get nearest point.
Returns the 1-base index of the point nearest to the specified time. If the point process contains no points or the specified time is before the first point or after the last point, returns 0.
- Parameters
time (
float
) – The time from which a point is looked for in seconds.
-
get_number_of_periods
(self: parselmouth.PointProcess, from_time: Optional[float] = None, to_time: Optional[float] = None, period_floor: float = 0.0001, period_ceiling: float = 0.02, maximum_period_factor: Positive[float] = 1.3) → int¶ Get the number of periods.
Get the number of periods within the specified time range.
- Parameters
from_time (
float
, optional) – The start time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points fromtmin
are included.end_time (
float
, optional) – The end time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points totmax
are included.period_floor (
float
, default:0.0001
) – The shortest possible interval to be used in the computation in seconds. If an interval is shorter than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). This setting will normally be very small.period_ceiling (
float
, default:0.02
) – The longest possible interval that to be used in the computation in seconds. If an interval is longer than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). For example, if the minimum frequency of periodicity is 50 Hz, set this setting to 0.02 seconds; intervals longer than that could be regarded as voiceless stretches and will be ignored.maximum_period_factor (
float
,positive
, default:1.3
) – The largest possible difference between consecutive intervals to be used in the computation. If the ratio of the durations of two consecutive intervals is greater than this, this pair of intervals will be ignored (each of the intervals could still take part in the computation in a comparison with its neighbour on the other side).
-
get_number_of_points
(self: parselmouth.PointProcess) → int¶ Get the number of time points.
Returns the total number of time points defined in the PointProcess instance.
-
get_shimmer_apq11
(self: parselmouth.PointProcess, sound: parselmouth.Sound, from_time: Optional[float] = None, to_time: Optional[float] = None, period_floor: float = 0.0001, period_ceiling: float = 0.02, maximum_period_factor: Positive[float] = 1.3, maximum_amplitude_factor: Positive[float] = 1.6) → float¶ Get 11-point APQ (MDVP APQ).
Returns the 11-point Amplitude Perturbation Quotient, the average absolute difference between the amplitude of a period and the average of the amplitudes of it and its ten closest neighbours, divided by the average amplitude (MDVP APQ: 3.070% as a threshold for pathology).
- Parameters
sound (
parselmouth.Sound
) – Sound object containing the samples to evaluate the amplitude.from_time (
float
, optional) – The start time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points fromtmin
are included.end_time (
float
, optional) – The end time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points totmax
are included.period_floor (
float
, default:0.0001
) – The shortest possible interval to be used in the computation in seconds. If an interval is shorter than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). This setting will normally be very small.period_ceiling (
float
, default:0.02
) – The longest possible interval that to be used in the computation in seconds. If an interval is longer than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). For example, if the minimum frequency of periodicity is 50 Hz, set this setting to 0.02 seconds; intervals longer than that could be regarded as voiceless stretches and will be ignored.maximum_period_factor (
float
,positive
, default:1.3
) – The largest possible difference between consecutive intervals to be used in the computation. If the ratio of the durations of two consecutive intervals is greater than this, this pair of intervals will be ignored (each of the intervals could still take part in the computation in a comparison with its neighbour on the other side).maximum_amplitude_factor : float, positive, default: 1.6 Maximum amplitude factor.
See also
-
get_shimmer_apq3
(self: parselmouth.PointProcess, sound: parselmouth.Sound, from_time: Optional[float] = None, to_time: Optional[float] = None, period_floor: float = 0.0001, period_ceiling: float = 0.02, maximum_period_factor: Positive[float] = 1.3, maximum_amplitude_factor: Positive[float] = 1.6) → float¶ Get 3-point APQ.
Returns the three-point Amplitude Perturbation Quotient, the average absolute difference between the amplitude of a period and the average of the amplitudes of its neighbours, divided by the average amplitude.
- Parameters
sound (
parselmouth.Sound
) – Sound object containing the samples to evaluate the amplitude.from_time (
float
, optional) – The start time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points fromtmin
are included.end_time (
float
, optional) – The end time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points totmax
are included.period_floor (
float
, default:0.0001
) – The shortest possible interval to be used in the computation in seconds. If an interval is shorter than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). This setting will normally be very small.period_ceiling (
float
, default:0.02
) – The longest possible interval that to be used in the computation in seconds. If an interval is longer than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). For example, if the minimum frequency of periodicity is 50 Hz, set this setting to 0.02 seconds; intervals longer than that could be regarded as voiceless stretches and will be ignored.maximum_period_factor (
float
,positive
, default:1.3
) – The largest possible difference between consecutive intervals to be used in the computation. If the ratio of the durations of two consecutive intervals is greater than this, this pair of intervals will be ignored (each of the intervals could still take part in the computation in a comparison with its neighbour on the other side).maximum_amplitude_factor : float, positive, default: 1.6 Maximum amplitude factor.
See also
-
get_shimmer_apq5
(self: parselmouth.PointProcess, sound: parselmouth.Sound, from_time: Optional[float] = None, to_time: Optional[float] = None, period_floor: float = 0.0001, period_ceiling: float = 0.02, maximum_period_factor: Positive[float] = 1.3, maximum_amplitude_factor: Positive[float] = 1.6) → float¶ Get 5-point APQ.
Returns the five-point Amplitude Perturbation Quotient, the average absolute difference between the amplitude of a period and the average of the amplitudes of it and its four closest neighbours, divided by the average amplitude.
- Parameters
sound (
parselmouth.Sound
) – Sound object containing the samples to evaluate the amplitude.from_time (
float
, optional) – The start time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points fromtmin
are included.end_time (
float
, optional) – The end time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points totmax
are included.period_floor (
float
, default:0.0001
) – The shortest possible interval to be used in the computation in seconds. If an interval is shorter than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). This setting will normally be very small.period_ceiling (
float
, default:0.02
) – The longest possible interval that to be used in the computation in seconds. If an interval is longer than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). For example, if the minimum frequency of periodicity is 50 Hz, set this setting to 0.02 seconds; intervals longer than that could be regarded as voiceless stretches and will be ignored.maximum_period_factor (
float
,positive
, default:1.3
) – The largest possible difference between consecutive intervals to be used in the computation. If the ratio of the durations of two consecutive intervals is greater than this, this pair of intervals will be ignored (each of the intervals could still take part in the computation in a comparison with its neighbour on the other side).maximum_amplitude_factor : float, positive, default: 1.6 Maximum amplitude factor.
See also
-
get_shimmer_dda
(self: parselmouth.PointProcess, sound: parselmouth.Sound, from_time: Optional[float] = None, to_time: Optional[float] = None, period_floor: float = 0.0001, period_ceiling: float = 0.02, maximum_period_factor: Positive[float] = 1.3, maximum_amplitude_factor: Positive[float] = 1.6) → float¶ Get Praat shimmer measure.
Returns the average absolute difference between consecutive differences between the amplitudes of consecutive periods (three times APQ3).
- Parameters
sound (
parselmouth.Sound
) – Sound object containing the samples to evaluate the amplitude.from_time (
float
, optional) – The start time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points fromtmin
are included.end_time (
float
, optional) – The end time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points totmax
are included.period_floor (
float
, default:0.0001
) – The shortest possible interval to be used in the computation in seconds. If an interval is shorter than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). This setting will normally be very small.period_ceiling (
float
, default:0.02
) – The longest possible interval that to be used in the computation in seconds. If an interval is longer than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). For example, if the minimum frequency of periodicity is 50 Hz, set this setting to 0.02 seconds; intervals longer than that could be regarded as voiceless stretches and will be ignored.maximum_period_factor (
float
,positive
, default:1.3
) – The largest possible difference between consecutive intervals to be used in the computation. If the ratio of the durations of two consecutive intervals is greater than this, this pair of intervals will be ignored (each of the intervals could still take part in the computation in a comparison with its neighbour on the other side).maximum_amplitude_factor : float, positive, default: 1.6 Maximum amplitude factor.
See also
-
get_shimmer_local
(self: parselmouth.PointProcess, sound: parselmouth.Sound, from_time: Optional[float] = None, to_time: Optional[float] = None, period_floor: float = 0.0001, period_ceiling: float = 0.02, maximum_period_factor: Positive[float] = 1.3, maximum_amplitude_factor: Positive[float] = 1.6) → float¶ Get shimmer measure (MDVP Shim).
Returns the average absolute difference between the amplitudes of consecutive periods, divided by the average amplitude (MDVP Shim: 3.810% as a threshold for pathology).
- Parameters
sound (
parselmouth.Sound
) – Sound object containing the samples to evaluate the amplitude.from_time (
float
, optional) – The start time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points fromtmin
are included.end_time (
float
, optional) – The end time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points totmax
are included.period_floor (
float
, default:0.0001
) – The shortest possible interval to be used in the computation in seconds. If an interval is shorter than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). This setting will normally be very small.period_ceiling (
float
, default:0.02
) – The longest possible interval that to be used in the computation in seconds. If an interval is longer than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). For example, if the minimum frequency of periodicity is 50 Hz, set this setting to 0.02 seconds; intervals longer than that could be regarded as voiceless stretches and will be ignored.maximum_period_factor (
float
,positive
, default:1.3
) – The largest possible difference between consecutive intervals to be used in the computation. If the ratio of the durations of two consecutive intervals is greater than this, this pair of intervals will be ignored (each of the intervals could still take part in the computation in a comparison with its neighbour on the other side).maximum_amplitude_factor : float, positive, default: 1.6 Maximum amplitude factor.
See also
-
get_shimmer_local_db
(self: parselmouth.PointProcess, sound: parselmouth.Sound, from_time: Optional[float] = None, to_time: Optional[float] = None, period_floor: float = 0.0001, period_ceiling: float = 0.02, maximum_period_factor: Positive[float] = 1.3, maximum_amplitude_factor: Positive[float] = 1.6) → float¶ Get shimmer measure in dB (MDVP ShdB).
Returns the average absolute base-10 logarithm of the difference between the amplitudes of consecutive periods, multiplied by 20 (MDVP ShdB: 0.350 dB as a threshold for pathology).
- Parameters
sound (
parselmouth.Sound
) – Sound object containing the samples to evaluate the amplitude.from_time (
float
, optional) – The start time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points fromtmin
are included.end_time (
float
, optional) – The end time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points totmax
are included.period_floor (
float
, default:0.0001
) – The shortest possible interval to be used in the computation in seconds. If an interval is shorter than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). This setting will normally be very small.period_ceiling (
float
, default:0.02
) – The longest possible interval that to be used in the computation in seconds. If an interval is longer than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). For example, if the minimum frequency of periodicity is 50 Hz, set this setting to 0.02 seconds; intervals longer than that could be regarded as voiceless stretches and will be ignored.maximum_period_factor (
float
,positive
, default:1.3
) – The largest possible difference between consecutive intervals to be used in the computation. If the ratio of the durations of two consecutive intervals is greater than this, this pair of intervals will be ignored (each of the intervals could still take part in the computation in a comparison with its neighbour on the other side).maximum_amplitude_factor : float, positive, default: 1.6 Maximum amplitude factor.
See also
-
get_stdev_period
(self: parselmouth.PointProcess, from_time: Optional[float] = None, to_time: Optional[float] = None, period_floor: float = 0.0001, period_ceiling: float = 0.02, maximum_period_factor: Positive[float] = 1.3) → float¶ Get standard deviation of periods.
Returns the standard deviation of the periods in the specified time range.
- Parameters
from_time (
float
, optional) – The start time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points fromtmin
are included.end_time (
float
, optional) – The end time of the part of thePointProcess
to be measured in seconds. IfNone
, all the points totmax
are included.period_floor (
float
, default:0.0001
) – The shortest possible interval to be used in the computation in seconds. If an interval is shorter than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). This setting will normally be very small.period_ceiling (
float
, default:0.02
) – The longest possible interval that to be used in the computation in seconds. If an interval is longer than this, it will be ignored (and the previous and next intervals will not be regarded as consecutive). For example, if the minimum frequency of periodicity is 50 Hz, set this setting to 0.02 seconds; intervals longer than that could be regarded as voiceless stretches and will be ignored.maximum_period_factor (
float
,positive
, default:1.3
) – The largest possible difference between consecutive intervals to be used in the computation. If the ratio of the durations of two consecutive intervals is greater than this, this pair of intervals will be ignored (each of the intervals could still take part in the computation in a comparison with its neighbour on the other side).
-
get_time_from_index
(self: parselmouth.PointProcess, point_number: int) → float¶ Get time associated with the point number.
Returns a time, specified by the time point number. If the number is not a valid, it returns None.
- Parameters
point_number (
int
) – Index (1-based) of the requested time point.
-
get_window_points
(self: parselmouth.PointProcess, from_time: float, to_time: float) → Tuple[int, int]¶ Get included point range.
Returns the 1-base starting and ending indices of the time points inside the specified time range.
-
intersection
(self: parselmouth.PointProcess, other: parselmouth.PointProcess) → parselmouth.PointProcess¶ Intersect with another time process.
Returns a new
PointProcess
instance containing only those points that occur in bothself
andother
PointProcess
objects.- Parameters
other (
parselmouth.PointProcess
) – The other PointProcess object to intersect withself
.
-
remove_point
(self: parselmouth.PointProcess, point_number: int) → None¶ Remove time point.
Remove the specified time point. (e.g., if
point_number
is 3, the third point is removed) It does nothing if index is less than 1 or greater than the number of points in the point process.- Parameters
point_number (
int
) – 1-based index of time point to remove.
See also
-
remove_point_near
(self: parselmouth.PointProcess, time: float) → None¶ Remove nearest time point.
Remove a time point nearest to the specified time. It does nothing if there are no points in the point process.
- Parameters
time (
float
) – Time point to be removed.
-
remove_points
(self: parselmouth.PointProcess, from_point_number: int, to_point_number: int) → None¶ Remove a range of time points.
Remove all the time point that originally fell in the range [from_point_number, to_point_number].
-
remove_points_between
(self: parselmouth.PointProcess, from_time: float, to_time: float) → None¶ Remove time points in a time range.
Remove all points that originally fell in the domain [from_time, to_time], including the edges.
-
to_matrix
(self: parselmouth.PointProcess) → parselmouth.Matrix¶
-
to_sound_hum
(self: parselmouth.PointProcess) → parselmouth.Sound¶ Convert into a Sound with hum sound
PointProcess object is converted to a sound object with hum sound. A Sound is created from pulses, followed by filtered by a sequence of second-order filters that represent five formants.
-
to_sound_phonation
(self: parselmouth.PointProcess, sampling_frequency: float = 44100.0, adaptation_factor: float = 1.0, maximum_period: float = 0.05, open_phase: float = 0.7, collision_phase: float = 0.03, power1: float = 3.0, power2: float = 4.0) → parselmouth.Sound¶ Convert into a glottal waveform
Sound
object.PointProcess object is converted to a sound object containing glottal waveform at every point in the point process. Its shape depends on the settings
power1
andpower2
according to the formula.\[U(x) = x^{power1} - x^{power2}\]where \(x\) is a normalized time that runs from 0 to 1 and \(U(x)\) is the normalized glottal flow in arbitrary units (the real unit is \(m^3/s\)).
- Parameters
sampling_frequency (
float
, default:44100.0
) – The sampling frequency of the resultingSound
object.adaptation_factor (
float
, default:1.0
) – The factor by which a pulse height will be multiplied if the pulse time is not within Maximum period from the previous pulse, and by which a pulse height will again be multiplied if the previous pulse time is not withinmaximum_period
from the pre-previous pulse. This factor is against abrupt starts of the pulse train after silences, and is 1.0 if you do want abrupt starts after silences.maximum_period (
float
, default:0.05
) – The minimal period that will be considered a silence in seconds.open_phase (
float
, default:0.7
) – Fraction of a period when the glottis is open.collision_phase (
float
, default:0.03
) – Decay factor to ease the abrupt collision at closure.power1 (
float
, default:3.0
) – First glottal flow shape coefficient.power2 (
float
, default:4.0
) – Second glottal flow shape coefficient.
-
to_sound_pulse_train
(self: parselmouth.PointProcess, sampling_frequency: float = 44100.0, adaptation_factor: float = 1.0, adaptation_time: float = 0.05, interpolation_depth: int = 2000) → parselmouth.Sound¶ Convert into a Sound with pulses
PointProcess object is converted to a sound object with a series of pulses, each generated at every point in the point process. This pulse is filtered at the Nyquist frequency of the resulting Sound by converting it into a sampled sinc function.
- Parameters
sampling_frequency (
float
, default:44100.0
) – The sampling frequency of the resultingSound
object.adaptation_factor (
float
, default:1.0
) – The factor by which a pulse height will be multiplied if the pulse time is not withinadaptation_time
from the pre-previous pulse, and by which a pulse height will again be multiplied if the pulse time is not withinadaptation_time
from the previous pulse. This factor is against abrupt starts of the pulse train after silences, and is 1.0 if you do want abrupt starts after silences.adaptation_time (
float
, default:0.05
) – The minimal period that will be considered a silence.interpolation_depth (
int
, default:2000
) – The extent of the \(sinc\) function to the left and to the right of the peak.
-
to_text_grid
(self: parselmouth.PointProcess, tier_names: str, point_tiers: str) → parselmouth.TextGrid¶ Convert into a TextGrid.
PointProcess object is converted to a sound object by genering a pulse at every point in the point process. This pulse is filtered at the Nyquist frequency of the resulting Sound by converting it into a sampled sinc function.
- Parameters
See also
-
to_text_grid_vuv
(self: parselmouth.PointProcess, maximum_period: float = 0.02, mean_period: float = 0.01) → parselmouth.TextGrid¶ Convert into a Sound with voiced/unvoiced information.
PointProcess object is converted to a sound object with voiced/unvoiced information.
- Parameters
maximum_period (
float
, default:0.02
) – The maximum interval that will be consider part of a larger voiced interval.mean_period (
float
, default:0.01
) – Half of this value will be taken to be the amount to which a voiced interval will extend beyond its initial and final points. Mean period should be less than Maximum period, or you may get intervals with negative durations.
-
transplant_domain
(self: parselmouth.PointProcess, sound: parselmouth.Sound) → None¶ Copy time domain.
Copy the time domain of the specified
Sound
object.- Parameters
sound (
parselmouth.Sound
) – Source sound object.
-
union
(self: parselmouth.PointProcess, other: parselmouth.PointProcess) → parselmouth.PointProcess¶ Combine with another time process.
Returns a new
PointProcess
instance containing all the points of the two original point processes, sorted by time.- Parameters
other (
parselmouth.PointProcess
) – The other PointProcess object to combine withself
.
See also
-
voice
(self: parselmouth.PointProcess, period: Positive[float] = 0.01, maximum_voiced_period: Positive[float] = 0.02000000001) → None¶ Add equispaced time points in unvoiced intervals.
Add equispaced time points separated by the specified period over all existing periods longer than
maximum_voiced_period
.
-
property
n_points
¶
-
-
class
parselmouth.
Sampled
¶ Bases:
parselmouth.Function
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
__len__
(self: parselmouth.Sampled) → int¶
-
x_bins
(self: parselmouth.Sampled) → numpy.ndarray[numpy.float64]¶
-
x_grid
(self: parselmouth.Sampled) → numpy.ndarray[numpy.float64]¶
-
xs
(self: parselmouth.Sampled) → numpy.ndarray[numpy.float64]¶
-
property
dx
¶
-
property
nx
¶
-
property
x1
¶
-
-
class
parselmouth.
SampledXY
¶ Bases:
parselmouth.Sampled
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
y_bins
(self: parselmouth.SampledXY) → numpy.ndarray[numpy.float64]¶
-
y_grid
(self: parselmouth.SampledXY) → numpy.ndarray[numpy.float64]¶
-
ys
(self: parselmouth.SampledXY) → numpy.ndarray[numpy.float64]¶
-
property
dy
¶
-
property
ny
¶
-
property
y1
¶
-
property
ymax
¶
-
property
ymin
¶
-
property
yrange
¶
-
-
class
parselmouth.
SignalOutsideTimeDomain
¶ Bases:
pybind11_builtins.pybind11_object
-
__init__
(self: parselmouth.SignalOutsideTimeDomain, value: int) → None¶ -
__init__
(self: parselmouth.SignalOutsideTimeDomain, arg0: str) → None
-
__int__
(self: parselmouth.SignalOutsideTimeDomain) → int¶
-
__str__
()¶ name(self: handle) -> str
-
SIMILAR
= <SignalOutsideTimeDomain.SIMILAR: 2>¶
-
ZERO
= <SignalOutsideTimeDomain.ZERO: 1>¶
-
property
name
¶
-
property
value
¶
-
-
class
parselmouth.
Sound
¶ Bases:
parselmouth.TimeFrameSampled
,parselmouth.Vector
-
class
Channel
¶ Bases:
pybind11_builtins.pybind11_object
-
__init__
(self: parselmouth.Sound.Channel, value: int) → None¶ -
__init__
(self: parselmouth.Sound.Channel, arg0: str) → None
-
__int__
(self: parselmouth.Sound.Channel) → int¶
-
__str__
()¶ name(self: handle) -> str
-
LEFT
= <Channel.LEFT: 1>¶
-
RIGHT
= <Channel.RIGHT: 2>¶
-
property
name
¶
-
property
value
¶
-
-
class
ToHarmonicityMethod
¶ Bases:
pybind11_builtins.pybind11_object
-
__init__
(self: parselmouth.Sound.ToHarmonicityMethod, value: int) → None¶ -
__init__
(self: parselmouth.Sound.ToHarmonicityMethod, arg0: str) → None
-
__int__
(self: parselmouth.Sound.ToHarmonicityMethod) → int¶
-
__str__
()¶ name(self: handle) -> str
-
AC
= <ToHarmonicityMethod.AC: 1>¶
-
CC
= <ToHarmonicityMethod.CC: 0>¶
-
GNE
= <ToHarmonicityMethod.GNE: 2>¶
-
property
name
¶
-
property
value
¶
-
-
class
ToPitchMethod
¶ Bases:
pybind11_builtins.pybind11_object
-
__init__
(self: parselmouth.Sound.ToPitchMethod, value: int) → None¶ -
__init__
(self: parselmouth.Sound.ToPitchMethod, arg0: str) → None
-
__int__
(self: parselmouth.Sound.ToPitchMethod) → int¶
-
__str__
()¶ name(self: handle) -> str
-
AC
= <ToPitchMethod.AC: 0>¶
-
CC
= <ToPitchMethod.CC: 1>¶
-
SHS
= <ToPitchMethod.SHS: 3>¶
-
SPINET
= <ToPitchMethod.SPINET: 2>¶
-
property
name
¶
-
property
value
¶
-
-
__init__
(self: parselmouth.Sound, other: parselmouth.Sound) → None¶ -
__init__
(self: parselmouth.Sound, values: numpy.ndarray[numpy.float64], sampling_frequency: Positive[float] = 44100.0, start_time: float = 0.0) → None -
__init__
(self: parselmouth.Sound, file_path: str) → None
-
autocorrelate
(self: parselmouth.Sound, scaling: parselmouth.AmplitudeScaling = <AmplitudeScaling.PEAK_0_99: 4>, signal_outside_time_domain: parselmouth.SignalOutsideTimeDomain = <SignalOutsideTimeDomain.ZERO: 1>) → parselmouth.Sound¶
-
static
combine_to_stereo
(sounds: List[parselmouth.Sound]) → parselmouth.Sound¶
-
static
concatenate
(sounds: List[parselmouth.Sound], overlap: NonNegative[float] = 0.0) → parselmouth.Sound¶
-
convert_to_mono
(self: parselmouth.Sound) → parselmouth.Sound¶
-
convert_to_stereo
(self: parselmouth.Sound) → parselmouth.Sound¶
-
convolve
(self: parselmouth.Sound, other: parselmouth.Sound, scaling: parselmouth.AmplitudeScaling = <AmplitudeScaling.PEAK_0_99: 4>, signal_outside_time_domain: parselmouth.SignalOutsideTimeDomain = <SignalOutsideTimeDomain.ZERO: 1>) → parselmouth.Sound¶
-
cross_correlate
(self: parselmouth.Sound, other: parselmouth.Sound, scaling: parselmouth.AmplitudeScaling = <AmplitudeScaling.PEAK_0_99: 4>, signal_outside_time_domain: parselmouth.SignalOutsideTimeDomain = <SignalOutsideTimeDomain.ZERO: 1>) → parselmouth.Sound¶
-
de_emphasize
(self: parselmouth.Sound, from_frequency: float = 50.0, normalize: bool = True) → None¶
-
deepen_band_modulation
(self: parselmouth.Sound, enhancement: Positive[float] = 20.0, from_frequency: Positive[float] = 300.0, to_frequency: Positive[float] = 8000.0, slow_modulation: Positive[float] = 3.0, fast_modulation: Positive[float] = 30.0, band_smoothing: Positive[float] = 100.0) → parselmouth.Sound¶
-
extract_all_channels
(self: parselmouth.Sound) → List[parselmouth.Sound]¶
-
extract_channel
(self: parselmouth.Sound, channel: int) → parselmouth.Sound¶ -
extract_channel
(self: parselmouth.Sound, arg0: str) → parselmouth.Sound
-
extract_left_channel
(self: parselmouth.Sound) → parselmouth.Sound¶
-
extract_part
(self: parselmouth.Sound, from_time: Optional[float] = None, to_time: Optional[float] = None, window_shape: parselmouth.WindowShape = <WindowShape.RECTANGULAR: 0>, relative_width: Positive[float] = 1.0, preserve_times: bool = False) → parselmouth.Sound¶
-
extract_part_for_overlap
(self: parselmouth.Sound, from_time: Optional[float] = None, to_time: Optional[float] = None, overlap: Positive[float]) → parselmouth.Sound¶
-
extract_right_channel
(self: parselmouth.Sound) → parselmouth.Sound¶
-
get_energy
(self: parselmouth.Sound, from_time: Optional[float] = None, to_time: Optional[float] = None) → float¶
-
get_energy_in_air
(self: parselmouth.Sound) → float¶
-
get_index_from_time
(self: parselmouth.Sound, time: float) → float¶
-
get_intensity
(self: parselmouth.Sound) → float¶
-
get_nearest_zero_crossing
(self: parselmouth.Sound, time: float, channel: int = 1) → float¶
-
get_number_of_channels
(self: parselmouth.Sound) → int¶
-
get_number_of_samples
(self: parselmouth.Sound) → int¶
-
get_power
(self: parselmouth.Sound, from_time: Optional[float] = None, to_time: Optional[float] = None) → float¶
-
get_power_in_air
(self: parselmouth.Sound) → float¶
-
get_rms
(self: parselmouth.Sound, from_time: Optional[float] = None, to_time: Optional[float] = None) → float¶
-
get_root_mean_square
(self: parselmouth.Sound, from_time: Optional[float] = None, to_time: Optional[float] = None) → float¶
-
get_sampling_frequency
(self: parselmouth.Sound) → float¶
-
get_sampling_period
(self: parselmouth.Sound) → float¶
-
get_time_from_index
(self: parselmouth.Sound, sample: int) → float¶
-
lengthen
(self: parselmouth.Sound, minimum_pitch: Positive[float] = 75.0, maximum_pitch: Positive[float] = 600.0, factor: Positive[float]) → parselmouth.Sound¶
-
multiply_by_window
(self: parselmouth.Sound, window_shape: parselmouth.WindowShape) → None¶
-
override_sampling_frequency
(self: parselmouth.Sound, new_frequency: Positive[float]) → None¶
-
pre_emphasize
(self: parselmouth.Sound, from_frequency: float = 50.0, normalize: bool = True) → None¶
-
resample
(self: parselmouth.Sound, new_frequency: float, precision: int = 50) → parselmouth.Sound¶
-
reverse
(self: parselmouth.Sound, from_time: Optional[float] = None, to_time: Optional[float] = None) → None¶
-
save
(self: parselmouth.Sound, file_path: str, format: parselmouth.SoundFileFormat) → None¶
-
scale_intensity
(self: parselmouth.Sound, new_average_intensity: float) → None¶
-
set_to_zero
(self: parselmouth.Sound, from_time: Optional[float] = None, to_time: Optional[float] = None, round_to_nearest_zero_crossing: bool = True) → None¶
-
to_formant_burg
(self: parselmouth.Sound, time_step: Optional[Positive[float]] = None, max_number_of_formants: Positive[float] = 5.0, maximum_formant: float = 5500.0, window_length: Positive[float] = 0.025, pre_emphasis_from: Positive[float] = 50.0) → parselmouth.Formant¶
-
to_harmonicity
(self: parselmouth.Sound, method: parselmouth.Sound.ToHarmonicityMethod = <ToHarmonicityMethod.CC: 0>, *args, **kwargs) → object¶
-
to_harmonicity_ac
(self: parselmouth.Sound, time_step: Positive[float] = 0.01, minimum_pitch: Positive[float] = 75.0, silence_threshold: float = 0.1, periods_per_window: Positive[float] = 1.0) → parselmouth.Harmonicity¶
-
to_harmonicity_cc
(self: parselmouth.Sound, time_step: Positive[float] = 0.01, minimum_pitch: Positive[float] = 75.0, silence_threshold: float = 0.1, periods_per_window: Positive[float] = 1.0) → parselmouth.Harmonicity¶
-
to_harmonicity_gne
(self: parselmouth.Sound, minimum_frequency: Positive[float] = 500.0, maximum_frequency: Positive[float] = 4500.0, bandwidth: Positive[float] = 1000.0, step: Positive[float] = 80.0) → parselmouth.Matrix¶
-
to_intensity
(self: parselmouth.Sound, minimum_pitch: Positive[float] = 100.0, time_step: Optional[Positive[float]] = None, subtract_mean: bool = True) → parselmouth.Intensity¶
-
to_mfcc
(self: parselmouth.Sound, number_of_coefficients: Positive[int] = 12, window_length: Positive[float] = 0.015, time_step: Positive[float] = 0.005, firstFilterFreqency: Positive[float] = 100.0, distance_between_filters: Positive[float] = 100.0, maximum_frequency: Optional[Positive[float]] = None) → parselmouth.MFCC¶
-
to_pitch
(self: parselmouth.Sound, time_step: Optional[Positive[float]] = None, pitch_floor: Positive[float] = 75.0, pitch_ceiling: Positive[float] = 600.0) → parselmouth.Pitch¶ -
to_pitch
(self: parselmouth.Sound, method: parselmouth.Sound.ToPitchMethod, *args, **kwargs) → object
-
to_pitch_ac
(self: parselmouth.Sound, time_step: Optional[Positive[float]] = None, pitch_floor: Positive[float] = 75.0, max_number_of_candidates: Positive[int] = 15, very_accurate: bool = False, silence_threshold: float = 0.03, voicing_threshold: float = 0.45, octave_cost: float = 0.01, octave_jump_cost: float = 0.35, voiced_unvoiced_cost: float = 0.14, pitch_ceiling: Positive[float] = 600.0) → parselmouth.Pitch¶
-
to_pitch_cc
(self: parselmouth.Sound, time_step: Optional[Positive[float]] = None, pitch_floor: Positive[float] = 75.0, max_number_of_candidates: Positive[int] = 15, very_accurate: bool = False, silence_threshold: float = 0.03, voicing_threshold: float = 0.45, octave_cost: float = 0.01, octave_jump_cost: float = 0.35, voiced_unvoiced_cost: float = 0.14, pitch_ceiling: Positive[float] = 600.0) → parselmouth.Pitch¶
-
to_pitch_shs
(self: parselmouth.Sound, time_step: Positive[float] = 0.01, minimum_pitch: Positive[float] = 50.0, max_number_of_candidates: Positive[int] = 15, maximum_frequency_component: Positive[float] = 1250.0, max_number_of_subharmonics: Positive[int] = 15, compression_factor: Positive[float] = 0.84, ceiling: Positive[float] = 600.0, number_of_points_per_octave: Positive[int] = 48) → parselmouth.Pitch¶
-
to_pitch_spinet
(self: parselmouth.Sound, time_step: Positive[float] = 0.005, window_length: Positive[float] = 0.04, minimum_filter_frequency: Positive[float] = 70.0, maximum_filter_frequency: Positive[float] = 5000.0, number_of_filters: Positive[int] = 250, ceiling: Positive[float] = 500.0, max_number_of_candidates: Positive[int] = 15) → parselmouth.Pitch¶
-
to_point_process_extrema
(self: parselmouth.Sound, channel: parselmouth.Sound.Channel = <Channel.LEFT: 1>, include_maxima: bool = True, include_minima: bool = False, interpolation: parselmouth.PeakInterpolation = <PeakInterpolation.SINC70: 3>) → parselmouth.PointProcess¶ Create a
PointProcess
by peak picking.Returns a new
PointProcess
instance by peak-picking the acoustic sample without pitch estimation.- Parameters
channel (
{"LEFT", "RIGHT"}
, default:"LEFT"
(first channel)) – Sound channel to process.include_maxima (
bool
, default:True
) – True to include the absolute maximum.include_minima (
bool
, default:False
) – True to include the absolute minimum.interpolation (
{"NONE", "PARABOLIC", "CUBIC", "SINC70", "SINC700"}
,
) – default: “SINC70” Peak-picking interpolation method.
-
to_point_process_periodic
(self: parselmouth.Sound, minimum_pitch: float = 75.0, maximum_pitch: float = 600.0) → parselmouth.PointProcess¶ Create PointProcess by cross-correlation.
Returns a new PointProcess instance using the pitch estimation algorithm in
to_pitch_cc()
and the voice cycle detection algorithm into_point_process_cc()
.- Parameters
See also
Praat: “Sound: To PointProcess (periodic, cc)…” parselmouth.PointProcess parselmouth.Sound.to_pitch_cc, parselmouth.Pitch.to_point_process_peaks
-
to_point_process_periodic_peaks
(self: parselmouth.Sound, minimum_pitch: float = 75.0, maximum_pitch: float = 600.0, include_maxima: bool = True, include_minima: bool = False) → parselmouth.PointProcess¶ Create a
PointProcess
by peak picking with pitch estimation.Returns a new
PointProcess
instance using the pitch estimation algorithm inSound.to_pitch_cc
and the voice cycle detection algorithm inPitch.to_point_process_peaks
.- Parameters
minimum_pitch (
float
, default:75.0
) – Minimum fundamental frequency to be consideredmaximum_pitch (
float
, default:600.0
) – Maximum fundamental frequency to be consideredinclude_maxima (
bool
, default:True
) – True to include the absolute maximuminclude_minima (
bool
, default:False
) – True to include the absolute minimum
See also
Praat: “Sound: To PointProcess (periodic, peaks)…” parselmouth.PointProcess parselmouth.Sound.to_pitch_cc, parselmouth.Pitch.to_point_process_peaks
-
to_point_process_zeros
(self: parselmouth.Sound, channel: parselmouth.Sound.Channel = <Channel.LEFT: 1>, include_raisers: bool = True, include_fallers: bool = False) → parselmouth.PointProcess¶ Create a
PointProcess
by zero-crossing detection.Returns a new
PointProcess
instance by detecting rising or falling edges in the sound waveform. Linear interpolation is used to refine the timing of the crossing.- Parameters
See also
-
to_spectrogram
(self: parselmouth.Sound, window_length: Positive[float] = 0.005, maximum_frequency: Positive[float] = 5000.0, time_step: Positive[float] = 0.002, frequency_step: Positive[float] = 20.0, window_shape: parselmouth.SpectralAnalysisWindowShape = <SpectralAnalysisWindowShape.GAUSSIAN: 5>) → parselmouth.Spectrogram¶
-
to_spectrum
(self: parselmouth.Sound, fast: bool = True) → parselmouth.Spectrum¶
-
property
n_channels
¶
-
property
n_samples
¶
-
property
sampling_frequency
¶
-
property
sampling_period
¶
-
class
-
class
parselmouth.
SoundFileFormat
¶ Bases:
pybind11_builtins.pybind11_object
-
__init__
(self: parselmouth.SoundFileFormat, value: int) → None¶ -
__init__
(self: parselmouth.SoundFileFormat, arg0: str) → None
-
__int__
(self: parselmouth.SoundFileFormat) → int¶
-
__str__
()¶ name(self: handle) -> str
-
AIFC
= <SoundFileFormat.AIFC: 2>¶
-
AIFF
= <SoundFileFormat.AIFF: 1>¶
-
FLAC
= <SoundFileFormat.FLAC: 5>¶
-
KAY
= <SoundFileFormat.KAY: 6>¶
-
NEXT_SUN
= <SoundFileFormat.NEXT_SUN: 3>¶
-
NIST
= <SoundFileFormat.NIST: 4>¶
-
RAW_16_BE
= <SoundFileFormat.RAW_16_BE: 12>¶
-
RAW_16_LE
= <SoundFileFormat.RAW_16_LE: 13>¶
-
RAW_24_BE
= <SoundFileFormat.RAW_24_BE: 14>¶
-
RAW_24_LE
= <SoundFileFormat.RAW_24_LE: 15>¶
-
RAW_32_BE
= <SoundFileFormat.RAW_32_BE: 16>¶
-
RAW_32_LE
= <SoundFileFormat.RAW_32_LE: 17>¶
-
RAW_8_SIGNED
= <SoundFileFormat.RAW_8_SIGNED: 10>¶
-
RAW_8_UNSIGNED
= <SoundFileFormat.RAW_8_UNSIGNED: 11>¶
-
SESAM
= <SoundFileFormat.SESAM: 7>¶
-
WAV
= <SoundFileFormat.WAV: 0>¶
-
WAV_24
= <SoundFileFormat.WAV_24: 8>¶
-
WAV_32
= <SoundFileFormat.WAV_32: 9>¶
-
property
name
¶
-
property
value
¶
-
-
class
parselmouth.
SpectralAnalysisWindowShape
¶ Bases:
pybind11_builtins.pybind11_object
-
__init__
(self: parselmouth.SpectralAnalysisWindowShape, value: int) → None¶ -
__init__
(self: parselmouth.SpectralAnalysisWindowShape, arg0: str) → None
-
__int__
(self: parselmouth.SpectralAnalysisWindowShape) → int¶
-
__str__
()¶ name(self: handle) -> str
-
BARTLETT
= <SpectralAnalysisWindowShape.BARTLETT: 2>¶
-
GAUSSIAN
= <SpectralAnalysisWindowShape.GAUSSIAN: 5>¶
-
HAMMING
= <SpectralAnalysisWindowShape.HAMMING: 1>¶
-
HANNING
= <SpectralAnalysisWindowShape.HANNING: 4>¶
-
SQUARE
= <SpectralAnalysisWindowShape.SQUARE: 0>¶
-
WELCH
= <SpectralAnalysisWindowShape.WELCH: 3>¶
-
property
name
¶
-
property
value
¶
-
-
class
parselmouth.
Spectrogram
¶ Bases:
parselmouth.TimeFrameSampled
,parselmouth.Matrix
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
get_power_at
(self: parselmouth.Spectrogram, time: float, frequency: float) → float¶
-
synthesize_sound
(self: parselmouth.Spectrogram, sampling_frequency: Positive[float] = 44100.0) → parselmouth.Sound¶
-
to_sound
(self: parselmouth.Spectrogram, sampling_frequency: Positive[float] = 44100.0) → parselmouth.Sound¶
-
to_spectrum_slice
(self: parselmouth.Spectrogram, time: float) → parselmouth.Spectrum¶
-
-
class
parselmouth.
Spectrum
¶ Bases:
parselmouth.Matrix
-
__getitem__
(self: parselmouth.Spectrum, index: int) → complex¶
-
__init__
(self: parselmouth.Spectrum, values: numpy.ndarray[numpy.float64], maximum_frequency: Positive[float]) → None¶ -
__init__
(self: parselmouth.Spectrum, values: numpy.ndarray[numpy.complex128], maximum_frequency: Positive[float]) → None
-
__setitem__
(self: parselmouth.Spectrum, index: int, value: complex) → None¶
-
cepstral_smoothing
(self: parselmouth.Spectrum, bandwidth: Positive[float] = 500.0) → parselmouth.Spectrum¶
-
get_band_density
(self: parselmouth.Spectrum, band_floor: Optional[float] = None, band_ceiling: Optional[float] = None) → float¶ -
get_band_density
(self: parselmouth.Spectrum, band: Tuple[Optional[float], Optional[float]] = (None, None)) → float
-
get_band_density_difference
(self: parselmouth.Spectrum, low_band_floor: Optional[float] = None, low_band_ceiling: Optional[float] = None, high_band_floor: Optional[float] = None, high_band_ceiling: Optional[float] = None) → float¶ -
get_band_density_difference
(self: parselmouth.Spectrum, low_band: Tuple[Optional[float], Optional[float]] = (None, None), high_band: Tuple[Optional[float], Optional[float]] = (None, None)) → float
-
get_band_energy
(self: parselmouth.Spectrum, band_floor: Optional[float] = None, band_ceiling: Optional[float] = None) → float¶ -
get_band_energy
(self: parselmouth.Spectrum, band: Tuple[Optional[float], Optional[float]] = (None, None)) → float
-
get_band_energy_difference
(self: parselmouth.Spectrum, low_band_floor: Optional[float] = None, low_band_ceiling: Optional[float] = None, high_band_floor: Optional[float] = None, high_band_ceiling: Optional[float] = None) → float¶ -
get_band_energy_difference
(self: parselmouth.Spectrum, low_band: Tuple[Optional[float], Optional[float]] = (None, None), high_band: Tuple[Optional[float], Optional[float]] = (None, None)) → float
-
get_bin_number_from_frequency
(self: parselmouth.Spectrum, frequency: float) → float¶
-
get_bin_width
(self: parselmouth.Spectrum) → float¶
-
get_center_of_gravity
(self: parselmouth.Spectrum, power: Positive[float] = 2.0) → float¶
-
get_central_moment
(self: parselmouth.Spectrum, moment: Positive[float], power: Positive[float] = 2.0) → float¶
-
get_centre_of_gravity
(self: parselmouth.Spectrum, power: Positive[float] = 2.0) → float¶
-
get_frequency_from_bin_number
(self: parselmouth.Spectrum, band_number: Positive[int]) → float¶
-
get_highest_frequency
(self: parselmouth.Spectrum) → float¶
-
get_imaginary_value_in_bin
(self: parselmouth.Spectrum, bin_number: Positive[int]) → float¶
-
get_kurtosis
(self: parselmouth.Spectrum, power: Positive[float] = 2.0) → float¶
-
get_lowest_frequency
(self: parselmouth.Spectrum) → float¶
-
get_number_of_bins
(self: parselmouth.Spectrum) → int¶
-
get_real_value_in_bin
(self: parselmouth.Spectrum, bin_number: Positive[int]) → float¶
-
get_skewness
(self: parselmouth.Spectrum, power: Positive[float] = 2.0) → float¶
-
get_standard_deviation
(self: parselmouth.Spectrum, power: Positive[float] = 2.0) → float¶
-
get_value_in_bin
(self: parselmouth.Spectrum, bin_number: Positive[int]) → complex¶
-
lpc_smoothing
(self: parselmouth.Spectrum, num_peaks: Positive[int] = 5, pre_emphasis_from: Positive[float] = 50.0) → parselmouth.Spectrum¶
-
set_imaginary_value_in_bin
(self: parselmouth.Spectrum, bin_number: Positive[int], value: float) → None¶
-
set_real_value_in_bin
(self: parselmouth.Spectrum, bin_number: Positive[int], value: float) → None¶
-
set_value_in_bin
(self: parselmouth.Spectrum, bin_number: Positive[int], value: complex) → None¶
-
to_sound
(self: parselmouth.Spectrum) → parselmouth.Sound¶
-
to_spectrogram
(self: parselmouth.Spectrum) → parselmouth.Spectrogram¶
-
property
bin_width
¶
-
property
df
¶
-
property
fmax
¶
-
property
fmin
¶
-
property
highest_frequency
¶
-
property
lowest_frequency
¶
-
property
n_bins
¶
-
property
nf
¶
-
-
class
parselmouth.
TextGrid
¶ Bases:
parselmouth.Function
-
__init__
(self: parselmouth.TextGrid, start_time: float, end_time: float, tier_names: str, point_tier_names: str) → None¶ -
__init__
(self: parselmouth.TextGrid, start_time: float, end_time: float, tier_names: List[str] = [], point_tier_names: List[str] = []) → None -
__init__
(self: parselmouth.TextGrid, tgt_text_grid: tgt.core.TextGrid) → None
-
static
from_tgt
(tgt_text_grid: tgt.core.TextGrid) → parselmouth.TextGrid¶
-
to_tgt
(self: parselmouth.TextGrid, *, include_empty_intervals: bool = False) → tgt.core.TextGrid¶
-
-
class
parselmouth.
Thing
¶ Bases:
pybind11_builtins.pybind11_object
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
__str__
(self: parselmouth.Thing) → str¶
-
info
(self: parselmouth.Thing) → str¶
-
property
class_name
¶
-
property
full_name
¶
-
property
name
¶
-
-
class
parselmouth.
TimeFrameSampled
¶ Bases:
parselmouth.TimeFunction
,parselmouth.Sampled
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
frame_number_to_time
(self: parselmouth.Sampled, frame_number: Positive[int]) → float¶
-
get_frame_number_from_time
(self: parselmouth.Sampled, time: float) → float¶
-
get_number_of_frames
(self: parselmouth.Sampled) → int¶
-
get_time_from_frame_number
(self: parselmouth.Sampled, frame_number: Positive[int]) → float¶
-
get_time_step
(self: parselmouth.Sampled) → float¶
-
t_bins
(self: parselmouth.Sampled) → numpy.ndarray[numpy.float64]¶
-
t_grid
(self: parselmouth.Sampled) → numpy.ndarray[numpy.float64]¶
-
time_to_frame_number
(self: parselmouth.Sampled, time: float) → float¶
-
ts
(self: parselmouth.Sampled) → numpy.ndarray[numpy.float64]¶
-
property
dt
¶
-
property
n_frames
¶
-
property
nt
¶
-
property
t1
¶
-
property
time_step
¶
-
-
class
parselmouth.
TimeFunction
¶ Bases:
parselmouth.Function
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
get_end_time
(self: parselmouth.Function) → float¶
-
get_start_time
(self: parselmouth.Function) → float¶
-
get_total_duration
(self: parselmouth.Function) → float¶
-
scale_times_by
(self: parselmouth.Function, scale: Positive[float]) → None¶
-
scale_times_to
(self: parselmouth.Function, new_start_time: float, new_end_time: float) → None¶
-
shift_times_by
(self: parselmouth.Function, seconds: float) → None¶
-
shift_times_to
(self: parselmouth.Function, time: float, new_time: float) → None¶ -
shift_times_to
(self: parselmouth.Function, time: str, new_time: float) → None
-
property
centre_time
¶
-
property
duration
¶
-
property
end_time
¶
-
property
start_time
¶
-
property
time_range
¶
-
property
tmax
¶
-
property
tmin
¶
-
property
total_duration
¶
-
property
trange
¶
-
-
class
parselmouth.
ValueInterpolation
¶ Bases:
pybind11_builtins.pybind11_object
-
__init__
(self: parselmouth.ValueInterpolation, value: int) → None¶ -
__init__
(self: parselmouth.ValueInterpolation, arg0: str) → None
-
__int__
(self: parselmouth.ValueInterpolation) → int¶
-
__str__
()¶ name(self: handle) -> str
-
CUBIC
= <ValueInterpolation.CUBIC: 2>¶
-
LINEAR
= <ValueInterpolation.LINEAR: 1>¶
-
NEAREST
= <ValueInterpolation.NEAREST: 0>¶
-
SINC70
= <ValueInterpolation.SINC70: 3>¶
-
SINC700
= <ValueInterpolation.SINC700: 4>¶
-
property
name
¶
-
property
value
¶
-
-
class
parselmouth.
Vector
¶ Bases:
parselmouth.Matrix
-
__add__
(self: parselmouth.Vector, number: float) → parselmouth.Vector¶
-
__iadd__
(self: parselmouth.Vector, number: float) → parselmouth.Vector¶
-
__imul__
(self: parselmouth.Vector, factor: float) → parselmouth.Vector¶
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
__isub__
(self: parselmouth.Vector, number: float) → parselmouth.Vector¶
-
__itruediv__
(self: parselmouth.Vector, factor: float) → parselmouth.Vector¶
-
__mul__
(self: parselmouth.Vector, factor: float) → parselmouth.Vector¶
-
__radd__
(self: parselmouth.Vector, number: float) → parselmouth.Vector¶
-
__rmul__
(self: parselmouth.Vector, factor: float) → parselmouth.Vector¶
-
__sub__
(self: parselmouth.Vector, number: float) → parselmouth.Vector¶
-
__truediv__
(self: parselmouth.Vector, factor: float) → parselmouth.Vector¶
-
add
(self: parselmouth.Vector, number: float) → None¶
-
divide
(self: parselmouth.Vector, factor: float) → None¶
-
get_value
(self: parselmouth.Vector, x: float, channel: Optional[int] = None, interpolation: parselmouth.ValueInterpolation = <ValueInterpolation.CUBIC: 2>) → float¶
-
multiply
(self: parselmouth.Vector, factor: float) → None¶
-
scale
(self: parselmouth.Vector, scale: Positive[float]) → None¶
-
scale_peak
(self: parselmouth.Vector, new_peak: Positive[float] = 0.99) → None¶
-
subtract
(self: parselmouth.Vector, number: float) → None¶
-
subtract_mean
(self: parselmouth.Vector) → None¶
-
-
class
parselmouth.
WindowShape
¶ Bases:
pybind11_builtins.pybind11_object
-
__init__
(self: parselmouth.WindowShape, value: int) → None¶ -
__init__
(self: parselmouth.WindowShape, arg0: str) → None
-
__int__
(self: parselmouth.WindowShape) → int¶
-
__str__
()¶ name(self: handle) -> str
-
GAUSSIAN1
= <WindowShape.GAUSSIAN1: 5>¶
-
GAUSSIAN2
= <WindowShape.GAUSSIAN2: 6>¶
-
GAUSSIAN3
= <WindowShape.GAUSSIAN3: 7>¶
-
GAUSSIAN4
= <WindowShape.GAUSSIAN4: 8>¶
-
GAUSSIAN5
= <WindowShape.GAUSSIAN5: 9>¶
-
HAMMING
= <WindowShape.HAMMING: 4>¶
-
HANNING
= <WindowShape.HANNING: 3>¶
-
KAISER1
= <WindowShape.KAISER1: 10>¶
-
KAISER2
= <WindowShape.KAISER2: 11>¶
-
PARABOLIC
= <WindowShape.PARABOLIC: 2>¶
-
RECTANGULAR
= <WindowShape.RECTANGULAR: 0>¶
-
TRIANGULAR
= <WindowShape.TRIANGULAR: 1>¶
-
property
name
¶
-
property
value
¶
-
-
parselmouth.
read
(file_path: str) → parselmouth.Data¶ Read a file into a
parselmouth.Data
object.- Parameters
file_path (
str
) – The path of the file on disk to read.- Returns
The Praat Data object that was read.
- Return type
See also
-
parselmouth.praat.
call
(command: str, *args, **kwargs) → object¶ -
parselmouth.praat.
call
(object: parselmouth.Data, command: str, *args, **kwargs) → object -
parselmouth.praat.
call
(objects: List[parselmouth.Data], command: str, *args, **kwargs) → object Call a Praat command.
This function provides a Python interface to call available Praat commands based on the label in the Praat user interface and documentation, similar to the Praat scripting language.
Calling a Praat command through this function roughly corresponds to the following scenario in the Praat user interface or scripting language:
Zero, one, or multiple
parselmouth.Data
objects are put into Praat’s global object list and are ‘selected’.The Python argument values are converted into Praat values; see below.
The Praat command is executed on the selected objects with the converted values as arguments.
The result of the command is returned. The type of the result depends on the result of the Praat command; see below.
Praat’s object list is emptied again, such that a future execution of this function is independent from the current call.
The use of
call
is demonstrated in the Pitch manipulation and Praat commands example.- Parameters
object (
parselmouth.Data
) – A single object to add to the Praat object list, which will be selected when the Praat command is called.objects (
list
ofparselmouth.Data
) – Multiple objects to be added to the Praat object list, which will be selected when the Praat command is called.command (
str
) – The Praat action to call. This is the same command name as one would use in a Praat script and corresponds to the label on the button in the Praat user interface.*args –
The list of values to be passed as arguments to the Praat command. Allowed types for these arguments are:
bool
: converted into"yes"
/"no"
str
: passed as Praat string valuenumpy.ndarray
: passed as Praat vector or matrix, if the array contains numeric values and is 1D or 2D, respectively.
- Keyword Arguments
extra_objects (
list
ofparselmouth.Data
, default:[]
) – Extra objects added to the Praat object list that will not be selected when the command is called.return_string (
bool
, default:False
) – Return the raw string written in the Praat info window instead of the converted Python object.
- Returns
The result of the Praat command. The actual value returned depends on what the Praat command does. The following types can be returned:
If
return_string=True
was passed, astr
value is returned, which contains the text that would have been written to the Praat info window.A
float
,int
,bool
, orcomplex
value is returned when the Praat command would write such a value to the Praat info window.A
numpy.ndarray
value is returned if the command returns a Praat vector or matrix.A
parselmouth.Data
object is returned if the command always creates exactly one object. If the actual type of the Praat object is available in Parselmouth, an object of a subtype ofparselmouth.Data
is returned.A list of
parselmouth.Data
objects is returned if the command can create multiple new objects (even if this particular execution of the command only added one object to the Praat object list).A
str
is returned when a string or info text would be written to the Praat info window.
- Return type
-
parselmouth.praat.
run
(script: str, *args, **kwargs) → object¶ -
parselmouth.praat.
run
(object: parselmouth.Data, script: str, *args, **kwargs) → object -
parselmouth.praat.
run
(objects: List[parselmouth.Data], script: str, *args, **kwargs) → object Run a Praat script.
Given a string with the contents of a Praat script, run this script as if it was run inside Praat itself. Similarly to
parselmouth.praat.call
, Parselmouth objects and Python argument values can be passed into the script.Calling this function roughly corresponds to the following sequence of steps in Praat:
Zero, one, or multiple
parselmouth.Data
objects are put into Praat’s global object list and are ‘selected’.The Python argument values are converted into Praat values; see
call
.The Praat script is opened and run with the converted values as arguments; see Praat: “Scripting 6.1. Arguments to the script”.
The results of the execution of the script are returned; see below.
Praat’s object list is emptied again, such that a future execution of this function is independent from the current call.
Note that the script will be run in Praat’s so-called ‘batch’ mode; see Praat: “Scripting 6.9. Calling from the command line”. Since the script is run from inside a Python program, the Praat functionality is run without graphical user interface and no windows (such as “View & Edit”) can be opened by the Praat script. However, the functionality in these windows is also available in different ways: for example, opening a Sound object in a “View & Edit” window, making a selection, and choosing “Extract selected sound (windowed)…” can also be achieved by directly using the “Extract part…” command of the Sound object.
- Parameters
object (
parselmouth.Data
) – A single object to add to the Praat object list, which will be selected when the Praat script is run.objects (
list
ofparselmouth.Data
) – Multiple objects to be added to the Praat object list, which will be selected when the Praat script is run.script (
str
) – The content of the Praat script to be run.*args – The list of values to be passed as arguments to the Praat script. For more details on the allowed types of these argument, see
call
.
- Keyword Arguments
extra_objects (
list
ofparselmouth.Data
, default:[]
) – Extra objects added to the Praat object list that will not be selected when the command is called.capture_output (
bool
, default:False
) – Intercept and also return the output written to the Praat info window, instead of forwarding it to the Python standard output; see below.return_variables (
bool
, default:False
) – Also return adict
of the Praat variables and their values at the end of the script’s execution; see below.
- Returns
A list of
parselmouth.Data
objects selected at the end of the script’s execution.Optionally, extra values are returned:
A
str
containing the intercepted output ifcapture_output=True
was passed.A
dict
mapping variable names (str
) to their values (object
) ifreturn_variables
isTrue
. The values of Praat’s variables get converted to Python values:A Praat string variable, with a name ending in
$
, is returned asstr
value.A Praat vector or matrix variable, respectively ending in
#
or##
, is returned asnumpy.ndarray
.A numeric variable, without variable name suffix, is converted to a Python
float
.
- Return type
-
parselmouth.praat.
run_file
(path: str, *args, **kwargs) → object¶ -
parselmouth.praat.
run_file
(object: parselmouth.Data, path: str, *args, **kwargs) → object -
parselmouth.praat.
run_file
(objects: List[parselmouth.Data], path: str, *args, **kwargs) → object Run a Praat script from file.
Given the filename of a Praat script, the script is read and run the same way as a script string passed to
parselmouth.praat.run
. Seerun
for details on the manner in which the script gets executed.One thing to note is that relative filenames in the Praat script (including those in potential ‘include’ statements in the script; see Praat: “Scripting 5.8. Including other scripts”) will be resolved relative to the path of the script file, just like in Praat. Also note that Praat accomplishes this by temporarily changing the current working during the execution of the script.
- Parameters
object (
parselmouth.Data
) – A single object to add to the Praat object list, which will be selected when the Praat script is run.objects (
list
ofparselmouth.Data
) – Multiple objects to be added to the Praat object list, which will be selected when the Praat script is run.path (
str
) – The filename of the Praat script to run.*args – The list of values to be passed as arguments to the Praat script. For more details on the allowed types of these argument, see
call
.
- Keyword Arguments
keep_cwd (
bool
, default:False
) – Keep the current working directory (seeos.getcwd
) when running the script, rather than changing it to the script’s parent directory, as Praat does by default. Note that even when set toTrue
, the filenames in the Praat script’s include statements will be resolved relatively to the directory containing the script.**kwargs – See
parselmouth.praat.run
.
- Returns
- Return type