TF_peak_detection

TF_peak_detection(EEG, Fs, sleep_stages, varargin)

TF_PEAK_DETECTION Detect time-frequency peaks (spindle candidates) in EEG data

Usage:
[spindle_table, mt_spect, fpeak_proms, fpeak_properties, tpeak_properties, noise_peak_times, lowbw_TFpeaks, fh] = …

TF_peak_detection(EEG, Fs, sleep_stages, ‘Name’, Value, …)

Inputs:

EEG : Nx1 double - EEG data – required Fs : double - sampling frequency in Hz – required sleep_stages : Nx2 double - sleep stage transitions (time, stage) – required

Name-Value Pairs:

‘detection_stages’ : 1xN double - stages used for peak detection (default: [1 2 3]) ‘to_plot’ : logical - plot results (default: false) ‘verbose’ : logical - display verbose output (default: true) ‘spindle_freq_range’ : 1x2 double - spindle frequency range in Hz (default: [0, Fs/2]) ‘extract_property’ : logical - extract TF properties only, skip signal selection (default: false) ‘signal_selection_routine’ : char - ‘post2021’ or ‘sleep2021’ (default: ‘post2021’) ‘artifact_detect’ : logical/logical vector - auto-detect artifacts, or a boolean mask (default: true) ‘artifact_filters’ : struct - artifact filter parameters (default: empty struct) ‘use_volume’ : logical - use volume for signal selection (default: false) ‘peak_freq_range’ : 1x2 double - frequency range for peak detection (default: [9 17]) ‘findpeaks_freq_range’ : 1x2 double - wider frequency range for findpeaks (default: derived from peak_freq_range) ‘in_db’ : logical - peak detection on dB spectrum (default: false) ‘smooth_Hz’ : double - frequency-domain smoothing width in Hz (default: 0)

Outputs:

spindle_table : table - detected spindle peaks information mt_spect : struct - multitaper spectrogram (spect, stimes, sfreqs, stages_in_stimes) fpeak_proms : 1xT double - per-timepoint frequency-peak prominence fpeak_properties : struct - frequency peak properties (freqs, bandwidths, bandwidth_bounds) tpeak_properties : struct - time peak properties (proms, times, durations, center_times, …) noise_peak_times : Nx2 double - [start, end] times of peaks labeled as noise lowbw_TFpeaks : Nx2 double - low-bandwidth TF peaks flagged separately fh : handle - figure handle (empty when to_plot = false)

Notes

Detection pipeline: multitaper spectrogram -> artifact detection -> find_frequency_peaks -> find_time_peaks -> signal selection (post2021 or sleep2021 routine). Uses the post-SLEEP-2021 signal/noise separation routine by default.

See also: find_frequency_peaks, find_time_peaks, TF_peak_selection, select_signal_TFpeaks

∿∿∿ Prerau Laboratory MATLAB Codebase · sleepEEG.org ∿∿∿