Synchrony - Light Signal
Difficulty Level:
Tags pre-process☁synchrony☁light

OpenSignals software allows to acquire signals from multiple devices at the same time and using the synchronisation cable, available in , the signals are automatically synchronised in real time.

However, there might be cases in which it is not possible to use the synchronisation cable and the acquired signals may be dephased. In some cases, it might be helpful to synchronise the signals in order to compare them in the time domain. This can be achieved after acquisition with the </span> biosignalsnotebooks Python package.

The low-level explanation of synchronisation techniques is available in the Device Synchronisation - Cable, Light and Sound Approaches notebook.

In this Jupyter Notebook we will show how you can use the light sensor to synchronise all of your signals that were acquired with different devices.

1 - Import the required packages

In order to have access to all functionalities of </span> biosignalsnotebooks Python package, we have to import it.

In [1]:
# Import biosignalsnotebooks package
import biosignalsnotebooks as bsnb

2 - Open the files to see the signals

In this case, two light signals were acquired together but with a small dephase, because the acquisitions did not start at the same time. In order to use this type of signals to synchronise data, it is suggested to produce a distinctive event, which ensure that we can visually perceive the instant of synchronisation. In this case, the distinctive event was to turn on the light in a dark room.

In [2]:
path = '../../signal_samples/'
file_name_1 = path + 'sync_light_1.txt'
file_name_2 = path + 'sync_light_2.txt'

file_1 = bsnb.load(file_name_1)
file_2 = bsnb.load(file_name_2)
In [3]:
import numpy as np
bsnb.plot([np.arange(len(file_1['CH1'])), np.arange(len(file_2['CH1']))], [file_1['CH1'], file_2['CH1']])