mne.simulation.
simulate_raw
(raw, stc, trans, src, bem, cov=’simple’, blink=False, ecg=False, chpi=False, head_pos=None, mindist=1.0, interp=’cos2’, iir_filter=None, n_jobs=1, random_state=None, verbose=None)[source]¶Simulate raw data.
Head movements can optionally be simulated using the head_pos
parameter.
Parameters: | raw : instance of Raw
stc : instance of SourceEstimate
trans : dict | str | None
src : str | instance of SourceSpaces
bem : str | dict
cov : instance of Covariance | str | None
blink : bool
ecg : bool
chpi : bool
head_pos : None | str | dict | tuple | array
mindist : float
interp : str
iir_filter : None | array
n_jobs : int
random_state : None | int | np.random.RandomState
verbose : bool, str, int, or None
|
---|---|
Returns: | raw : instance of Raw
|
Notes
Events coded with the position number (starting at 1) will be stored
in the trigger channel (if available) at times corresponding to t=0
in the stc
.
The resulting SNR will be determined by the structure of the noise
covariance, the amplitudes of stc
, and the head position(s) provided.
The blink and ECG artifacts are generated by 1) placing impulses at random times of activation, and 2) convolving with activation kernel functions. In both cases, the scale-factors of the activation functions (and for the resulting EOG and ECG channel traces) were chosen based on visual inspection to yield amplitudes generally consistent with those seen in experimental data. Noisy versions of the blink and ECG activations will be stored in the first EOG and ECG channel in the raw file, respectively, if they exist.
For blink artifacts:
- Random activation times are drawn from an inhomogeneous poisson process whose blink rate oscillates between 4.5 blinks/minute and 17 blinks/minute based on the low (reading) and high (resting) blink rates from [R57].
- The activation kernel is a 250 ms Hanning window.
- Two activated dipoles are located in the z=0 plane (in head coordinates) at ±30 degrees away from the y axis (nasion).
- Activations affect MEG and EEG channels.
For ECG artifacts:
- Random inter-beat intervals are drawn from a uniform distribution of times corresponding to 40 and 80 beats per minute.
- The activation function is the sum of three Hanning windows with varying durations and scales to make a more complex waveform.
- The activated dipole is located one (estimated) head radius to the left (-x) of head center and three head radii below (+z) head center; this dipole is oriented in the +x direction.
- Activations only affect MEG channels.
New in version 0.10.0.
References
[R57] | (1, 2) Bentivoglio et al. “Analysis of blink rate patterns in normal subjects” Movement Disorders, 1997 Nov;12(6):1028-34. |
mne.simulation.simulate_raw
¶