function [ output ] = shiftingSum( data,factor )
%shiftingSum downsampling by taking the sum
%   taking the sum of $factor data as new datum
    dataSize=size(data);
    output=zeros([fix(dataSize(1)/factor),dataSize(2:end)]);
    for i=1:size(output,1)
        output(i,:)=sum(data(fix(round((i-1)*factor))+1:min(fix(round(i*factor)),dataSize(1)),:),1);
    end
end

