wonambi.detect.arousal module

Module to detect arousals

class wonambi.detect.arousal.DetectArousal(method='HouseDetector', duration=None)[source]

Bases: object

Design slow wave detection on a single channel.

Parameters:
  • method (str) – one of the predefined methods

  • freq_band (tuple of (float or None)) – frequency band of interest in Hz

  • spectrogram (dict) –

    ‘dur’: float

    window length in sec

    ’overlap’: float

    ratio of overlap between consecutive windows

    ’detrend’: str

    ’constant’, ‘linear’ or False

  • det_thresh (float) – minimum factor increase of mean frequency between consecutive windows

  • min_interval (float) – minimum duration between consecutive arousals, in sec

  • duration (tuple of float) – min and max duration of arousals

wonambi.detect.arousal.detect_HouseDetector(dat_orig, s_freq, time, opts)[source]

House arousal detection.

Parameters:
  • dat_orig (ndarray (dtype='float')) – vector with the data for one channel

  • s_freq (float) – sampling frequency

  • time (ndarray (dtype='float')) – vector with the time points for each sample

  • opts (instance of 'DetectSlowWave') –

    ‘duration’tuple of float

    min and max duration of arousal

Returns:

  • list of dict – list of detected arousals

  • float – arousal density, per 30-s epoch

wonambi.detect.arousal.make_arousals(events, time, s_freq)[source]

Create dict for each arousal, based on events of time points.

Parameters:
  • events (ndarray (dtype='int')) – N x 5 matrix with start, end samples

  • data (ndarray (dtype='float')) – vector with the data

  • time (ndarray (dtype='float')) – vector with time points

  • s_freq (float) – sampling frequency

Returns:

list of dict – list of all the arousals, with information about start, end, duration (s),

wonambi.detect.arousal.splitpoint(a, sf)[source]