EEG_detect_time_domain_artifacts

EEG_detect_time_domain_artifacts(data, Fs, method, hf_crit, hf_pass, bb_crit, bb_pass, smooth_duration, verbose, histogram_plot)

EEG_DETECT_TIME_DOMAIN_ARTIFACTS Detect artifacts in the time domain by iteratively removing data above a given z-score criterion

Usage: Direct input: artifacts = detect_time_domain_artifacts(data, Fs, hf_crit, hf_pass, bb_crit, bb_pass, smooth_duration, verbose, histogram_plot)

Input: data: 1 x <number of samples> vector - time series data– required Fs: double - sampling frequency in Hz – required method: string ‘std’ to use iterative method (default) or a strict threshold on ‘MAD’,defined as K*MEDIAN(ABS(A-MEDIAN(A))) hf_crit: double - high frequency criterion - number of stds/MAD above the mean to remove (default: 4) hf_pass: double - high frequency pass band - frequency for high pass filter in Hz (default: 25 Hz) bb_crit: double - broadband criterion - number of stds/MAD above the mean to remove (default: 4) bb_pass: double - broadband pass band - frequency for high pass filter in Hz (default: .1 Hz) smooth_duration: double - time (in seconds) to smooth the time series (default: 2 seconds) verbose: logical - verbose output (default: false) histogram_plot: logical - plot histograms for debugging (default: false)

Output: artifacts: 1xT logical of times flagged as artifacts (logical OR of hf and bb artifacts) hf_artifacts: 1xT logical of times flagged as high frequency artifacts bb_artifacts: 1xT logical of times flagged as broadband artifacts

Copyright 2020 Michael J. Prerau, Ph.D. - http://www.sleepEEG.org This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. (http://creativecommons.org/licenses/by-nc-sa/4.0/)

Last modified 07/17/2020 by Alex