1788acd17adf6b3d605b5ea66cf394eb81fc086a9pbos@webrtc.orgfunction [d, t] = readDetection(file, fs, chunkSize)
2788acd17adf6b3d605b5ea66cf394eb81fc086a9pbos@webrtc.org%[d, t] = readDetection(file, fs, chunkSize)
3788acd17adf6b3d605b5ea66cf394eb81fc086a9pbos@webrtc.org%
4788acd17adf6b3d605b5ea66cf394eb81fc086a9pbos@webrtc.org%Reads a detection signal from a DAT file.
5788acd17adf6b3d605b5ea66cf394eb81fc086a9pbos@webrtc.org%
6788acd17adf6b3d605b5ea66cf394eb81fc086a9pbos@webrtc.org%d: The detection signal.
7788acd17adf6b3d605b5ea66cf394eb81fc086a9pbos@webrtc.org%t: The respective time vector.
8788acd17adf6b3d605b5ea66cf394eb81fc086a9pbos@webrtc.org%
9788acd17adf6b3d605b5ea66cf394eb81fc086a9pbos@webrtc.org%file: The DAT file where the detection signal is stored in float format.
10788acd17adf6b3d605b5ea66cf394eb81fc086a9pbos@webrtc.org%fs: The signal sample rate in Hertz.
11788acd17adf6b3d605b5ea66cf394eb81fc086a9pbos@webrtc.org%chunkSize: The chunk size used for the detection in seconds.
12788acd17adf6b3d605b5ea66cf394eb81fc086a9pbos@webrtc.orgfid = fopen(file);
13788acd17adf6b3d605b5ea66cf394eb81fc086a9pbos@webrtc.orgd = fread(fid, inf, 'float');
14788acd17adf6b3d605b5ea66cf394eb81fc086a9pbos@webrtc.orgfclose(fid);
15788acd17adf6b3d605b5ea66cf394eb81fc086a9pbos@webrtc.orgt = 0:(1 / fs):(length(d) * chunkSize - 1 / fs);
16788acd17adf6b3d605b5ea66cf394eb81fc086a9pbos@webrtc.orgd = d(floor(t / chunkSize) + 1);
17