for i=1:r % mu=getmu(r,SNR,T,p,M);%determine mu value (see eqn. (1.30)) temp2=0; for k=1:r-p+1 temp1=1/(eigen(k)^2); temp2=temp2+temp1; temp1=0; end if r-p+1~=0 mu=(M/(r-p+1))*(1+(1/snr)*temp2);