R=aluebs@webrtc.org, bjornv@webrtc.org BUG= Review URL: https://webrtc-codereview.appspot.com/32769004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7893 4adac7df-926f-26a2-2b94-8c16560cd09d
17 lines
523 B
Matlab
17 lines
523 B
Matlab
function [d, t] = readDetection(file, fs, chunkSize)
|
|
%[d, t] = readDetection(file, fs, chunkSize)
|
|
%
|
|
%Reads a detection signal from a DAT file.
|
|
%
|
|
%d: The detection signal.
|
|
%t: The respective time vector.
|
|
%
|
|
%file: The DAT file where the detection signal is stored in float format.
|
|
%fs: The signal sample rate in Hertz.
|
|
%chunkSize: The chunk size used for the detection in seconds.
|
|
fid = fopen(file);
|
|
d = fread(fid, inf, 'float');
|
|
fclose(fid);
|
|
t = 0:(1 / fs):(length(d) * chunkSize - 1 / fs);
|
|
d = d(floor(t / chunkSize) + 1);
|