Index of /people/artem/projects/tools/save_ai

Icon  Name                          Last modified      Size  Description
[DIR] Parent Directory - [TXT] save_ai.c 01-Jul-2005 22:34 5.2K [TXT] save_ai.h 01-Jul-2005 22:34 489 [TXT] save_ai_crop.m 10-Aug-2005 14:12 1.8K [   ] save_ai_interspike.m 10-Aug-2005 14:12 2.6K
Artem: tools: save_ai

save_ai

Stands for "Save analogue inputs". Uses Comedi library to captures all samples from two input channels of National Instruments DAQ board. Stores in memory, does not write to hard drive to avoid loss of samples during the write procedure. Dynamically allocates more memory as required, periodically reports RAM usage. Samples are stored in millivolts as 16-bit integers. One hour of recording at 10KHz rate amounts to roughly 150Mb memory usage. Samples may be lost if swapping starts. Was not really tested at other sampling rates.

Source files: save_ai.c, save_ai.h
Usage:
save_ai frequency outfilename

Example:
save_ai 10000 20051103_1

Use Ctrl-C to stop acquisition
Program exits after writing stored samples to the hard drive.

Note!
Running this program locks the acquisition board: no other process will be able to communicate with the board, including Optostim GUI, testpulse.m, etc.

To load and display saved data in Matlab:
save_ai_crop(filename, frequency, skip_minutes, length_seconds, which_channels)

Examples:
save_ai_crop('20050623_5',10000)     % just check the size of data
saved_5_minute21 = save_ai_crop('20051103_5', 10000, 20, 60, 2)     % load data
plot(saved_5_minute21.time_sec, [saved_5_minute21.ch0_mV, saved_5_minute21.ch1_mV])     % Be patient: it takes time to plot several millions of samples.
save_ai_interspike

Send complaints, comments, suggestions to Artem Starovoytov