48a579ae1638f5c60e62d8f5c3bad35e0dcef249,librosa/beat.py,,onset_estimate_bpm,#,145

Before Change


    //   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


    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)

    // Zero out all peaks before the first negative
    x_peaks[:numpy.argmax(x_corr < 0)] = False

    // Find the largest (local) max
    start_period    = numpy.argmax(x_peaks * x_corr)

    // Choose the best peak out of .33, .5, 2, 3 * start_period
    candidates      = numpy.multiply(start_period, [1.0/3, 1.0/2, 1.0, 2.0, 3.0])
    candidates      = candidates.astype(int)
    candidates      = candidates[candidates < ac_window]

    best_period     = numpy.argmax(x_corr[candidates])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: librosa/librosa
Commit Name: 48a579ae1638f5c60e62d8f5c3bad35e0dcef249
Time: 2013-03-23
Author: brm2132@columbia.edu
File Name: librosa/beat.py
Class Name:
Method Name: onset_estimate_bpm


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 5cdca80dcb7ec6db8fa32d18ff85df40e9ff5b67
Time: 2018-02-10
Author: max.lapan@gmail.com
File Name: ch15/04_train_ppo.py
Class Name:
Method Name:


Project Name: librosa/librosa
Commit Name: 8afa25c763a9ee408de6f98492a71b7d721a68b0
Time: 2014-01-21
Author: brm2132@columbia.edu
File Name: librosa/filters.py
Class Name:
Method Name: constant_q