APPENDIX B
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
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.
Amplifier data file: amplifier.dat
This file contains a matrix of ADC samples from all enabled SmartLink amplifier channels in int16 format. For example, if four amplifier channels are
enabled, data will be written in the following order:
amp1(t), amp2(t), amp3(t), amp4(t), amp1(t+1), amp2(t+1), amp3(t+1), amp4(t+1), amp1(t+2), amp2(t+2), ...
To convert to electrode voltage in microvolts, multiply by 0.195. If no amplifier channels are enabled in the GUI, this file will not be written.
The following MATLAB code reads an amplifier data file and creates an electrode voltage matrix with units of microvolts:
num_channels = length(amplifier_channels);
% amplifier channel info from header file
fileinfo = dir('amplifier.dat');
num_samples = fileinfo.bytes/(num_channels * 2);
% int16 = 2 bytes
fid = fopen('amplifier.dat', 'r');
v = fread(fid, [num_channels, num_samples], 'int16');
fclose(fid);
v = v * 0.195;
% convert to microvolts
p.40
NeuroNexus Technologies, Inc. ©2014
| 655 Fairfield Court, Suite 100, Ann Arbor, Michigan USA
Telephone: +1.734.913.8858 | Fax: +1.734.786.0069 |
support@neuronexus.com
Need help?
Do you have a question about the SmartBox and is the answer not in the manual?
Questions and answers