function ber=calculaber(sinfh,Sest)



    bitsss=[sign(real(sinfh)) sign(imag(sinfh))];
    size(bitsss);
    bitssing=[sign(real(Sest)) sign(imag(Sest))];
    size(bitssing);
    bd=bitsss-bitssing;
    ber=sum(sum((abs(bd))/2)/(size(bd,2)*size(bd,1)));
   
    
