Synchronizing EMG with 3D data

Synchronizing EMG data with a 3D data collection or motion capture system is something that sounds like it should be easy - but in real life it is very difficult to do.

Accurate, Cheap, or Easy . . . You can pick any two of these three data collection options but you can never have all three.

Motion Lab Systems EMG systems are designed to be used with any Motion Capture System that includes an Analog Data Collection facility - and ADC under the direct control of the marker data recording system - whether using retro-reflective markers or active tracking markers. This situation, where the Motion Capture system has complete control of the kinematic and analog data collection provides accurate, perfectly synchronized 3D and analog data to the end-user with no signal delays or other inconveniences that have to be accounted for post-collection.

If you are using one of our EMG systems and your 3D data collection environment matches the description above then you can stop reading here - the rest of this page does not apply to you, otherwise read on . . .

Using other EMG systems

If you're using another manufacturers EMG system with a Motion Capture System then you will need to determine the delay that the EMG system introduces into the EMG data before it reached the Motion Capture ADC. If your EMG system has any significant delays in its signal processing (20-50ms delays or more are not uncommon) then you will have to take the EMG system delay into account to accurately synchronize the two data streams. This is almost always unnecessary when using a Motion Lab Systems EMG system as our system delays are less than 2ms at 1kHz.

Generally data is considered to be synchronized when the individual data signals delays are less than 50% of the length of a video sample or 4ms at 120 fps (0.008/2 milliseconds).

If, for some reason, you can not use the Motion Capture system ADC to record the EMG data during 3D data collection then you're going to have to record the EMG data and Motion Capture data separately. This means that you will then have to merge and synchronize the data afterward. This is not going to be easy - it's the reason why Motion Capture manufacturers can charge good money for including ADC capabilities in their systems.

Using a slave Analog system

Start off by figuring out what control you have over your Motion Capture system - most Motion Capture systems have some abilities to remote trigger (RUN-STOP) the data collection. Read the manual and figure out how to control this feature if it exists because it's much easier to have one system (the Master) control the second system (the Slave). The basic idea here is to have control of one of the systems (usually the motion capture system) and use that as the "master" data collection - then setting up the second ADC system to record the EMG data whenever the motion capture system collects data.

If your EMG system has analog outputs (and for some reason you can't connect these to the motion capture system) then you will need an external ADC and probably an PC to control it - this is the slave ADC. If this is the case then read the manual on the EMG ADC unit and see if you have some form of remote control (RUN-STOP) that you can activate using the Motion Capture system - you're looking for some what to control the slave data collection. If you can use the Motion Capture system to control the second ADC then you'll be able to record kinematic data using the Motion Capture system and EMG data into a separate file on the PC.

You can assume that both the Motion Capture system and the slave ADC will start recording data at the same time but often this is not the case and there are small delays associated with starting to data collection process. Therefore, once you can slave the second ADC to the Motion Capture system you will have to find some way to verify that the two data streams (kinematic and Analog data) are synced - that an event recorded by the Motion Capture system happens at exactly the same time as it is recorded on the slave ADC.

So, having successfully slaved the ADC system to the Motion Capture system you will have to get both the Kinematic data file and the analog data file merged together. Note that the data collection system delay is separate and additional to any EMG system delay discussed earlier.

If your EMG system does not have analog outputs - direct USB connection to a PC perhaps - then you'll have to figure out what remote control capabilities are provided with EMG system. Assuming that the EMG system has a RUN-STOP control line somewhere then the procedure is similar to the method described above - the Motion Capture system will start the EMG system collecting data and the two data streams will have to be synchronized the data post-collection. In this circumstance there will only be one delay associated with the EMG system - the EMG system manufacturer should be able to document the delay and repeatability of the delay.

Collecting data without a master/slave

But what if the EMG system / analog data collection system doesn't have any remote control capabilities? Or if the data collection is controlled via a GUI mouse click? This is the worst possible situation but assuming that the system has some means of recording EMG data - and that you can retrieve the data later - then it's still possible to make this work.

In this situation you're going to have to start both the EMG system and the Motion Capture system manually and collect the kinematic and EMG data asynchronously. In order to synchronize the two data streams you will need some signal that is common to both systems so that you can merge the two data streams later. How well this will work depends on the signals that are available - generally the easiest method is to either tap into a gated camera sync signal (present when the camera strobes are fired), or generate a gated sync signal from the Motion Capture data collection. Typically this would be a sync pulse that is present when kinematic data is being recorded - usually a pulse at the camera frame rate. This sync signal can then be recorded by the EMG system to provide a common sync signal.

In this situation you'll start the EMG system running and then start the Motion Capture system to collect the kinematic data - after each trial you will have to stop the two systems, ready to restart them both for the next trial. Then, post-collection, you'll have to read the EMG data and merge it with the Motion Capture data using the gated sync pulses that you recorded into the EMG data stream to guide you.

Points to watch:
If you connect the EMG system and the Motion Capture system to get a sync signal then be very careful that you don't invalidate the electrical isolation of the EMG system by connecting the isolated and non-isolated sides of the system together. Ask your EMG system manufacturer about this if you are in any doubt about the electrical isolation of your subject.

Check the synchronization between the two systems at least a dozen or more times - don't assume that the synchronization delays when using a master/slave configuration will always be the same every time the systems start.

Check the EMG system delay (subject muscle to EMG output) - EMG systems designed for motion capture use will have very low delays (less than the camera frame rate) but EMG systems intended for biofeedback and other uses may have much larger delays. You'll need to account for this delay in order to synchronize the data.

Try and make sure that the EMG sample rate is a multiple of the motion capture camera frame rate to make your synchronization easier later - and make sure that you sample the EMG data fast enough. Your minimum EMG sample rate must be twice the bandwidth of your EMG system e.g. if the EMG system has a 1000Hz bandwidth and your cameras are running at 60Hz then your minimum EMG sample rate is 2000 sample/sec and the closest multiple of the camera frame rate is 34 - so sample the EMG at 2040 samples/sec.

It's going to be harder than you expect to synchronize the EMG data with the Motion Capture data - if your Motion data is stored in the C3D format then you can use the C3Dserver to read and write the C3D data but you'll still have to figure out the format used to store the EMG data.