1a766e674e36b894d6aa6734e792a764fc91e2c6,librosa/core.py,,istft,#Any#Any#Any#Any#,249

Before Change


            raise ValueError("Size mismatch between n_fft and window size")

    // Pad out to match n_fft
    lpad = (n_fft - win_length)/2
    ifft_window = np.pad( ifft_window, (lpad, n_fft - win_length - lpad), mode="constant")

    n_frames    = stft_matrix.shape[1]
    y           = np.zeros(n_fft + hop_length * (n_frames - 1))

After Change



    

    n_fft       = 2 * (stft_matrix.shape[0] - 1)

    // By default, use the entire frame
    if win_length is None:
        win_length = n_fft

    // Set the default hop, if it"s not already specified
    if hop_length is None:
        hop_length = win_length / 4

    if window is None: 
        // Default is an asymmetric Hann window.
        // 2/3 scaling is to make stft(istft(.)) identity for 25% hop
        ifft_window =  scipy.signal.hann(win_length, sym=False) * (2.0 / 3)

    elif hasattr(window, "__call__"):
        // User supplied a windowing function
        ifft_window = window(win_length)

    else:
        // User supplied a window vector.
        // Make it into an array
        ifft_window = np.asarray(window)

        // Verify that the shape matches
        if ifft_window.size != n_fft:
            raise ValueError("Size mismatch between n_fft and window size")

    // Pad out to match n_fft
    ifft_window = util.pad_center(ifft_window, n_fft)

    n_frames    = stft_matrix.shape[1]
    y           = np.zeros(n_fft + hop_length * (n_frames - 1))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: librosa/librosa
Commit Name: 1a766e674e36b894d6aa6734e792a764fc91e2c6
Time: 2014-01-18
Author: brm2132@columbia.edu
File Name: librosa/core.py
Class Name:
Method Name: istft


Project Name: librosa/librosa
Commit Name: 1a766e674e36b894d6aa6734e792a764fc91e2c6
Time: 2014-01-18
Author: brm2132@columbia.edu
File Name: librosa/core.py
Class Name:
Method Name: stft


Project Name: librosa/librosa
Commit Name: 1a766e674e36b894d6aa6734e792a764fc91e2c6
Time: 2014-01-18
Author: brm2132@columbia.edu
File Name: librosa/filters.py
Class Name:
Method Name: constant_q


Project Name: librosa/librosa
Commit Name: 1a766e674e36b894d6aa6734e792a764fc91e2c6
Time: 2014-01-18
Author: brm2132@columbia.edu
File Name: librosa/core.py
Class Name:
Method Name: istft