lfp_artifact_MAD_detection.py
mad_artifact_detector(recording, mad_thresh=6.0, proportion_above_thresh=0.1, removal_window_ms=10.0, sampling_frequency=1000.0, *args, **kwargs)
¶
Detect LFP artifacts using the median absolute deviation method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
recording |
RecordingExtractor
|
The recording extractor object |
required |
mad_thresh |
float
|
Threshold on the median absolute deviation scaled LFPs, defaults to 6.0 |
6.0
|
proportion_above_thresh |
float
|
Proportion of electrodes that need to be above the threshold, defaults to 1.0 |
0.1
|
removal_window_ms |
float
|
Width of the window in milliseconds to mask out per artifact (window/2 removed on each side of threshold crossing), defaults to 1 ms |
10.0
|
sampling_frequency |
float
|
Sampling frequency of the recording extractor, defaults to 1000.0 |
1000.0
|
Returns:
Name | Type | Description |
---|---|---|
artifact_removed_valid_times |
ndarray
|
Intervals of valid times where artifacts were not detected, unit: seconds |
artifact_intervals |
ndarray
|
Intervals in which artifacts are detected (including removal windows), unit: seconds |