function sp=rspeed(i,vl,sig);
%
%  returns the rarefaction speed of family 'i', the vector 'sig' determines
%  the values.
%
n=length(sig);
sg=0.5*(sig(2:n)+sig(1:n-1));
if i==1,
	h=[vl(1)+sg;vl(2)*ones(size(sg))];
	sp=0.5*sum(h)-0.25;
elseif i==2,
 	h=[vl(1)*ones(size(sg));vl(2)+sg];
	sp=0.5*sum(h)+0.25;
else
	error('Wrong i in rspeed');
end;
