hfart¶
Functions for highfrequency analysis (HFA) of electophysiological signals for detection of short artifacts and quantitative assessment of the quality of signals.
This module written with Anastasia Kuzmina in 2014.

egegsignals.hfart.
best_fragment
(t, at, ln, percents=False, n=0)[source]¶ Selects the best signal’s fragment of a given length
Parameters:  t (numpy.ndarray) – Time sequence (sec)
 at (numpy.ndarray) – Time sequence where artifacts are located (sec)
 ln (float) – Length of a fragment (sec)
Returns: tuple

egegsignals.hfart.
hfa
(t, x)[source]¶ HFA procedure
Parameters:  t (numpy.ndarray) – Time sequence (sec)
 x (numpy.ndarray) – Sample sequence
Returns: tuple

egegsignals.hfart.
hfa_filter
(t, x, l=60, cutoff=0.3)[source]¶ Filtrates signal for HFA using FIR filter
Parameters:  t (numpy.ndarray) – Time sequence (sec)
 x (numpy.ndarray) – Sample sequence
 l (float (sec)) – Length of operator
 cutoff (float) – Bound (Hz)
Returns: numpy.ndarray

egegsignals.hfart.
longest_fragment
(t, at, n=0)[source]¶ Selects longest fragment of signal with n artifacts
Parameters:  t (numpy.ndarray) – Time sequence (sec)
 at (numpy.ndarray) – Time sequence where artifacts are located (sec)
 n (numpy.ndarray) – Number of artifacts
Returns: tuple

egegsignals.hfart.
merge_artifacts
(at1, at2)[source]¶ Merges artifacts locations.
Parameters:  at1 (numpy.ndarray) – Time sequence where artifacts from 1’st group are located (sec)
 at2 (numpy.ndarray) – Time sequence where artifacts from 2’nd group are located (sec)
Returns: numpy.ndarray

egegsignals.hfart.
outliers
(t, x)[source]¶ Finds outliers
Parameters:  t (numpy.ndarray) – Time sequence (sec)
 x (numpy.ndarray) – Sample sequence
Returns: numpy.ndarray

egegsignals.hfart.
quality
(t, at, n=0)[source]¶ Calculates the quality of signal
Parameters:  t (numpy.ndarray) – Time sequence (sec)
 at (numpy.ndarray) – Time sequence where artifacts are located (sec)
 n (integer) – Number of artifacts
Returns: float

egegsignals.hfart.
three_sigma
(t, x, aver=600, step=30)[source]¶ Calculates the 3*sigma zone (normal distribution) with averaging on intervals.
Parameters:  t (numpy.ndarray) – Time sequence (sec)
 x (numpy.ndarray) – Sample sequence
 aver (float) – Length of averaging interval (sec)
 step (float) – Step (sec)
Returns: numpy.ndarray