d0a=sqrt(P_S)*y_p_(n+1)/r_ap_uv(n+1)+d0a;
end
d0=d0a/4+d0;
for i=4:6
m_9=mod(ns,2);
r_ap_uv_(i-3,n+1)=sqrt(P_S)*w_m_p_oc(i-3)*r_p_PUCCH1(m_9*N_PUCCH_RS*M_RS_sc+(i-4)*M_RS_sc+n+1);
end
end
d0=d0/12;
nsa=(ns-mod(ns,2))/2;
a2b=mod(nsa,3);
switch a2b
case 0
d1=1;
case 1
if d0>0
d1=1;
else
d1=-1;
end
case 2
d1=round(d0*sqrt(2))/sqrt(2);
end