NeuroNexus Technologies, Inc. ©2014
| 655 Fairfield Court, Suite 100, Ann Arbor, Michigan USA
Telephone: +1.734.913.8858 | Fax: +1.734.786.0069 |
APPENDIX B
with units of seconds.
The use of the
int32
data type means that this number will not “roll over” until total recording times exceed 19.8 hours with the maximum sample rate
of 30 kS/s, or 29.8 hours with a sample rate of 20 kS/s.
The following MATLAB code reads a timestamp data file and creates a time vector with units of seconds:
fileinfo = dir(
‘time.dat’
);
num_samples = fileinfo.bytes/4;
% int32 = 4 bytes
fid = fopen(
‘time.dat’
,
‘r’
);
t = fread(fid, num_samples,
‘int32’
);
fclose(fid);
t = t / frequency_parameters.amplifier_sample_rate;
% sample rate from header file
Amplifier data files
Each amplifier data file has a filename that begins with
amp
followed by the SPI port letter and channel number. For example:
amp-A-000.dat,
amp-C-063.dat,
or
amp-D-027.dat.
Each amplifier data file contains the consecutive ADC samples from one enabled SmartLink amplifier channel in
int16
format. To convert to electrode
voltage in microvolts, multiply by 0.195.
The following MATLAB code reads an amplifier data file and creates an electrode voltage vector with units of microvolts:
fileinfo = dir(
‘amp-B-003.dat’
);
num_samples = fileinfo.bytes/2;
% int16 = 2 bytes
fid = fopen(
‘amp-B-003.dat’
,
‘r’
);
v = fread(fid, num_samples,
‘int16’
);
p.45