mne.chpi.compute_chpi_amplitudes¶
- mne.chpi.compute_chpi_amplitudes(raw, t_step_min=0.01, t_window='auto', ext_order=1, tmin=0, tmax=None, verbose=None)[source]¶
Compute time-varying cHPI amplitudes.
- Parameters
- rawinstance of
Raw
Raw data with cHPI information.
- t_step_min
float
Minimum time step to use. If correlations are sufficiently high, t_step_max will be used.
- t_window
float
Time window to use to estimate the amplitudes, default is 0.2 (200 ms).
- ext_order
int
The external order for SSS-like interfence suppression. The SSS bases are used as projection vectors during fitting.
Changed in version 0.20: Added
ext_order=1
by default, which should improve detection of true HPI signals.- tmin
float
Start time of the raw data to use in seconds (must be >= 0).
- tmax
float
End time of the raw data to use in seconds (cannot exceed data duration).
- verbosebool,
str
,int
, orNone
If not None, override default verbose level (see
mne.verbose()
and Logging documentation for more). If used, it should be passed as a keyword-argument only.
- rawinstance of
- Returns
- chpi_amplitudes
dict
The time-varying cHPI coil amplitudes, with entries “times”, “proj”, and “slopes”.
- chpi_amplitudes
See also
Notes
This function will:
Get HPI frequencies, HPI status channel, HPI status bits, and digitization order using
_setup_hpi_amplitude_fitting
.Window data using
t_window
(half before and half aftert
) andt_step_min
.Use a linear model (DC + linear slope + sin + cos terms) to fit sinusoidal amplitudes to MEG channels. It uses SVD to determine the phase/amplitude of the sinusoids.
In “auto” mode,
t_window
will be set to the longer of:- Five cycles of the lowest HPI or line frequency.
Ensures that the frequency estimate is stable.
- The reciprocal of the smallest difference between HPI and line freqs.
Ensures that neighboring frequencies can be disambiguated.
The output is meant to be used with
compute_chpi_locs()
.New in version 0.20.