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


                            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: 4

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: librosa/librosa
Commit Name: 16d7600b3235b65a29d975ae728395a808562f37
Time: 2015-01-26
Author: brian.mcfee@nyu.edu
File Name: librosa/core/constantq.py
Class Name:
Method Name: cqt


Project Name: acoular/acoular
Commit Name: 97a543976472f88b7922cc8f8ef3d7c0b6cd3dee
Time: 2012-02-06
Author: sarradj@tu-cottbus.de
File Name: beamfpy/sources.py
Class Name: PointSource
Method Name: result