Presentation is loading. Please wait.

Presentation is loading. Please wait.

US ARMY Approved for public release: Distribution unlimited A general-purpose low-cost solution for high-resolution temporal synchronization in human-subject.

Similar presentations


Presentation on theme: "US ARMY Approved for public release: Distribution unlimited A general-purpose low-cost solution for high-resolution temporal synchronization in human-subject."— Presentation transcript:

1 US ARMY Approved for public release: Distribution unlimited A general-purpose low-cost solution for high-resolution temporal synchronization in human-subject experimentation A general-purpose low-cost solution for high-resolution temporal synchronization in human-subject experimentation Jaswa, M. 1, Kellihan, B. 1, Cannon, M. 1, Hairston, W.D. 2, Gordon, S. 1, Lance, B. 2 1 DCS Corporation, 2 Human Research and Engineering Directorate, U.S. Army Research Lab Introduction Time synchronization across measurement devices in neuroscience experiments is critical for the analysis and interpretation of datasets, including performing electroencephalograph (EEG) studies. Currently available commercial options are expensive, and often limited to the integration of specific sensors. Measurement systems are susceptible to latency and jitter. Latency is the time between a signal onset and when it is recorded. Jitter is the variation in that latency; it can make correlating system events difficult or impossible. Jitter is caused by unpredictable variation in system clocks. Minimizing jitter is crucial to accurately synchronizing measurements, but can be challenging when several devices and clocks are involved in a system. The Arduino is a low-cost, open-source, easy-to-use microcontroller platform that provides sub-millisecond time resolution and supports integration of multiple digital and analog sensors. [1] It forms the basis of our solution, the temporal synchronization device (TSD). System Overview Experiment Setup: We built our solution to support an experiment that presented visual and audio stimuli and incorporated participant responses via buttons. The experiment system consists of four primary components connected via custom cable (Figure 1). Performance Acknowledgements Here we present an approach to handling time synchronization when adding various sensors to an experiment. Advantages Synchronization: Most jitter is one sample (0.49 ms) or less. Minimal Latency: The maximum latency between stimulus onset and recording inherent in the TSD is determined by the sample rate. At 1024Hz, it is about 0.98 ms. Scalable: Additional TSDs can be added to the system in parallel to support additional sensors. Inexpensive: The Arduino MEGA 2560 costs about $65. Additional parts brought the cost to about $100. General Purpose: The TSD supports a wide variety of digital and analog devices. Any digital sensor or other device that supports TTL can be easily integrated, as can any analog device that generates voltages in the 0V to +5V range. Easy to Use: The Arduino platform includes a mature development environment based on the C language, making development easy. The algorithm for reading sensor data is a simple read/write loop. Collecting data is easy: simply plug it in and start recording. Limitations Sensor/Sample Rate Tradeoff: Increasing the number of sensors limits the effective sample rate in a single TSD. ADC Resolution: The analog to digital converter provided by the Arduino is limited to 10 bits. Common Data: At least one data stream must be shared with the other components in the system. Hardware: We used an Arduino MEGA 2560 and built a custom shield to attach supporting circuitry and sensors. This model provides a large number of input pins (54 digital and 16 analog). It is the only Arduino-based option supporting our requirements (21 digital and two analog). Stimulus Computer BioSemi EEG SMI Eye Tracker TSD Figure 1: Test system components. Black arrows represent the propagation of the 16-bit event based trigger signals. Red arrows represent the BioSemi’s 2048Hz sample pulse. Receive BioSemi pulse and increment counter. Odd counter? Read each sensor value and triggers. Yes No Write data to USB port. Figure 3: Firmware algorithm to sample at half-speed (1024Hz). Data: Collected using experiment task 46 minute duration 631 trigger value changes TSD at 1024Hz BioSemi EEG at 2048Hz Comparison: We aligned the two datasets (BioSemi EEG and TSD) and compared the number of samples between each change to determine the amount of jitter (Table 1). We doubled the TSD sample numbers to account for the difference in sample rates. EEG SampleEEG DeltaEEG - TSDTSD DeltaTSD Sample 10938552836 129214198291983072666 13156923551235475020 153954223852238697406 15643724831248299888 1767722033520336120224 180233346113460123684 Table 1: Sample comparison between the EEG and TSD data in 2048Hz samples. Software: We wrote a custom program that reads the data recorded by the TSD and writes it to a file. This program displays real-time updates of the current values of the triggers and each sensor. It also has the ability to send updates about the state of the buttons via a computer network, allowing any networked device (e.g. stimulus computer) to react to the participant’s response. We found no instances in which the absolute value of the difference was greater than 2 samples, and 85% of the time it was less than or equal to 1 sample (Figures 4,5). This project was supported by Army Research Laboratory under the Cognition and Neuroergonomics Collaborative Technology Alliance (Cooperative Agreement Number W911NF-10-2-0022). Summary Cycle Time Limit: When sampling at 1024Hz, the amount of time that can be spent in each cycle of the read/write loop is about 970 µs (half that at 2048Hz). In our case, a single cycle takes about 750 µs. Strategies to deal with exceeding the time limit when adding sensors: 1.Decrease the sample rate. 2.Add additional TSDs in parallel with the first, splitting the sensors among them. Figure 2: Arduino MEGA 2560 Pushbuttons: Two on/off pushbuttons are used to measure participant response. Synchronization: Our solution synchronizes with the BioSemi EEG in two ways: 1.The TSD reads the BioSemi’s sample pulse, which allows it to sample the current values of the sensors at the same time that the BioSemi samples the EEG sensors. 2.The TSD and the BioSemi read the triggers generated by the stimulus computer simultaneously. Firmware: Custom firmware in the TSD operates by sampling the sensors each time a pulse is received from the BioSemi. A sample rate of 2048Hz (the BioSemi’s lowest speed) is too fast to read all of the inputs each cycle; we read them every other cycle, giving us an effective sample rate of 1024Hz (Figure 3). Audio: A stereo audio signal is used to measure audio stimulus onset. The signal generated by the soundcard on the stimulus computer is split, sending it to both the TSD and the computer speakers simultaneously. Each channel is converted from native sound card voltage (+/- 2.5V) to the range supported by the Arduino (0V to +5V), then passed through a 10-bit analog to digital converter (ADC). Figure 5: Jitter was equally distributed across the entire time tested, showing no trends or drift, and remaining within 2 samples error. 1. D’Ausilio, 2011, DOI 10.3758/s13428-011-0163-z. Sensors: Photodiodes: Two photodiodes are used to measure visual stimulus onset. Visual stimulus onset is measured by mounting a photodiode to a corner of the monitor screen and masking that region from view by the participant. Soundcard TSD Figure 4: Jitter was low, with only 15% of data exceeding 1 sample error.


Download ppt "US ARMY Approved for public release: Distribution unlimited A general-purpose low-cost solution for high-resolution temporal synchronization in human-subject."

Similar presentations


Ads by Google