Skip to content

Documentation

Egor Dmitriev edited this page Sep 10, 2018 · 1 revision

Python Documentation

Applies to both C++ and Python API. In Python use numpy arrays and matrices instead.

audio_to_novelty_curve

Arguments

  • signal: wavefrom of audio signal
  • sr: sampling rate of the audio (Hz)
  • window_length: window length for STFT (in samples)
  • hop_length: stepsize for the STFT
  • compression_c: constant for log compression
  • log_compression: enable/disable log compression
  • resample_feature_rate: feature rate of the resulting novelty curve (resampled, independent of stepsize)

Returns
Tuple(novelty_curve, feature_rate)

Description Computes a novelty curve (onset detection function) for the input audio signal. This implementation is a variant of the widely used spectral flux method with additional bandwise processing and a logarithmic intensity compression. This particularly addresses music with weak onset information (e.g., exhibiting string instruments.)

novelty_curve_to_tempogram_dft

Arguments

  • novelty_curve: a novelty curve indicating note onset positions
  • bpm: vector containing BPM values to compute
  • feature_rate: feature rate of the novelty curve (Hz). This needs to be set to allow for setting other parameters in seconds!
  • tempo_window: Analysis window length in seconds
  • hop_length: window hop length in frames (of novelty curve)

Returns
Tuple(tempogram, time vector, bpm vector)

Description Computes a complex valued fourier tempogram for a given novelty curve indicating note onset candidates in the form of peaks. This implementation provides parameters for chosing fourier coefficients in a frequency range corresponding to musically meaningful tempo values in bpm.

normalize_feature

Arguments

  • feature: matrix
  • p
  • threshold

Returns
Normalized feature matrix

Description
Normalizes a feature sequence according to the l^p norm If the norm falls below threshold for a feature vector, then the normalized feature vector is set to be the unit vector.

compute_fourier_coefficients

Arguments

  • s time domain signal
  • window vector containing window function
  • n_overlap overlap given in samples
  • f vector of frequencies values of fourier coefficients, in Hz
  • sr sampling rate of signal s in Hz

Returns
Tuple(complex fourier coefficients, frequency vector, time vector)

Description
Function that calculates a fourier coefficient with frequency f.

stft

Arguments

  • signal: wavefrom of audio signal
  • sr: sample rate
  • window
  • coefficient_range
  • n_fft: window length
  • hop_length

Returns
Tuple(spectrogram, frequency vector, time vector)

Description
Computes aspectrogram using a STFT (short-time fourier transform)