Noise is random. Its shape is not.
Ten minutes of reading with the examples of the manual. Move the sliders, then type the examples in MATLAB and compare.
Why randomness
A real channel adds noise and makes the received signal fade. Neither can be predicted sample by sample, but both follow a known distribution. To test a receiver in MATLAB we generate random numbers with that distribution and add them to the signal: Gaussian numbers for thermal noise, Rayleigh numbers for the fading of a mobile radio link without line of sight.
pdf and PDF
The probability density function f(x) gives the likelihood of a value near x; in a receiver x can be the received voltage. The probability that X falls in an interval is the area under f(x) over that interval. The probability distribution function F(x), also called the cumulative distribution function, adds the area up to x. A histogram of many random numbers, scaled so its area is 1, approaches the pdf.
Random numbers in MATLAB
Example 1 scales rand to an interval: a + (b − a)·rand(1,100) lies between a and b, and hist(N,10) counts the numbers in ten equal bins. With only 100 numbers the bars are uneven; raise the count and every bar approaches n/10, the flat shape of the uniform pdf. After rng('default') (and right after MATLAB starts) the first five values of rand are 0.8147, 0.9058, 0.127, 0.9134, 0.6324, and the first five of randn are 0.5377, 1.8339, -2.2588, 0.8622, 0.3188. Example 3 saves the generator with s = rng and restores it with rng(s), so z2 equals z1 exactly.
The Gaussian distribution
µ is the mean (also the median and the mode) and σ the standard deviation; the variance is σ². The manual draws the standard normal (µ = 0, σ = 1) with pdf('Normal',x,0,1), whose peak is 0.3989 at x = 0. Thermal noise in every receiver is Gaussian, because it is the sum of a huge number of tiny independent effects (the central limit theorem).
The Rayleigh distribution
The length of a vector whose two components are independent zero mean Gaussians with the same σ = B follows the Rayleigh distribution: the wind speed from its two components, or the magnitude of a complex number with Gaussian real and imaginary parts. The histogram in the demo is made exactly that way, from pairs of Gaussian numbers, and it follows raylpdf.
Rayleigh fading
In a city a mobile phone rarely sees the base station directly. The signal arrives along many reflected paths with random phases, and their sum is a complex Gaussian: its magnitude, the received amplitude, is Rayleigh distributed and drops deep into fades several times per wavelength of movement. Rayleigh fading is the standard model when there is no line of sight (urban streets, the ionosphere and the troposphere). With a strong direct path the amplitude follows the Rician distribution instead.
Check yourself
Q1What is the use of probability density in telecommunication?
It describes quantities that cannot be predicted exactly, such as noise voltage and fading amplitude. With the pdf of the noise we can find the probability of a bit error, design the decision threshold, and simulate a channel by generating random numbers with the same distribution.
Q2What is a probability density function?
A function f(x) ≥ 0 whose area over an interval is the probability that the random variable falls in that interval; its total area is 1. Its integral up to x is the probability distribution (cumulative) function F(x) = P(X ≤ x).
Q3Write down the mathematical relationship for the Gaussian distribution.
f(x) = (1/(σ√(2π)))·exp(−(x − µ)²/(2σ²)), where µ is the mean and σ the standard deviation.
Q4Explain the relationship of the Gaussian distribution.
The curve is a symmetric bell centred on the mean µ. σ sets its width: about 68 % of the values lie within µ ± σ, 95 % within µ ± 2σ and 99.7 % within µ ± 3σ. A larger σ gives a wider, lower curve because the area stays 1. With µ = 0 and σ = 1 it is the standard normal distribution.
Q5What is standard deviation?
The square root of the variance: σ = √(E[(X − µ)²]). It measures how far the values spread from the mean, in the same units as the values. For noise, σ² is the noise power.
Q6What is the use of the Rayleigh distribution?
It models the amplitude of a signal that reaches the receiver along many paths with no line of sight (Rayleigh fading in mobile radio), and any magnitude of a vector with two independent zero mean Gaussian components, such as wind speed.
Q7Explain the mathematical relationship for the Rayleigh distribution.
f(x) = (x/B²)·exp(−x²/(2B²)) for x ≥ 0 and 0 for x < 0. B is the σ of each Gaussian component. The pdf starts at 0, peaks at x = B with height e^(−1/2)/B, and has a long tail; its mean is B√(π/2).
Q8How are random numbers generated in MATLAB?
rand gives uniform numbers in (0, 1), randn standard normal numbers, randi random integers, and random or raylrnd numbers of other distributions. They are pseudorandom, from the Mersenne Twister by default; rng sets the seed (rng('default') resets it, s = rng saves it and rng(s) restores it) so a result can be repeated.