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

Before Change



    // 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

After Change



    // Get the number of samples to simulate for the signal
    //   If filter is to be filtered, with FIR, add extra to compensate for edges
    if f_range and filter_kwargs.get("filt_type", None) != "iir":

        pass_type = infer_passtype(f_range)
        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,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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: riga/tfdeploy
Commit Name: df38756fb9220bd605acc3e8d5fd42f7f43c3a1e
Time: 2016-03-10
Author: marcelrieger@me.com
File Name: tests/test_ops.py
Class Name: OpsTestCase
Method Name: random


Project Name: soft-matter/trackpy
Commit Name: 8d74e077e63dac70a6932eb0496a4bb821253f5b
Time: 2012-12-05
Author: daniel.b.allan@gmail.com
File Name: mr/wire_models.py
Class Name: Model
Method Name: fit