Mercurial > hg > aimc
comparison trunk/matlab/AIMCread.m @ 614:b5dca605c3d5
Add option to dump strobes
author | tomwalters@google.com |
---|---|
date | Tue, 07 May 2013 14:24:33 +0000 |
parents | 99f9bf0f7798 |
children |
comparison
equal
deleted
inserted
replaced
613:c14c83f3d5d6 | 614:b5dca605c3d5 |
---|---|
1 function [data, nFrames, period, nChannels, nSamples, sample_rate] = AIMCread(filename) | 1 function [data, nFrames, period, nChannels, nSamples, sample_rate] = ... |
2 AIMCread(filename, strobes_filename) | |
2 %[data, nFrames, period, nChannels, nSamples ] = AIMCread( filename) | 3 %[data, nFrames, period, nChannels, nSamples ] = AIMCread( filename) |
3 % | 4 % |
4 % data ... matrix (or array) of size [nFrames,nChannels,nSamples] | 5 % data ... matrix (or array) of size [nFrames,nChannels,nSamples] |
5 % in case vertical/horizontal profiles are read, you should use squeeze | 6 % in case vertical/horizontal profiles are read, you should use squeeze |
6 % nFrames ... number of frames | 7 % nFrames ... number of frames |
7 % period ... Frame interval in ms | 8 % period ... Frame interval in ms |
8 % nChannels ... points on vertical axis of an auditori image | 9 % nChannels ... points on vertical axis of an auditory image |
9 % nSamples ... points on horizontal axis of an auditori image | 10 % nSamples ... points on horizontal axis of an auditory image |
10 | 11 |
11 fid = fopen(filename); | 12 fid = fopen(filename); |
13 | |
14 strobes_fid = -1; | |
15 if nargin > 1 | |
16 strobes_fid = fopen(strobes_filename); | |
17 strobes_raw = fread(strobes_fid, [], 'int32'); | |
18 end | |
12 | 19 |
13 debug = 0; | 20 debug = 0; |
14 | 21 |
15 nFrames = fread( fid, 1, 'uint32'); | 22 nFrames = fread( fid, 1, 'uint32'); |
16 period = fread( fid, 1, 'float32'); % Frame period in ms | 23 period = fread( fid, 1, 'float32'); % Frame period in ms |