Skip to content

Commit

Permalink
Update librosa calls in examples/align_midi.py
Browse files Browse the repository at this point in the history
- logamplitude deprecated in favor of amplitude_to_db in librosa >6.0
- librosa.magphase(cqt)[0] to suppress warning about discarded phase information
  • Loading branch information
areeves87 authored and craffel committed Jul 16, 2018
1 parent 9851c0c commit 6e767d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/align_midi.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def extract_cqt(audio_data, fs, hop, note_start, n_notes):
# Transpose so that rows are spectra
cqt = cqt.T
# Compute log-amplitude
cqt = librosa.logamplitude(cqt, ref_power=cqt.max())
cqt = librosa.amplitude_to_db(librosa.magphase(cqt)[0], ref=cqt.max())
# L2 normalize the columns
cqt = librosa.util.normalize(cqt, norm=2., axis=1)
# Compute the time of each frame
Expand Down

0 comments on commit 6e767d3

Please sign in to comment.