DLNCO Features (synctoolbox.feature.dlnco)

synctoolbox.feature.dlnco.pitch_onset_features_to_DLNCO(f_peaks: dict, feature_sequence_length: int, feature_rate: int = 50, midi_min: int = 21, midi_max: int = 108, log_compression_gamma: float = 10000.0, chroma_norm_ord: int = 2, LN_maxfilterlength_seconds: float = 0.8, LN_maxfilterthresh: float = 0.1, DLNCO_filtercoef: ndarray = np.sqrt(1 / np.arange(1, 11)), visualize=False) ndarray[source]

Computes decaying locally adaptive normalized chroma onset (DLNCO) features from a dictionary of peaks obtained e.g. by audio_to_pitch_onset_features.

Parameters
  • f_peaks (dict) –

    A dictionary of onset peaks

    • Each key corresponds to the midi pitch number

    • Each value f_peaks[midi_pitch] is an array of doubles of size 2xN:

      • First row give the positions of the peaks in milliseconds.

      • Second row contains the corresponding magnitudes of the peaks.

  • feature_sequence_length (int) – Desired length of the resulting feature sequence. This should be at least as long as the position of the last peak in f_peaks, but can be longer.

  • feature_rate (int) – Desired features per second in the output representation

  • midi_min (int) – Minimum MIDI pitch index (default: 21)

  • midi_max (int) – Maximum MIDI pitch index (default: 108)

  • log_compression_gamma (float) – Gamma factor of the log compression applied to peak magnitudes.

  • chroma_norm_ord (int) – Order of the norm used for chroma onset vectors.

  • LN_maxfilterlength_seconds (float) – Length of the maximum filter applied for determining local norm of chroma onsets in seconds.

  • LN_maxfilterthresh (float) – Minimum threshold for normalizing chroma onsets using local norm.

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

  • visualize (bool) – Set True to visualize chroma onset features (Default: False)

Returns

f_DLNCO (np.array [shape=(d_dlnco, N_dlnco)]) – Decaying Locally adaptively Normalized Chroma Onset features