20047f4faebee3a9f21596bdd24a12df575dcb7a,neurodsp/sim/aperiodic.py,,sim_powerlaw,#Any#Any#Any#Any#,152

Before Change


    sig = np.random.randn(n_samples)

    // Compute the FFT
    fft_output = np.fft.fft(sig)
    freqs = np.fft.fftfreq(len(sig), 1. / fs)

    // Rotate spectrum and invert, zscore to normalize.
    //   Note: the delta exponent to be applied is divided by two, as
    //     the FFT output is in units of amplitude not power
    fft_output_rot = rotate_powerlaw(freqs, fft_output, -exponent/2)
    sig = zscore(np.real(np.fft.ifft(fft_output_rot)))

    if f_range is not None:
        sig = filter_signal(sig, fs, infer_passtype(f_range), f_range, **filter_kwargs)

After Change


        filt_len = compute_filter_length(fs, pass_type,
                                         *check_filter_definition(pass_type, f_range),
                                         n_seconds=filter_kwargs.get("n_seconds", None),
                                         n_cycles=filter_kwargs.get("n_cycles", 3))

        n_samples = int(n_seconds * fs) + filt_len + 1

    else:
        n_samples = int(n_seconds * fs)

    sig = _create_powerlaw(n_samples, fs, exponent)

    if f_range is not None:
        sig = filter_signal(sig, fs, infer_passtype(f_range), f_range,
                            remove_edges=True, **filter_kwargs)
        // Drop the edges, that were compensated for, if not using IIR (using FIR)
        if not filter_kwargs.get("filt_type", None) == "iir":
            sig, _ = remove_nans(sig)

    return sig

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: neurodsp-tools/neurodsp
Commit Name: 20047f4faebee3a9f21596bdd24a12df575dcb7a
Time: 2019-08-18
Author: tdonoghue@ucsd.edu
File Name: neurodsp/sim/aperiodic.py
Class Name:
Method Name: sim_powerlaw


Project Name: theislab/scanpy
Commit Name: ab9247bdf8b7a3decc34a15b26fec813ea8fba0d
Time: 2020-07-31
Author: ivirshup@gmail.com
File Name: scanpy/readwrite.py
Class Name:
Method Name: _download


Project Name: dpressel/mead-baseline
Commit Name: da1e8c2de9b265dcb18256a0a087165faf138b42
Time: 2019-01-14
Author: blester125@users.noreply.github.com
File Name: python/baseline/services.py
Class Name: EncoderDecoderService
Method Name: predict