VowelClass

VowelClass(self, label='', vowel_measurements=lambda: []())

A class used to represent a vowel class.

Intended Usage

VowelClass subclasses collections.abc.Sequence, so it is indexable. While it can be created on its own, it is best to leave this up to either VowelClassCollection or SpeakerCollection.

vowel_measurements = [VowelMeasurement(t) for t in fasttrack_tracks]
vowel_class = VowelClass("ay", vowel_measurements)

Parameters

Name Type Description Default
label str The vowel class label ''
tracks list[VowelMeasurement] A list of VowelMeasurements required

Attributes

Name Type Description
label str label of the vowel class
tracks list A list of VowelMeasurements
vowel_system VowelClassCollection The containing vowel system
winners list[OneTrack] A list of winner OneTracks from the vowel class
winner_param NDArray[Shape[Param, Formant, N], Float] An np.array of winner DCT parameters from the vowel class
winner_param_mean NDArray[Shape[ParamFormant, 1], Float] Mean of winner DCT parameters
winner_param_cov NDArray[Shape[ParamFormant, ParamFormant], Float] Covariance of winner DCT parameters
winner_param_icov NDArray[Shape[ParamFormant, ParamFormant], Float] Inverse covariance of winner DCT parameters

Classes

Name Description
containing_class A class used to represent a vowel measurement.

containing_class

VowelClass.containing_class(self, track, heuristic=Heuristic())

A class used to represent a vowel measurement.

Intended Usage

Certain properties of a VowelMeasurement instance are set by its membership within a VowelClass and that VowelClass’s membership in a VowelClassCollection. These memberships are best managed by passing a list of VowelMeasurements to SpeakerCollection.

vowel_measurements = [VowelMeasurement(t) for t in fasttrack_tracks]
speakers = SpeakerCollection(vowel_measurements)

Parameters

Name Type Description Default
track fasttrackpy.CandidateTracks A fasttrackpy.CandidateTrracks object required
heuristic Heuristic A point measurement Heuristic to use. Defaults to Heuristic(). Heuristic()

Attributes

Name Type Description
track fasttrackpy.CandidateTracks an object of CandidateTracks class
candidates list list of candidates for the track
heuristic Heuristic an object of Heuristic class (default is Heuristic())
vowel_class VowelClass The containing VowelClass object
formant_array FormantArray A FormantArray object
file_name str name of the file of the track
group str TierGroup of the track
id str id of the track
interval aligned_textgrid.SequenceInterval interval of the track
label str label of the track
n_formants int number of formants in the track
optimized int The number of optimization iterations the vowel measurement has been through.
winner OneTrack fasttrackpy.OneTrack The winning formant track
winner_index int The index of the winning formant track
cand_param NDArray[Shape[Param, Formant, Cand], Float] A array of the candidate DCT parameters.
cand_maxformant NDArray[Shape[1, Cand], Float] An array of the candidate maximum formants.
cand_error NDArray[Shape[Cand], Float] An array of the candidate smoothing error.
cand_error_logprob_vm NDArray[Shape[Cand], Float] Conversion of the smooth error to log probabilities. The candidate with the lowest error = log(1), and the candidate with the largest error = log(0).
cand_param_(mahal/logprob)_speaker_byvclass NDArray[Shape[Cand], Float] The mahalanobis distance (mahal) or associated log probability (logprob) for each candidate relative to the VowelClass for this speaker. These are calculated by drawing the relevant mean and covariance matrix from vm.vowel_class
cand_param_(mahal/logprob)_speaker_global NDArray[Shape[Cand], Float] The mahalanobis distance (mahal) or associated log probability (logprob) for each candidate relative to all vowel measurements for this speaker. These are calculated by drawing the relevant mean and covariance matrix from vm.vowel_class.vowel_system
cand_param_(mahal/logprob)_corpus_byvclass NDArray[Shape[Cand], Float] The mahalanobis distance (mahal) or associated log probability (logprob) for each candidate relative to this vowel class across all speakers. These are calculated by drawing the relevant mean and covariance matrix from vm.vowel_class.vowel_system.corpus
point_measure pl.DataFrame A polars dataframe of the point measurement for this vowel.
vm_context pl.DataFrame A polars dataframe of contextual information for the vowel measurement.

Methods

Name Description
to_param_df Return DataFrame of formant DCT parameters.
to_point_df Return a DataFrame of point measurements
to_tracks_df Return a DataFrame of the formant tracks
to_param_df

VowelClass.containing_class.to_param_df(output='log_param')

Return DataFrame of formant DCT parameters.

Returns
Type Description
pl.DataFrame A DataFrame of formant DCT parameters
to_point_df

VowelClass.containing_class.to_point_df()

Return a DataFrame of point measurements

Returns
Type Description
pl.DataFrame A DataFrame of vowel point measures.
to_tracks_df

VowelClass.containing_class.to_tracks_df()

Return a DataFrame of the formant tracks

Returns
Type Description
pl.DataFrame A dataframe with formant track data.

Methods

Name Description
to_param_df Return DataFrame of formant DCT parameters.
to_point_df Return a DataFrame of point measurements
to_tracks_df Return DataFrame of formanttracks.

to_param_df

VowelClass.to_param_df(output='log_param')

Return DataFrame of formant DCT parameters.

Returns

Type Description
pl.DataFrame A DataFrame of formant DCT parameters

to_point_df

VowelClass.to_point_df()

Return a DataFrame of point measurements

Returns

Type Description
pl.DataFrame A DataFrame of vowel point measures.

to_tracks_df

VowelClass.to_tracks_df()

Return DataFrame of formanttracks.

Returns

Type Description
pl.DataFrame A DataFrame of formant tracks