1function [svec] = apsk_ser(Esvec, M)
2% Return approx (uncoded) SER for 16 or 32 APSK, or plot SERs if no args
3% USAGE apsk_ser();   OR   SERvec = apsk_ser(Esvec_dBs, M)
4% VK5DSP,  July 2020
5
6% Fit 3rd order polys to data in Figure 3 of
7% "Perf anal of APSK mod for DVB-S2 trans over nonlinear channels"
8% by Wonjin Sung et al;
9% Published in Int. J. Satellite Communications Networking, 2009
10% (see Fig 1 for constellation diagrams and bit mappings)
11
12% from the Figure data, we get 2 polynomials ...
13%{
14Fig3_Es = [10  12.5 15 17.5 20 21];
15Fig3_16_SER = [2e-1 8e-2 2.5e-2 3e-3 1e-4 2e-5];
16Fig3_32_SER = [4e-1 2.8e-1   1.5e-1 4e-2 1e-2  4e-3  1.05e-5];
17
18p16 = polyfit(Fig3_Es, log10(Fig3_16_SER), 3)
19p32 = polyfit([Fig3_Es 25], log10(Fig3_32_SER), 3)
20%}
21
22p16 =  [-0.001816729857582   0.053322736530042  -0.653699203208837   2.315143765468362];
23p32 =  [-0.001418894437779   0.049903575028137  -0.669130206501662   2.743251206655785];
24
25if nargin==0
26    EStest = 10:21;
27    EStest2 = 10:25;
28    SER16 = polyval(p16, EStest);
29    SER32 = polyval(p32, EStest2);
30    figure(55);
31    semilogy(EStest,  10.^SER16,  'b', EStest2,  10.^SER32, 'g')
32    title('Approx Symb Error Rates for APSK')
33    xlabel('Es/N0  (dB)')
34    ylabel('SER');   grid on;
35    legend('16APSK','32APSK');   legend('boxoff')
36elseif nargin~=2,
37    error('usage is apsk_ser(Esvec, M)');
38
39else
40    if (M~=16)&&(M~=32)
41        error('M must be 16 or 32')
42    end
43    if min(Esvec)<8,
44        error('Es/No values should be > 8 dB');
45    end
46    if (M==16) && (max(Esvec)>23),
47        error('Es/No values should be < 23 dB');
48    end
49    if (M==32) && (max(Esvec)>27),
50        error('Es/No values should be < 27 dB');
51    end
52
53    if M==16, svec = 10.^polyval(p16, Esvec);  end
54    if M==32, svec = 10.^polyval(p32, Esvec);  end
55
56end
57