neurodsp.sim.sim_frac_brownian_motion¶
- neurodsp.sim.sim_frac_brownian_motion(n_seconds, fs, exponent=- 2, hurst=None)[source]¶
Simulate a timeseries as fractional brownian motion.
- 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 spectrum of the signal. Must be in the range (-3, -1).
- hurstfloat, optional, default: None
Desired Hurst parameter, which must be in the range (0, 1). If provided, this value overwrites the exponent parameter.
- Returns
- sig1d array
Simulated fractional brownian motion time series.
Notes
The time series can be specified with either a desired power law exponent, or alternatively with a specified Hurst parameter.
Note that when specifying there can be some bias leading to a steeper than expected spectrum of the simulated signal. This bias is higher for exponent values near to 1, and may be more severe in shorter signals.
The Hurst parameter is not the Hurst exponent in general. The Hurst parameter is defined for self-similar processes such that Y(at) = a^H Y(t) for all a > 0, where this equality holds in distribution.
The relationship between the power law exponent and the Hurst parameter for fractional brownian motion is exponent = 2 * hurst + 1
For more information, consult [1] and/or [2].
References
- 1
Eke, A., Herman, P., Kocsis, L., & Kozak, L. R. (2002). Fractal characterization of complexity in temporal physiological signals. Physiological Measurement, 23(1), R1–R38. DOI: https://doi.org/10.1088/0967-3334/23/1/201
- 2
Dieker, T. (2004). Simulation of fractional Brownian motion. 77.
Examples
Simulate fractional brownian motion with a power law exponent of -2 (brown noise):
>>> sig = sim_frac_brownian_motion(n_seconds=1, fs=500, exponent=-2)
Simulate fractional brownian motion with a Hurst parameter of 0.5 (also brown noise):
>>> sig = sim_frac_brownian_motion(n_seconds=1, fs=500, hurst=0.5)