pytimbre.timbre_features.features.TimbreFeatures

class pytimbre.timbre_features.features.TimbreFeatures

Bases: object

Since there are many different types of features that exist, we will use this class to determine which features are appropriate to use for this analysis. If the system is created from a waveform only, then only the temporal and level metrics that can be calculated will be available. If the system is created from a Spectrum, only those associated with a sound pressure level spectrum will be available. However, a Spectrum can also contain a waveform. So, if a Waveform exists within the Spectrum, the feature available for the Waveform will also be added. The same is then true for the time varying time history.

__init__()

Methods

__init__()

from_spectra(s)

This function performs a similar analysis and will return the data from the appropriate metrics for a spectrum object.

from_time_history(time_history)

This will build the collection of features based on a dictionary that was from each of the spectra within the TimeHistory object, returned as a DataFrame :param time_history: :type time_history: :return: :rtype:

from_waveform(wfm)

This will load the data from the Waveform into the LevelMetrics, TemporalMetrics, and SoundQualityMetrics to determine the list of features that are available.

static from_spectra(s: Spectrum) dict

This function performs a similar analysis and will return the data from the appropriate metrics for a spectrum object. :param s: The spectral data object :type s: Spectrum :return: the timbre features calculated on the spectrum and waveform, if contained within the spectrum. :rtype: dict

static from_time_history(time_history: SpectralTimeHistory) DataFrame

This will build the collection of features based on a dictionary that was from each of the spectra within the TimeHistory object, returned as a DataFrame :param time_history: :type time_history: :return: :rtype:

static from_waveform(wfm: Waveform) dict

This will load the data from the Waveform into the LevelMetrics, TemporalMetrics, and SoundQualityMetrics to determine the list of features that are available. :param wfm: The audio data to use in the creation of the features :type wfm: Waveform :return: A dictionary of the features appropriate and available for a Waveform :rtype: dict