Skip to content

Commit

Permalink
Merge bdd36b5 into edd638b
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcfee committed Jul 10, 2017
2 parents edd638b + bdd36b5 commit 366ffe3
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions librosa/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,10 @@ def __decorate_axis(axis, ax_type):
def __coord_fft_hz(n, sr=22050, **_kwargs):
'''Get the frequencies for FFT bins'''
n_fft = 2 * (n - 1)
return core.fft_frequencies(sr=sr, n_fft=1+n_fft)
# We'll stick on one bin past the end so that we have n+1 ticks
basis = core.fft_frequencies(sr=sr, n_fft=1+n_fft)
basis = np.append(basis, [basis[-1] + basis[1] - basis[0]])
return basis


def __coord_mel_hz(n, fmin=0, fmax=11025.0, **_kwargs):
Expand All @@ -852,7 +855,11 @@ def __coord_cqt_hz(n, fmin=None, bins_per_octave=12, **_kwargs):
'''Get CQT bin frequencies'''
if fmin is None:
fmin = core.note_to_hz('C1')
return core.cqt_frequencies(n+1, fmin=fmin, bins_per_octave=bins_per_octave)

# we drop by half a bin so that CQT bins are centered vertically
return core.cqt_frequencies(n+1,
fmin=fmin / 2.0**(0.5/bins_per_octave),
bins_per_octave=bins_per_octave)


def __coord_chroma(n, bins_per_octave=12, **_kwargs):
Expand Down
Binary file modified tests/baseline_images/test_display/cqt_hz.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/baseline_images/test_display/x_linear_y_none.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/baseline_images/test_display/x_log_y_none.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/baseline_images/test_display/x_none_y_linear.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/baseline_images/test_display/x_none_y_log.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 366ffe3

Please sign in to comment.