Skip to content

Commit

Permalink
write maximum_pcen
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Lostanlen committed Aug 16, 2019
1 parent eecd4f6 commit f43bf50
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions birdvoxpaint/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@ def maximum_flux(S):
spectrogram = np.abs(S)**2
flux = np.abs(np.diff(spectrogram, axis=1))
return np.max(flux, axis=1)


def maximum_pcen(S, **kwargs):
spectrogram = np.abs(S)**2
kwargs["return_zf"] = True
pcen, zf = librosa.pcen(spectrogram, **kwargs)
return np.max(pcen, axis=1), zf

0 comments on commit f43bf50

Please sign in to comment.