设置调制阶数 M = I ⋅ J M=I\cdot J M=I⋅J
例如, M = 8 M=8 M=8 时, I = 4 I=4 I=4 J = 2 J=2 J=2
function Pb=getMQAMBER(I,J,snr)
syms ii jj k l;
temp1=(-1)^floor(ii*2^(k-1)/I)*(2^(k-1)-floor(ii*2^(k-1)/I+1/2))*erfc((2*ii+1)*sqrt(3*snr/(I^2+J^2-2)));
PI=1/I*symsum(temp1,ii,0,(1-2^(-k))*I-1);
temp2=(-1)^floor(jj*2^(l-1)/J)*(2^(l-1)-floor(jj*2^(l-1)/J+1/2))*erfc((2*jj+1)*sqrt(3*snr/(I^2+J^2-2)));
PJ=1/J*symsum(temp2,jj,0,(1-2^(-l))*J-1);
Pb=(symsum(PI,k,1,log2(I))+symsum(PJ,l,1,log2(J)))/log2(I*J);
end
[1] Cho K , Yoon D . On the general BER expression of one- and two-dimensional amplitude modulations[J]. IEEE Transactions on Communications, 2002, 50(7):1074-1080.