Using MATLAB, explain the code to perform a Monte Carlo simulation of a 4-PAM communication system. The simulation should be performed for 10,000 symbols, and the symbol-error probability should be measured when σ^2 = 0.5, where σ^2 is the variance of the additive Gaussian noise. The model of the system is as follows:
Error counter
Compare A with A
Uniform RNG
Mapping to amplitude level
Detector
A.
0, 2
Gaussian random number generator
The amplitude of the mth level is given by Am = (2m - 3), where m = 0, 1, 2, 3.