Synchronization at a glance#
This page lists in tables how M3Resp puts recordings on one shared clock. For the explanation with examples, see Synchronization and breath timing. To slice recordings, see Slicing data to a time window.
All methods use an offset that you give. M3Resp does not measure the offset from the data.
Synchronization methods#
Method |
Workflow step |
What it does |
Recorded as |
|---|---|---|---|
|
|
Gives each loaded recording a start time on the shared clock. It removes no samples. Use it before or after the processing. |
|
|
Part of the |
Shifts the detected breaths ( |
|
|
The same two names |
The first step gives the offset that you entered. The second step gives it to |
|
|
|
Records that the recordings started together. It shifts nothing. |
|
M3Resp stores the “Recorded as” value of each recording in session.sync_methods.
You can also call these functions yourself. They record nothing in the session:
Function |
What it does |
|---|---|
|
Calculates offsets from the start times of the devices |
|
Shifts a list of events by an offset per modality |
|
Puts a signal on the time points of another signal |
How synchronization works#
Step |
What happens |
|---|---|
1. Load |
Each recording keeps its own clock and all its samples. |
2. Synchronize |
Each recording gets a start time in |
3. Process |
The breaths and signals of each modality stay on the clock of their recording. |
4. Compare |
M3Resp adds the start times only when it compares modalities: in |
5. Check |
If you compare recordings and one of them has no synchronization record, M3Resp gives an |
time on the shared clock = own time - own first time + start time
The clock of each type of data#
Data |
Its own time starts at |
Its clock |
How M3Resp decides |
|---|---|---|---|
EIT ( |
The time of day in the file, for example 36528.6 s. M3Resp subtracts the time of the first image. |
Its own ( |
|
EMG |
0 s at the first sample (sample number / sampling rate) |
Its own ( |
|
Ventilator data in the EMG file, for example the airway pressure in a Biopac export |
0 s |
The clock of the EMG. M3Resp slices it together with the EMG. |
Each file that does not end in |
Ventilator data in the EIT |
0 s, one sample per EIT image |
The clock of the EIT. M3Resp slices it together with the EIT. |
Each |
A separate ventilator or monitor file |
0 s |
Its own: |
Only if you load it with |
Assumptions#
Assumption |
What it means for you |
|---|---|
Without synchronization, each start time is 0. |
M3Resp takes the recordings as started together. The steps that compare recordings give a warning, unless you call |
Each recording has one fixed offset. |
M3Resp does not correct clocks that drift apart during a long recording. |
The sampling rate is exact. |
The time of a sample is its sample number / sampling rate. The EIT uses the times in the file. |
The reference recording starts at 0 s. |
If you give no reference, it is the ventilator, else the EIT, else the EMG. For the breaths, it is the ventilator if it has breaths, else the EIT. |
One number means the EMG. |
|
A new call replaces all start times. |
It does not add to the earlier start times. If you load a file again, its start time and its record are removed. |
The file name gives the type of a ventilator file. |
M3Resp takes a separate |
Breath linking uses the nearest breath. |
Two breaths link if their times differ by 0.5 s or less (the default). Each breath links once, the closest pair first. |
Where the code is#
What |
File |
|---|---|
The session methods |
|
Start times and the shift to the shared clock |
|
The synchronization record and the warning |
|
Offsets, the shift of events and the reference recording |
|
The clock of a ventilator recording |
|
Synchronization in the data model |
|
The workflow steps |
|
Continue with Synchronization and breath timing.