Mercurial > hg > dcase2013_ed_vuegenetal
diff functions/challange/convertEventListToEventRoll.m @ 0:2fadb31a9d55 tip
Import code by Vuegen et al
author | Dan Stowell <dan.stowell@elec.qmul.ac.uk> |
---|---|
date | Fri, 11 Oct 2013 12:02:43 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/functions/challange/convertEventListToEventRoll.m Fri Oct 11 12:02:43 2013 +0100 @@ -0,0 +1,17 @@ +function [eventRoll] = convertEventListToEventRoll(onset,offset,classNames) + + +% Initialize +eventRoll = zeros(ceil(offset(length(offset))*100),16); +eventID = {'alert','clearthroat','cough','doorslam','drawer','keyboard','keys',... + 'doorknock','laughter','mouse','pageturn','pendrop','phone','printer','speech','switch'}; + + +% Fill-in eventRoll +for i=1:length(onset) + + pos = strmatch(classNames{i}, eventID); + + eventRoll(floor(onset(i)*100):ceil(offset(i)*100),pos) = 1; + +end;