How to compare the breath timing of two modalities#

See Breath timing parameters for the definition of each timing parameter.

Before you start, synchronize the recordings (see How to synchronize recordings) and detect the breaths in each modality.

Calculate the timing parameters#

timing_parameters = session.compute_breath_timing_parameters()

M3Resp adds the results to session.parameter_results. A new call replaces all timing results of the previous call.

For each pair of modalities, M3Resp calculates:

Parameter

Value

Unit

<a>_to_<b>_delay

Time of the breath in modality b minus time of the breath in modality a, for each linked breath. A positive value means that b comes later.

s

<a>_<b>_duration_difference

Duration of the breath in modality a minus duration of the breath in modality b, for each linked breath.

s

<a>_<b>_event_agreement

Of the linked breaths that have a breath of a or b, the fraction that has both.

fraction (0 to 1)

Compare another moment of the breath#

The delay uses the start time of each breath. To use another moment, set anchor:

anchor

Moment

"start" (default)

The start of the breath

"extremum"

The extremum: the highest impedance (EIT), the highest muscle activity (EMG)

"end"

The end of the breath

session.compute_breath_timing_parameters(anchor="extremum")

Note

The default EMG breath detection gives only the time of the highest point of the envelope. The start time and the end time of each EMG breath are equal to that time. So with anchor="start", the EIT to EMG delay compares the start of the EIT breath with the highest EMG activity.

Select the modality pairs#

By default, M3Resp calculates the parameters for each pair of modalities that has breaths, in alphabetical order. To select the pairs, set delay_pairs and duration_pairs. A pair (a, b) gives the delay from a to b. An empty list skips that parameter.

session.compute_breath_timing_parameters(delay_pairs=[("emg", "eit")], duration_pairs=[])

This call calculates only the EMG to EIT delay and the EMG and EIT event agreement.