ee723d05e9cf56fa26a33735ee7bc2be882e0683,pliers/extractors/base.py,ExtractorResult,resample,#ExtractorResult#Any#Any#Any#,210

Before Change



        max_duration = self.onset[-1] + self.duration[-1]

        n = int(math.ceil(bin_sr * max_duration))
        x = np.arange(n)

        // Calculate final number of samples after re-sampling
        num = int(np.round((sampling_rate / bin_sr) * n))

        resampled = {}
        for f_name in self.features:
            values = self.data[f_name]

            ts = np.zeros(n, dtype=values.dtype)
            start = 0
            for i, val in enumerate(values):
                _onset = int(start + onsets[i])
                _offset = int(_onset + durations[i])
                ts[_onset:_offset] = val

            // What does first sample correspond to? Only one
            f = interp1d(x, ts, kind=kind)
            x_new = np.linspace(0, n - 1, num=num)
            resampled[f_name] = f(x_new)

        new_dur = 1 / sampling_rate
        new_onsets = np.arange(0, math.ceil(max_duration), new_dur)

After Change


        max_duration = self.onset[-1] + self.duration[-1]

        // Calculate final number of samples after re-sampling
        num = math.ceil(max_duration / interval)

        // Maximum duration in bin_sr upscaling space
        max_dur_bin_sr = int(num * interval * bin_sr)
        x = np.arange(max_dur_bin_sr)

        resampled = {}
        for f_name in self.features:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: tyarkoni/pliers
Commit Name: ee723d05e9cf56fa26a33735ee7bc2be882e0683
Time: 2020-11-04
Author: aleph4@gmail.com
File Name: pliers/extractors/base.py
Class Name: ExtractorResult
Method Name: resample


Project Name: matplotlib/matplotlib
Commit Name: 7ad4996b6106e601ed7136c11e17abbb149ef889
Time: 2019-04-27
Author: nelle.varoquaux@gmail.com
File Name: examples/lines_bars_and_markers/scatter_hist.py
Class Name:
Method Name:


Project Name: matplotlib/matplotlib
Commit Name: eaa7025a37930ddfac810721c14452548db87ebc
Time: 2019-04-26
Author: 2836374+timhoffm@users.noreply.github.com
File Name: examples/lines_bars_and_markers/scatter_hist.py
Class Name:
Method Name: