Spectral Flux (synctoolbox.feature.novelty)

synctoolbox.feature.novelty.add_decay(nov_norm: ndarray, filter_coeff: ndarray = np.sqrt(1 / np.arange(1, 11)))[source]
synctoolbox.feature.novelty.spectral_flux(f_audio: ndarray, Fs: int = 22050, feature_rate: int = 50, gamma: float = 10, M_sec: float = 0.1) ndarray[source]

Generates the spectral-based novelty curve given an audio array.

This function is based on the FMP notebook on “Spectral-Based Novelty”: https://www.audiolabs-erlangen.de/resources/MIR/FMP/C6/C6S1_NoveltySpectral.html

Parameters
  • f_audio (np.ndarray) – One dimensional f_audio array (mono)

  • Fs (float) – Sampling rate of f_audio (in Hz)

  • feature_rate (int) – Features per second

  • gamma (float) – Log compression factor

  • M_sec (float) – Determines size (2M+1) in samples of centric window used for local average

  • filter_coeff (np.ndarray) – Sequence of decay coefficients applied on normalized chroma onsets.

Returns

sf (np.ndarray [shape=(N, )]) – Enhanced novelty curve with the subtraction of a local averagenad a temporal decay