DAQ Sync Alignment Barcodes

DAQ Sync Alignment Barcodes

Align and synchronize data acquisition systems

Herein is an expansion on aligning barcode start times to align Secondary to Main data for the DAQ Synchronization project. This can be a standalone project or can be considered part of the overall DAQ Synchronization Project. With this part of the project, two or more DAQs have recorded a unique barcode signal coded in a TTL pulse train, and we wish to use this signal to align the systems. A previous part of this project extracted the barcode signals and outputted the barcodes and start times for each DAQ as a separate Numpy (.npy) file. For this code, you will need the barcodes/index values .npy file for two DAQ that recorded the barcodes during the same recording session, and the processed data file from your Secondary DAQ (LJ in our case) to be aligned to the Main DAQ data.

All DAQ Synchronization project code (with example data!) can be found within this zip file. Simply download and extract. Or, if you want just the code for this part of the project, see here.

User Input

Most of the code need not be altered. However, we encourage users to take a look under the hood and learn some coding, email us here if you find issues (Note: We are sharing this code, which works for our needs, but comes with no guarantees. It probably has issues and definitely is sloppy), make your boss think you are a hacker by using this as a wallpaper, or update the code to fit your needs. The most important variables that a user could change are listed up at the top of the code. An explanation of them can be found below:


Input Variables:

  • main_sample_rate = (int) The sampling rate (in Hz) of the “main” DAQ, to which the secondary data will be aligned.
  • secondary_sample_rate = (int) The sampling rate (in Hz) of the “secondary” DAQ, which will be aligned to the “main” DAQ.
  • convert_timestamp_column = (int) The timestamp column in the processed “secondary” data file; this will be converted to match the timestamps in the original “main” data.

Output Variables:

  • alignment_name = (str) The name of the file(s) in which the output will be saved in the chosen directory.
  • save_npy = (bool) Set to “True” to save the aligned data as a .npy file.
  • save_csv = (bool) Set to “True” to save the aligned data as a .csv file.

ONE Core acknowledgment

Please acknowledge the ONE Core facility in your publications. An appropriate wording would be:

“The Optogenetics and Neural Engineering (ONE) Core at the University of Colorado School of Medicine provided engineering support for this research. The ONE Core is part of the NeuroTechnology Center, funded in part by the School of Medicine and by the National Institute of Neurological Disorders and Stroke of the National Institutes of Health under award number P30NS048154.”