Module: tools#

befordata.tools.detect_sessions(rec, time_gap, time_column=None)#

Detect recording sessions in the BeForRecord based on time gaps

Return type:

BeForRecord

Parameters:
  • rec (BeForRecord) – the data

  • time_gap (float) – smallest time gap that should be considered as pause of the recording and the start of a new session

  • time_column (str | None, optional) – name of column that represents the time

Return type:

BeForRecord

befordata.tools.butter_filter(rec, order, cutoff, btype='lowpass', columns=None)#

Lowpass Butterworth filter of BeforRecord

temporarily shifted data (first sample = 0) will be used for the filtering

Return type:

BeForRecord

Parameters:
  • rec (BeForRecord) – the data

  • order (int) – order of the filter.

  • cutoff (float) – cutoff frequency

  • btype ({‘lowpass’, ‘highpass’, ‘bandpass’, ‘bandstop’}, optional) – type of filter, by default “lowpass”

  • columns (str | List[str] | None, optional) – column(s) of data the should be filtered. By default None; in this case, all data columns will be filtered

Return type:

BeForRecord with filtered data

Notes

see documentation of scipy.signal.butter for information about the filtering