annotate aim-mat/tools/@frame/getweightedintervalsum.m @ 4:537f939baef0 tip

various bug fixes and changed copyright message
author Stefan Bleeck <bleeck@gmail.com>
date Tue, 16 Aug 2011 14:37:17 +0100
parents 74dedb26614d
children
rev   line source
tomwalters@0 1 % method of class @frame
tomwalters@0 2 %
tomwalters@0 3 % INPUT VALUES:
tomwalters@0 4 %
tomwalters@0 5 % RETURN VALUE:
tomwalters@0 6 %
tomwalters@0 7 %
tomwalters@0 8 % (c) 2003, University of Cambridge, Medical Research Council
tomwalters@0 9 % Stefan Bleeck (stefan@bleeck.de)
tomwalters@0 10 % http://www.mrc-cbu.cam.ac.uk/cnbh/aimmanual
tomwalters@0 11 % $Date: 2003/01/17 16:57:46 $
tomwalters@0 12 % $Revision: 1.3 $
tomwalters@0 13
tomwalters@0 14 function sumsig=getweightedintervalsum(cframe,gauss)
tomwalters@0 15 % usage: spectal_activity=getweightedspektralsum(cframe,gauss)
tomwalters@0 16 % returns the sum over frequency as function of interval
tomwalters@0 17 % the frame is weighted by "gauss"
tomwalters@0 18
tomwalters@0 19
tomwalters@0 20 number=length(cframe);
tomwalters@0 21 if number==1
tomwalters@0 22 val=cframe.values;
tomwalters@0 23 sval=val';
tomwalters@0 24 gava=getvalues(gauss);
tomwalters@0 25 for i=1:getnrpoints(cframe)
tomwalters@0 26 sval(i,:)=sval(i,:).*gava';
tomwalters@0 27 end
tomwalters@0 28 intervals=sum(sval');
tomwalters@0 29
tomwalters@0 30 sumsig=signal(intervals);
tomwalters@0 31 sumsig=setsr(sumsig,getsr(cframe));
tomwalters@0 32 sumsig=setname(sumsig,sprintf('Weighted sum of Frame: %s',getname(cframe)));
tomwalters@0 33 sumsig=setstarttime(sumsig,getminimumtime(cframe));
tomwalters@0 34
tomwalters@0 35
tomwalters@0 36 else
tomwalters@0 37 not implemented yet
tomwalters@0 38 end
tomwalters@0 39