Mercurial > hg > aasp-d-case-metrics
annotate event_detection/convertEventListToEventRoll.m @ 10:507300d2ed66 tip
merge
author | Dan Stowell <dan.stowell@elec.qmul.ac.uk> |
---|---|
date | Thu, 10 Oct 2013 09:18:47 +0100 |
parents | 2c9915c861d8 |
children |
rev | line source |
---|---|
emmanouil@0 | 1 function [eventRoll] = convertEventListToEventRoll(onset,offset,classNames) |
emmanouil@0 | 2 |
emmanouil@0 | 3 |
emmanouil@0 | 4 % Initialize |
emmanouil@0 | 5 eventRoll = zeros(ceil(offset(length(offset))*100),16); |
emmanouil@0 | 6 eventID = {'alert','clearthroat','cough','doorslam','drawer','keyboard','keys',... |
emmanouil@0 | 7 'knock','laughter','mouse','pageturn','pendrop','phone','printer','speech','switch'}; |
emmanouil@0 | 8 |
emmanouil@0 | 9 |
emmanouil@0 | 10 % Fill-in eventRoll |
emmanouil@0 | 11 for i=1:length(onset) |
emmanouil@0 | 12 |
emmanouil@0 | 13 pos = strmatch(classNames{i}, eventID); |
emmanouil@0 | 14 |
emmanouil@0 | 15 eventRoll(floor(onset(i)*100):ceil(offset(i)*100),pos) = 1; |
emmanouil@0 | 16 |
emmanouil@0 | 17 end; |