46413ee98f44a9b83231bebdae0bdd535f42f6c7,librosa/filters.py,,constantq,#,147

Before Change


        
        // Place a log-normal window around center_freq
        // We skip the sigma*sqrt(2*pi) normalization because it will wash out below anyway
        C[i, 1:] = np.exp(-0.5 * ((np.log2(fftfreqs[1:]) - np.log2(center_freq)) /sigma)**2) / fftfreqs[1:]
                                  
        c_norm = np.sqrt(np.sum(C[i]**2))
        // Normalize each filter
        if c_norm > 0:
            C[i] = C[i] / c_norm

After Change


    C = np.zeros( (n_filters, n_fft /2  + 1) )
    
    // Get log frequencies of bins
    log_freqs = np.log2(librosa.fft_freq(sr, n_fft)[1:])
                                
    for i in range(n_filters):
        // What"s the center (median) frequency of this filter?
        center_freq = correction * fmin * (2.0**(float(i)/bins_per_octave))
        
        // Place a log-normal window around center_freq
        // We skip the sqrt(2*pi) normalization because it will wash out below anyway
        C[i, 1:] = np.exp(-0.5 * ((log_freqs - np.log2(center_freq)) /sigma)**2 - np.log2(sigma) - log_freqs)
                                  
        // Normalize each filter
        c_norm = np.sqrt(np.sum(C[i]**2))
        if c_norm > 0:
            C[i] = C[i] / c_norm
        
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: librosa/librosa
Commit Name: 46413ee98f44a9b83231bebdae0bdd535f42f6c7
Time: 2013-11-22
Author: brm2132@columbia.edu
File Name: librosa/filters.py
Class Name:
Method Name: constantq


Project Name: dit/dit
Commit Name: c5d2c23110586075a1ad6721dd9a74064111b595
Time: 2015-03-18
Author: chebee7i@gmail.com
File Name: dit/math/aitchison.py
Class Name:
Method Name: ilr


Project Name: dit/dit
Commit Name: c5d2c23110586075a1ad6721dd9a74064111b595
Time: 2015-03-18
Author: chebee7i@gmail.com
File Name: dit/math/aitchison.py
Class Name:
Method Name: alr