// this fails if ac_window > length of song
bpms = 60.0 * fft_resolution / (numpy.arange(1, ac_window+1))
x_corr_weighting = numpy.exp(-0.5 * ((numpy.log2(bpms) - numpy.log2(start_bpm)) / bpm_std)**2)
// Compute the weighted autocorrelation
x_corr = x_corr * x_corr_weighting
// Get the local maximum of weighted correlation
x_peaks = librosa.localmax(x_corr)
After Change
mincol = max(0, maxcol - numpy.round(DURATION * fft_res))
// Use auto-correlation out of 4 seconds (empirically set??)
ac_window = numpy.round(AC_SIZE * fft_res)
// Compute the autocorrelation
x_corr = librosa.autocorrelate(onsets[mincol:maxcol], ac_window)
// FIXME: 2013-01-25 08:55:40 by Brian McFee <brm2132@columbia.edu>
// this fails if ac_window > length of song
// re-weight the autocorrelation by log-normal prior
bpms = 60.0 * fft_res / (numpy.arange(1, ac_window+1))
// Smooth the autocorrelation by a log-normal distribution
x_corr = x_corr * numpy.exp(-0.5 * ((numpy.log2(bpms / start_bpm)) / BPM_STD)**2)
// Get the local maximum of weighted correlation
x_peaks = librosa.localmax(x_corr)