mne_denoise.asr.process_guided_asr#
- mne_denoise.asr.process_guided_asr(X: ndarray, sfreq: float, state: ASRState, *, artifact_cov: ndarray | None = None, preserve_cov: ndarray | None = None, reconstruction: str = 'soft', guidance_strength: float = 1.0, window_length: float = 0.5, window_overlap: float = 0.66, max_dims: float | int = 0.66, regularization: float = 1e-08, store_reconstruction_matrices: bool = False, max_mem_mb: int | None = 512, lookahead: float | None = None, stepsize: int | None = None, callback=None, verbose: bool | str | int | None = None) tuple[ndarray, dict[str, Any]][source]#
Apply a calibrated ASR state with guided reconstruction.
- Parameters:
- Xndarray, shape (n_channels, n_times)
Continuous data in the calibrated channel order.
- sfreqfloat
Sampling frequency in Hz.
- stateASRState
Calibration state returned by calibrate_asr.
- artifact_covndarray, shape (n_channels, n_channels), or None, default=None
Covariance describing directions to attenuate.
- preserve_covndarray, shape (n_channels, n_channels), or None, default=None
Covariance describing directions to preserve.
- reconstruction{“soft”, “hard”}, default=”soft”
Use guidance-aware continuous weights or standard binary ASR weights.
- guidance_strengthfloat, default=1.0
Guidance contribution in [0, 1].
- window_lengthfloat, default=0.5
Processing window length in seconds.
- window_overlapfloat, default=0.66
Processing-window overlap.
- max_dimsfloat or int, default=0.66
Maximum fraction or number of reconstructed components.
- regularizationfloat, default=1e-8
Relative covariance eigenvalue floor.
- store_reconstruction_matricesbool, default=False
Include reconstruction matrices in diagnostics.
- max_mem_mbint or None, default=512
Memory bound for covariance processing.
- lookaheadfloat or None, default=None
Processing lookahead in seconds.
- stepsizeint or None, default=None
Samples between reconstruction updates.
- callbackcallable or None, default=None
Synchronous progress callback.
- verbosebool, str, int, or None, default=None
Logging level.
- Returns:
- X_cleanndarray, shape (n_channels, n_times)
Reconstructed data.
- diagnosticsdict
ASR diagnostics with guided weights and reconstruction mode.
Notes
Hard reconstruction requires both guidance covariances to be None. Soft reconstruction requires the GuidedASR experimental opt-in when used through the estimator.