|
AWGN | channel (1) or fading(0) % random bits mybits |
|
| figure (cf) |
|
| line ([-1.5, 1.5], [0 0], 'LineStyle', '-', 'Color', ln_clr, 'LineWidth', 1) |
|
else | plot (syms(:), 0,' *', 'MarkerSize', 16, 'LineWidth', 2) |
|
| axis (1.5 *[-1 1 -1 1]) |
|
| xlabel ('Inphase') |
|
| ylabel ('Quadrature') |
|
| title ('Constellation') |
|
| legend (hlegs, 'Tx', 'Rx', 'Fontsize', 16) |
|
| fprintf ("Symbol Error Rate = %12.4e\t Bit Error Rate = %12.4e\n", sym_err, bit_err) |
|
|
Author(s) | clear |
|
| MOD_ORDER = 16 |
|
Modulation order | N = 1000 |
|
| nbits = N * log2(MOD_ORDER) |
|
number of bits | snr = 15 |
|
| n_ant = 1 |
|
number of antennas | awgn = 1 |
|
Plot Tx constellation | cf = 0 |
|
| clf |
|
| ln_clr = [0.25, 0.25, 0.25] |
|
grid | on |
|
end axis | square |
|
hold | off |
|
| tx_clr = [0, 0.4470, 0.7410] |
|
| rx_clr = [0.8500, 0.3250, 0.0980] |
|
| hleg2 = plot(syms(:),'*','MarkerSize',16, 'LineWidth',2, 'Color', tx_clr) |
|
else | hleg1 = plot(rx_syms(:), 0,'o','MarkerSize',3, 'Color', rx_clr) |
|
end | hlegs = [hleg1 hleg2] |
|
Do your | selves |
|
| bit_err = mean(mybits ~= bits) |
|