e1af75e3e1583bd7ee0b8916afd349846c822897,Input/Input.py,,readWave,#,73

Before Change


    if sample_rate is not None and sample_rate != audio_sr:
        res_length = int(np.ceil(float(audio.shape[0]) * float(sample_rate) / float(audio_sr)))
        audio = np.pad(audio, [(1, 1), (0,0)], mode="reflect")  // Pad audio first
        audio = librosa.resample(audio.T, audio_sr, sample_rate, res_type="kaiser_fast").T
        skip = (audio.shape[0] - res_length) // 2
        audio = audio[skip:skip+res_length,:]

    // Clip to [-1,1] if desired

After Change


    if sample_rate is not None and sample_rate != audio_sr:
        res_length = int(np.ceil(float(audio.shape[0]) * float(sample_rate) / float(audio_sr)))
        audio = np.pad(audio, [(1, 1), (0,0)], mode="reflect")  // Pad audio first
        audio = Utils.resample(audio, audio_sr, sample_rate)
        skip = (audio.shape[0] - res_length) // 2
        audio = audio[skip:skip+res_length,:]

    // Clip to [-1,1] if desired
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: f90/Wave-U-Net
Commit Name: e1af75e3e1583bd7ee0b8916afd349846c822897
Time: 2018-08-27
Author: daniel@dstoller.net
File Name: Input/Input.py
Class Name:
Method Name: readWave


Project Name: nilmtk/nilmtk
Commit Name: 53823a31d05f187df7967b7208ce97f584964551
Time: 2014-12-20
Author: jack-list@xlk.org.uk
File Name: nilmtk/electric.py
Class Name: Electric
Method Name: activity_distribution


Project Name: f90/Wave-U-Net
Commit Name: e1af75e3e1583bd7ee0b8916afd349846c822897
Time: 2018-08-27
Author: daniel@dstoller.net
File Name: Input/Input.py
Class Name:
Method Name: readAudio