function hvector=deriv(vector)
% causal derivative

if size(vector,2)==1
	hvector=[vector;0]-[0;vector];hvector(1)=[];hvector(end)=[];
elseif size(vector,1)==1
	hvector=[vector 0]-[0 vector];hvector(1)=[];hvector(end)=[];
end