annotate _misc/featureextraction/.svn/text-base/synchronisechroma.m~.svn-base @ 9:4ea6619cb3f5 tip

removed log files
author matthiasm
date Fri, 11 Apr 2014 15:55:11 +0100
parents b5b38998ef3b
children
rev   line source
matthiasm@8 1 function bc = synchronisechroma(chromag, beats, frame_t)
matthiasm@8 2
matthiasm@8 3 % assigning beats to frames
matthiasm@8 4 nBeat = length(beats);
matthiasm@8 5 nFrame = size(chromag, 2);
matthiasm@8 6 beatassign = zeros(nFrame,1);
matthiasm@8 7 iBeat = 2;
matthiasm@8 8 minFrame = find(frame_t > beats(1),1);
matthiasm@8 9
matthiasm@8 10 bc = ones(nBeat,12);
matthiasm@8 11 chromag(:,isnan(sum(chromag))) = 1;
matthiasm@8 12
matthiasm@8 13 for iBeat = 1:nBeat-1
matthiasm@8 14 find()
matthiasm@8 15 bc(iBeat,:) = median(chromag(:,beatassign == iBeat),2);
matthiasm@8 16 if ~any(isnan(bc(iBeat,:)))
matthiasm@8 17 bc(iBeat,:) = bc(iBeat,:)/max(bc(iBeat,:));
matthiasm@8 18 end
matthiasm@8 19 end