pytimbre.spectral.timbral_model.timbral_util.detect_peaks

pytimbre.spectral.timbral_model.timbral_util.detect_peaks(array, freq=0, cthr=0.2, unprocessed_array=False, fs=44100)

Function detects the peaks in array, based from the mirpeaks algorithm.

Parameters:
  • array – Array in which to detect peaks

  • freq – Scale representing the x axis (sample length as array)

  • cthr – Threshold for checking adjacent peaks

  • unprocessed_array – Array that in unprocessed (normalised), if False will default to the same as array.

  • fs – Sampe rate of the array

Returns:

index of peaks, values of peaks, peak value on freq.