msaf.features.CQT

class msaf.features.CQT(file_struct, feat_type, sr=22050, hop_length=1024, n_bins=84, norm=inf, filter_scale=1.0, ref_power='max')[source]

This class contains the implementation of the Constant-Q Transform.

These features contain both harmonic and timbral content of the given audio signal.

__init__(file_struct, feat_type, sr=22050, hop_length=1024, n_bins=84, norm=inf, filter_scale=1.0, ref_power='max')[source]

Constructor of the class.

Parameters:

file_struct: `msaf.input_output.FileStruct`

Object containing the file paths from where to extract/read the features.

feat_type: `FeatureTypes`

Enum containing the type of features.

sr: int > 0

Sampling rate for the analysis.

hop_length: int > 0

Hop size in frames for the analysis.

n_bins: int > 0

Number of frequency bins for the CQT.

norm: float

Type of norm to use for basis function normalization.

filter_scale: float

The scale of the filter for the CQT.

ref_power: str

The reference power for logarithmic scaling. See configdefaults.py for the possible values.

Methods

__init__(file_struct, feat_type[, sr, ...]) Constructor of the class.
compute_HPSS() Computes harmonic-percussive source separation.
compute_beat_sync_features(beat_frames, ...) Make the features beat-synchronous.
compute_features() Actual implementation of the features.
estimate_beats() Estimates the beats using librosa.
get_id() Identifier of these features.
get_param_names() Returns the parameter names for these features, avoiding the global parameters.
read_ann_beats() Reads the annotated beats if available.
read_features([tol]) Reads the features from a file and stores them in the current object.
select_features(features_id, file_struct, ...) Selects the features from the given parameters.
write_features() Saves features to file.

Attributes

features This getter will compute the actual features if they haven’t been computed yet.
frame_times This getter returns the frame times, for the corresponding type of features.