function r=rate1(t,q)

eps=ones(size(t))/10^10; % small unit to prevent overflows

r=-sum( q.*log2(q+eps)./(t+eps) )*16000;
