elasticai.preprocessor.sda.sda#

Module Contents#

Classes#

SettingsSDA

Configuration class for defining the Spike Detection Algorithm (SDA) Attributes: mode_sda: Applied spike detection algorithm (SDA) on transient signal [normal, Non-Linear Energy Operator (NEO) or Teager-Kaiser-Operator (dx_sda = 1 or kNEO with dx_sda > 1), Multiresolution Teager Energy Operator (MTEO), absolute difference operator (ADO), enhanced energy-derivation operator (eED), amplitude slope operator (ASO, k for window size, and f_hp as additional float arg), spike band-power estimation [Nason et al., 2020] (SBP, using f_bp with two values as additional arg) mode_thr: String with used method for thresholding [‘const’: constant given value, ‘abs_mean’: absolute mean value, ‘mad’: median absolute derivation, ‘mavg’, moving average, ‘mavg_abs’: absolute mean absolute value, ‘rms_norm’: Root-Mean-Squared, ‘rms_move’: Moving RMS, ‘rms_black’: RMS method used in Blackrock Neurotechnology Systems, ‘welford’: Welford Online Algorithm for STD Calculation] mode_align: Aligning mode of the detected spike frames [none, max, min, ptp (Positive turning point), ntp (Negative turning point), abs-max (Absolute maximum)] sampling_rate: Sampling rate [Hz] dx_sda: Position difference for extracting SDA method. Configuration with length(x) == 1: with dX = 1 –> NEO, dX > 1 –> k-NEO t_frame_length: Floating value with total window length [s] t_frame_start: Floating value with time point for aligned position [s] dt_offset: Time offset for the first larger spike window [neg, pos] thr_gain: Floating value with amplification factor on SDA output

SpikeDetection

Data#

API#

class elasticai.preprocessor.sda.sda.SettingsSDA[source]#

Configuration class for defining the Spike Detection Algorithm (SDA) Attributes: mode_sda: Applied spike detection algorithm (SDA) on transient signal [normal, Non-Linear Energy Operator (NEO) or Teager-Kaiser-Operator (dx_sda = 1 or kNEO with dx_sda > 1), Multiresolution Teager Energy Operator (MTEO), absolute difference operator (ADO), enhanced energy-derivation operator (eED), amplitude slope operator (ASO, k for window size, and f_hp as additional float arg), spike band-power estimation [Nason et al., 2020] (SBP, using f_bp with two values as additional arg) mode_thr: String with used method for thresholding [‘const’: constant given value, ‘abs_mean’: absolute mean value, ‘mad’: median absolute derivation, ‘mavg’, moving average, ‘mavg_abs’: absolute mean absolute value, ‘rms_norm’: Root-Mean-Squared, ‘rms_move’: Moving RMS, ‘rms_black’: RMS method used in Blackrock Neurotechnology Systems, ‘welford’: Welford Online Algorithm for STD Calculation] mode_align: Aligning mode of the detected spike frames [none, max, min, ptp (Positive turning point), ntp (Negative turning point), abs-max (Absolute maximum)] sampling_rate: Sampling rate [Hz] dx_sda: Position difference for extracting SDA method. Configuration with length(x) == 1: with dX = 1 –> NEO, dX > 1 –> k-NEO t_frame_length: Floating value with total window length [s] t_frame_start: Floating value with time point for aligned position [s] dt_offset: Time offset for the first larger spike window [neg, pos] thr_gain: Floating value with amplification factor on SDA output

mode_sda: str#

None

mode_thr: str#

None

mode_align: str#

None

dx_sda: list#

None

sampling_rate: float#

None

t_frame_length: float#

None

t_frame_start: float#

None

dt_offset: float#

None

thr_gain: float#

None

property get_integer_offset: int#

Getting the integer offset for negative offset in building the spike window

property get_integer_offset_total: int#

Getting the total integer offset in building the spike window

property get_integer_spike_frame: int#

Getting the integer for total length of a spike window

property get_integer_spike_start: int#

Getting the integer for starting the aligned method on each spike window

elasticai.preprocessor.sda.sda.DefaultSettingsSDA#

‘SettingsSDA(…)’

class elasticai.preprocessor.sda.sda.SpikeDetection(settings: elasticai.preprocessor.sda.sda.SettingsSDA)[source]#

Initialization

Class SpikeDetection for extracting Spike Waveforms from neural transient input

Parameters:

settings – Class SettingsSDA for configuring the accelerator

Returns:

None

get_methods_sda() list[source]#

Function for getting a list with all methods for spike detection

apply_spike_detection(xraw: numpy.ndarray, **kwargs) numpy.ndarray[source]#

Applying spike detection algorithm (SDA) on transient raw signal

Parameters:

xraw – Numpy array with transient raw data

Returns:

Numpy array with transient threshold value for extracting spike waveforms

get_spike_waveforms(xraw: numpy.ndarray, do_abs: bool, **kwargs) elasticai.preprocessor.framing.FrameWaveform[source]#

Function for extracting the spike waveforms from transient input

Parameters:
  • xraw – Numpy array with transient input

  • do_abs – Boolean for absolute threshold estimation

Returns:

Class FrameWaveform with waveforms, labels and position

get_spike_waveforms_from_positions(xraw: numpy.ndarray, xpos: numpy.ndarray, xoffset: int) elasticai.preprocessor.framing.FrameWaveform[source]#

Function for extracting the spike waveforms from transient input and given position

Parameters:
  • xraw – Numpy array with transient input

  • xpos – Numpy array with positions where spike waveforms are available (ground truth)

  • xoffset – Integer for shifting the xpos values

Returns:

Class FrameWaveform with waveforms, labels and position