utils module

class package.entity.edata.utils.Utils

Bases: object

Class used to perform common multipurpose scientific calculations.

static apply_filter(b, a, data_in, initial_condition_list)

data_in: chan * sample

static butter_bandpass_scope(highcut, lowcut, fs, num_ch)
static butter_highpass(cutoff=0.05, fs=1200, order=2)
static butter_highpass_scope(highcut, fs, num_ch)
static butter_lowpass(cutoff=3, fs=1200, order=2)
static butter_lowpass_scope(lowcut, fs, num_ch)
static butter_notch(low_cut, high_cut, fs, order=2)
static butter_notch_scope(highcut, lowcut, fs, num_ch)
static construct_initial_condition_list(b, a, n_chan)

data_in: chan * sample

static fft(data, resolution, start_freq, end_freq, sample_rate)

Returns fft data between the frequency ranges specified in the input. Args:

data (numpy.ndarray): array of samples. resolution (float): increment in x-axis for frequencies start_freq (float): lower cutoff frequency (Hz). end_freq (float): Higher cutoff frequency (Hz). sample_rate (float): sampling rate (Hz).

Returns:

(numpy.ndarray): numpy array of frequency magnitudes

static lap(data_pre_lap)
static power(data)

Returns Power of data. Args:

data (numpy.ndarray): array of samples.

Returns:

(float): Power value

static preprocess(dataIn, ch_list)

dataIn: sample * chan

static read_protocol_csv(file_name)
static rms(data)

Returns RMS value of data. Args:

data (numpy.ndarray): array of samples.

Returns:

(float): RMS value

static save_protocol_to_csv(data, file)
static write_data_to_csv(data, file_name)
static write_dict_to_csv(dict, file_name)
static write_event_number_to_csv(dict)