Skip to main content

Module snr

Module snr 

Source
Expand description

SNR estimation from sensor data and an inverse operator.

Ported from MNE-Python’s mne.minimum_norm.estimate_snr.

§Overview

Two SNR measures are provided:

  • Whitened GFP (snr): Global field power of the whitened data, normalised by the effective channel count. This is a data-driven SNR that does not depend on the regularisation parameter.

  • Regularisation-based (snr_est): Finds the smallest λ² for which the residual (unregularised − regularised prediction) stays within a χ² confidence bound. Returns 1 / √λ².

§Example

use exg_source::snr::estimate_snr;
use exg_source::*;
use ndarray::Array2;

let data = Array2::<f64>::zeros((n_chan, 100));
let (snr, snr_est) = estimate_snr(&data, &inv);
println!("SNR (whitened GFP): {:?}", &snr.as_slice().unwrap()[..5]);
println!("SNR (estimated):    {:?}", &snr_est.as_slice().unwrap()[..5]);

Functions§

estimate_snr
Estimate SNR as a function of time.