resurfemg.pipelines.synthetic_data module

Copyright 2022 Netherlands eScience Center and University of Twente Licensed under the Apache License, version 2.0. See LICENSE for details.

This file contains functions to generate mixed (signal and noise) synthetic data.

resurfemg.pipelines.synthetic_data.simulate_raw_emg(t_end, fs_emg, emg_amp=5, rr=22, **kwargs)

Generate realistic synthetic respiratory EMG data remixed with ECG

param t_end:

length of synthetic EMG tracing in seconds

type t_end:

int

param fs_emg:

Sampling rate

type fs_emg:

int

param emg_amp:

EMG amplitude

type emg_amp:

~float

param rr:

Respiratory rate (/min)

type rr:

float

param **kwargs:

Optional arguments: ie_ratio, tau_mus_up, tau_mus_down, t_p_occs, drift_amp, noise_amp, ecg_acceleration, ecg_amplitude. See data_connector.synthetic_data respiratory_pattern_generator, simulate_muscle_dynamics, and simulate_emg functions for specifics

type **kwargs:

float, float, float, list[int], float, float, float

returns emg_raw:

The realistic synthetic EMG

rtype emg_raw:

numpy.ndarray

resurfemg.pipelines.synthetic_data.simulate_ventilator_data(t_end, fs_vent, p_mus_amp=5, rr=22, dp=5, **kwargs)

Generate realistic synthetic ventilator tracings

param t_end:

length of synthetic ventilator tracings in seconds

type t_end:

int

param fs_vent:

Sampling rate

type fs_vent:

int

param p_mus_amp:

Respiratory muscle pressure amplitude (positive)

type p_mus_amp:

float

param rr:

Respiratory rate

type rr:

float

param **kwargs:

Optional arguments: ie_ratio, tau_mus_up, tau_mus_down, t_p_occs, c, r, peep, flow_cycle, flow_trigger, tau_dp_up, tau_dp_down. See data_connector.synthetic_data respiratory_pattern_generator, simulate_muscle_dynamics, simulate_ventilator_data functions for specifics

type **kwargs:

float, float, float, list[int], float, float, float, float, float, float, float

returns y_vent:

The realistic synthetic ventilator data

rtype y_vent:

numpy.ndarray

returns p_mus:

The respiratory muscle pressure

rtype p_mus:

numpy.ndarray

resurfemg.pipelines.synthetic_data.synthetic_emg_cli(n_emg, output_directory, **kwargs)

Generate realistic, single lead, synthetic respiratory EMG data remixed with ECG through command line using the cli. ————————————————————————— :param file_directory: file directory where synthetic ecg are :type file_directory: str :param n_emg: number of EMGs to simulate :type n_emg: int :param output_directory: file directory where synthetic emg will be put :type output_directory: str

Parameters:

**kwargs (float, float, float, float, float, float, float, list[int], float, float, float, float, float) – Optional arguments: t_end, fs_emg, emg_amp, rr, ie_ratio, tau_mus_up, tau_mus_down, t_p_occs, drift_amp, noise_amp, heart_rate, ecg_acceleration, ecg_amplitude. See data_connector.synthetic_data respiratory_pattern_generator, simulate_muscle_dynamics, and simulate_emg functions for specifics

Returns:

None

Return type:

None

resurfemg.pipelines.synthetic_data.synthetic_ventilator_data_cli(n_datasets, output_directory, **kwargs)

Generate realistic synthetic respiratory EMG data remixed with ECG through command line using the cli. ————————————————————————— :param file_directory: file directory where synthetic ecg are :type file_directory: str :param n_emg: number of EMGs to simulate :type n_emg: int :param output_directory: file directory where synthetic emg will be put :type output_directory: str

Parameters:

**kwargs (float, float, float, float, float, float, float, float, list[int], float, float, float, float, float, float) – Optional arguments: t_end, fs_vent, p_mus_amp, rr, dp, ie_ratio, tau_mus_up, tau_mus_down, t_p_occs, c, r, peep, flow_cycle, flow_trigger, tau_dp_up, tau_dp_down. See data_connector.synthetic_data respiratory_pattern_generator, simulate_muscle_dynamics, simulate_ventilator_data functions for specifics

Returns:

None

Return type:

None