message-linesFlat sensors

Flat sensors can dampen graphs by exhibiting abnormal amplitudes when autoscaling is applied to the signal power spectrum. To ensure accurate visualization, MEGAP first detects and excludes these flat sensors. By detecting them rather than merely adjusting the y-axis, MEGAP can display a warning message ("flat sensor excluded") on the plots. It should be noted that the comprehensive detection of all bad sensors is deferred to later steps.

data.compute_psd().plot()
Example of Flat sensors on PSD plot
Damped power spectrum with one flat sensor
circle-info

The MNE library's function for plotting PSDarrow-up-right does not include built-in parameters to disable autoscaling or manually rescale the y-axis.

MEGAP output power spectrum with warning massage

To identify flat sensors based on PREParrow-up-right, the code first detects channels containing NaN values, which indicate missing or corrupted data. It then flags channels with flat signals by evaluating two criteria: Median Absolute Deviation (MAD) and Standard Deviation (STD). Channels with MAD or STD values below a predefined threshold (flat_threshold = 1e-18arrow-up-right T or T/m) are considered flat, as they exhibit no meaningful signal variation.

Last updated