neurodsp.sim.sim_frac_gaussian_noise¶
- neurodsp.sim.sim_frac_gaussian_noise(n_seconds, fs, exponent=0, hurst=None)[source]¶
Simulate a timeseries as fractional gaussian noise.
- Parameters
- n_secondsfloat
Simulation time, in seconds.
- fsfloat
Sampling rate of simulated signal, in Hz.
- exponentfloat, optional, default: 0
Desired power law exponent of the spectrum of the signal. Must be in the range (-1, 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
- sig: 1d array
Simulated fractional gaussian noise time series.
Notes
The time series can be specified with either a desired power law exponent, or alternatively with a specified Hurst parameter.
The Hurst parameter is not the Hurst exponent as defined in rescaled range analysis. 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 gaussian noise is exponent = 2 * hurst - 1.
For more information, consult [1].
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
Examples
Simulate fractional gaussian noise with a power law decay of 0 (white noise):
>>> sig = sim_frac_gaussian_noise(n_seconds=1, fs=500, exponent=0)
Simulate fractional gaussian noise with a Hurst parameter of 0.5 (also white noise):
>>> sig = sim_frac_gaussian_noise(n_seconds=1, fs=500, hurst=0.5)