blob: 1a9e8a7e6442c5b6df81071a69cf24fe8041088e [file] [log] [blame]
pbos@webrtc.org788acd12014-12-15 09:41:24 +00001function [d, t] = readDetection(file, fs, chunkSize)
2%[d, t] = readDetection(file, fs, chunkSize)
3%
4%Reads a detection signal from a DAT file.
5%
6%d: The detection signal.
7%t: The respective time vector.
8%
9%file: The DAT file where the detection signal is stored in float format.
10%fs: The signal sample rate in Hertz.
11%chunkSize: The chunk size used for the detection in seconds.
12fid = fopen(file);
13d = fread(fid, inf, 'float');
14fclose(fid);
15t = 0:(1 / fs):(length(d) * chunkSize - 1 / fs);
16d = d(floor(t / chunkSize) + 1);