SpectralSummarized Class

Spectral features summarized over time using mean and variance. Returns a 22-dimension feature vector for each audio sample.

Features:
  • Spectral Centroid

  • Spectral Bandwidth

  • Spectral Contrast (7 frequency bands)

  • Spectral Flatness

  • Spectral Rolloff

class spiegelib.features.SpectralSummarized(frame_size=2048, hop_size=512, scale_axis=0, **kwargs)

Bases: spiegelib.features.features_base.FeaturesBase

Parameters
  • frame_size (int, optional) – size of FFT, defaults to 2048

  • hop_size (int, optional) – size of hop shift in samples, defuault to 512

  • scale_axis (int, tuple, None) – When applying scaling, determines which dimensions scaling be applied along. Defaults to 0, which scales each feature independently.

  • kwargs – Keyword arguments, see spiegelib.features.features_base.FeaturesBase.

get_features(audio)

Extract spectral features and return results.

Parameters

audio (AudioBuffer) – input audio

Returns

Results of spectral features extraction. Format depends on output type set during construction.

Return type

np.ndarray