neurodsp.sim.sim_powerlaw¶
- neurodsp.sim.sim_powerlaw(n_seconds, fs, exponent=- 2.0, f_range=None, **filter_kwargs)[source]¶
Simulate a power law time series, with a specified exponent.
- Parameters
- n_secondsfloat
Simulation time, in seconds.
- fsfloat
Sampling rate of simulated signal, in Hz.
- exponentfloat, optional, default: -2
Desired power-law exponent, of the form P(f)=f^exponent.
- f_rangelist of [float, float] or None, optional
Frequency range to filter simulated data, as [f_lo, f_hi], in Hz.
- **filter_kwargskwargs, optional
Keyword arguments to pass to filter_signal.
- Returns
- sig1d array
Time-series with the desired power law exponent.
Notes
Powerlaw data with exponents is created by spectrally rotating white noise [1].
References
- 1
Timmer, J., & Konig, M. (1995). On Generating Power Law Noise. Astronomy and Astrophysics, 300, 707–710.
Examples
Simulate a power law signal, with an exponent of -2 (brown noise):
>>> sig = sim_powerlaw(n_seconds=1, fs=500, exponent=-2.0)
Simulate a power law signal, with a highpass filter applied at 2 Hz:
>>> sig = sim_powerlaw(n_seconds=1, fs=500, exponent=-1.5, f_range=(2, None))
Examples using neurodsp.sim.sim_powerlaw
¶
Autocorrelation Measures
Fluctuation analyses
Lagged Coherence
Simulating Aperiodic Signals
Simulating Combined Signals
Modulating Signals