Noise has no formula, but draw many of its values, sort them into bins, and they pile up in the same shape every time. Watch the bars settle onto the curve as the draws grow from 10 to 10 000.
Draws pile up into a density
Gaussian draws from the site's generator (seed 241), bins 0.5 wide, bars scaled to area 1.
Ten draws: a ragged histogram. Their average is −0.005 and their spread (variance) 1.255.
Describe this picture
One panel of Gaussian draws from the site’s generator (seed 241), sorted into bins 0.5 wide, with the bars scaled to area 1: density from 0 to 0.7 against value from −4.5 to 4.5. The bars are outlined, the density is a thin solid curve labelled “density”, and the newest draws drop onto their bars as small dots. The readouts are the number of draws , their mean and their variance. The clip has no control. It opens on ten draws, a ragged histogram: mean −0.005 and variance 1.255. Draws rain in to 100, where the bars start to follow the curve (−0.051 and 0.898), then to 1000 (0.063 and 0.993), then to 10 000. There dotted lines appear at −1 and 1, labelled “68 %”, and the bars sit on the density: mean −0.002, variance 1.027, and 67.57 % of the draws within ±1. After the clip two buttons in a group named “Density”, “Gaussian” and “uniform”, switch the draws. “uniform” draws the flat density at 0.2887 between ±1.73, and the caption notes that the two end bins stick out past ±1.73.
Draws pile up into a density
In “Predictable, or not” of Kinds of signals (1.2), a steady tone sat beside noise. The tone has a formula and the noise has none. Yet noise is not lawless: draw many of its values, and they pile up in a shape that is the same every time. This page is about that shape.
A random variable is a number you get fresh each time you look. Each look is a draw. I write the random variable as , and its draws, numbered in the order they came, as , and so on. A noise trace on this site is such a row of draws.
When the draws of a signal depend on each other, the signal is a random process, the subject of Random processes (24.2). Here every draw is made afresh, on its own. This page assumes no statistics: I define each term before I use it, and leave the proofs to statistics.
The probability of an event is the share of draws in which it happens, in the long run. I write it . If is the roll of a fair die, : one roll in six, over many rolls.
To see the shape of many draws, sort them into bins of width 0.5 and count each bin. Then divide each count by , where is the number of draws. A bar’s area is its height times 0.5, which is its count divided by : the share of the draws that landed in it. All the bars together have area 1.
As grows, the bars settle on a curve, the density . I use for a value on the axis, to keep it apart from the random variable . The probability that a draw lands between and is the area under the density there:
Every draw lands somewhere, so the total area is 1. A density is never negative, but it can be larger than 1: it is a probability per unit of width, not a probability.
The density met most often in signal work is the Gaussian, a bell. With mean 0 and variance 1 (both defined just below) it is
which peaks at at a height of . The site’s generator, gaussian in lib/random.ts, makes such draws from pairs of seeded uniform numbers, so every visit sees the same draws.
The picture at the top of the page has two readouts that follow the draws. The mean is their plain average, the of “Four everyday sizes” in How big is a signal (1.3). The variance is their average squared distance from that mean, a measure of how widely they spread.
Watch the variance readout: 1.255, 0.898, 0.993, 1.027. Ten draws can be far off, but ten thousand land within 3 % of the density’s 1. The tallest bar tells the same story. With ten draws it is 0.600, three draws in one bin; at 10 000 it is 0.380.
Even then the tallest bar stays a little below the curve’s peak, 0.3989. A bar shows the curve’s average over its width, and next to 0 that average is 0.3829.
Mean and variance
The expected value of anything that depends on is its average over the density: each value weighted by how likely it is. The mean and the variance are two expected values, with the integrals running over every value:
The variance is the average power of 1.3, measured about the mean. For noise with mean 0 it is simply the average power . Its square root is the standard deviation, and for mean-0 noise that is the RMS. So the 0.2 kg RMS noise of “A longer average: less noise, more delay” in Simple smoothing filters (18.2) has a standard deviation of 0.2 kg.
The density is never known from a finite set of draws, only estimated. A hat means “estimated from draws”:
The first is 1.3’s mean of the draws. The estimates change with every new set of draws, while and do not, and the first picture’s readouts are these two estimates. NumPy’s mean and var compute them; var divides by unless told otherwise.
A Gaussian can have any mean and any standard deviation. It is the bell above, moved to and widened by :
Its areas are worth knowing by heart. Within 1, 2 and 3 standard deviations of the mean lie 68.27 %, 95.45 % and 99.73 % of all draws. The 10 000 draws give 67.57 %, 95.44 % and 99.68 %.
A Gaussian has no edge, though. About 3 draws in 1000 land further out than 3 standard deviations, so noise has no fixed peak value.
The uniform density
The uniform density is flat. Every value in a width is equally likely, and no value outside it ever comes. Its height is , so its area is 1, and its mean is the middle of the width.
“The error of a slow ramp” in Quantization & noise (11.1) found its variance: a value spread evenly over a width has mean square about its middle. That is the rounding error of 11.1’s noise model, a uniform draw over one step.
A width of gives variance 1 and height . The generator’s uniform numbers run from 0 to 1, so runs from to .
After the clip, press “uniform” under the first picture. It draws 10 000 values as , with from the same seed, and draws the flat density at 0.2887 between ±1.73. The mean and variance read −0.022 and 0.993: the width was chosen for variance 1.
Look at the ends, though. The inner bars read 0.272 to 0.301, but the two end bars only 0.137 and 0.135. Their bins run from 1.5 to 2 and from −2 to −1.5, and the density stops at ±1.732, so less than half of each bin can catch draws.
Sums of draws
Add two draws that are made separately, with nothing linking them, and their variances add. This is “the powers add” of 18.2, now said of spread about the mean. The next section names this kind of pair: independent.
11.2’s triangular dither is the sum of two separate uniform values, each of width . So its variance is , twice that of rectangular dither. Add the rounding’s own , and you have the that “Rectangular or triangular dither” in Dither (11.2) found.
The sum of two uniform values has a triangular density, which is where the name comes from. Add more of them and the shape rounds off further. Add many independent values, all with one density of finite variance, and the sum looks Gaussian, whatever that density was.
This is the central limit theorem, and statistics proves it. It is why thermal noise is Gaussian: it is the sum of countless tiny motions of electrons.
The maths behind it · sample mean and variance
Statistics writes a random variable as a capital X and its density . This site’s DSP pages write a lowercase and , because capitals are transforms here. The estimates and are that track’s sample mean and (biased) sample variance.
A cloud that leans: correlation
Now take two values per draw, a pair : say a sensor’s error and its neighbour’s. Pairs have a joint density, spread over a plane instead of along a line. The probability that a pair lands in a region is the volume under the joint density there.
Two random variables are independent when knowing one tells you nothing about the other. Then the joint density is the product of the two densities, and averages of products split: .
Pairs that are not independent can hang together in many ways. The simplest measure of how they do is their correlation coefficient:
It always lies between −1 and 1. It is 1 when the pairs lie on a rising straight line, −1 on a falling one, and 0 when there is no straight-line trend. Its estimate puts estimates from the pairs in place of each expected value and each , and NumPy’s corrcoef computes it.
If and are independent, the top of that fraction splits into , which is . So independent values are uncorrelated: . A figure after the instrument shows that the reverse fails.
To make pairs with a chosen correlation , take two independent Gaussian draws and , each with mean 0 and variance 1, and set
The two parts of are independent, so their variances add: . And , since . With both variances 1, that makes .
A cloud that leans: correlation
500 pairs (x, y) with y = ρx + √(1 − ρ²) z; x and z are independent Gaussian draws (seed 241).
ρ = 0: a round cloud. Knowing x tells you nothing about y on average; the 500 pairs measure −0.080.
Describe this picture
One square panel of 500 pairs with , where and are independent Gaussian draws (seed 241): and each from −4 to 4. The pairs are small dots, and a dashed line labelled “y = ρx” marks the straight-line trend. The readouts are ρ as set, to two decimals, and ρ as measured, to three. The clip opens at , a round cloud that measures −0.080. Each point then slides vertically toward the line: at the cloud leans along and measures 0.543. At it is a thin cloud close to the line, measuring 0.944. After the clip a slider labelled “ρ”, named “Correlation ρ”, sets ρ from −0.99 to 0.99 in steps of 0.01. At other values the caption reads like “ρ = −0.50: measured −0.540.”
Watch the cloud lean toward the dashed line as ρ grows. That line marks the straight-line trend: for these pairs, is on average.
Why does measure −0.080? The 500 draws of and the 500 of are not perfectly unrelated over so few pairs: their own measured correlation is −0.080. Their measured means are 0.057 and 0.070, and their variances 0.960 and 1.025, not exactly 0 and 1.
After the clip, use the slider to set ρ yourself. Try 0.3 and 0.8: the pairs measure 0.219 and 0.772. Over the whole slider, 500 pairs miss the set value by at most 0.084, at . Near ±1 the miss shrinks: 0.006 at 0.95.
Uncorrelated, but not independent
Correlation measures only a straight-line relation. Here is a pair that is tied together completely and still has a correlation of 0.
Draw uniformly from 0 to , with the generator’s uniform numbers (seed 2410), and set and . Every point lies on a ring of radius 1, so once is known, is : only its sign is left to chance.
The ring is symmetric: a point above the -axis is as likely as its mirror image below it. So in the long run the products cancel: . Both means are 0 too, so exactly. The 500 drawn points measure −0.039.
So uncorrelated does not mean independent. For the instrument’s pairs the two do coincide: at the recipe gives , which is independent of . Statistics shows that this holds for every pair of jointly Gaussian values.
The maths behind it · angles between vectors
Centred draws are vectors. is the cosine of the angle between the vector of values and the vector of values, each minus its mean. It is ±1 when they are parallel, and 0 when they are orthogonal.
Worked example
1. Gaussian areas. Take the kitchen scale of 18.2: noise of standard deviation 0.2 kg on readings at 50 per second. Within ±0.2, ±0.4 and ±0.6 kg of the true weight lie 68.27 %, 95.45 % and 99.73 % of the readings.
So 0.27 % land further out than 0.6 kg, one reading in 370. At 50 readings a second, that happens about once every 7.4 s.
2. Uniform. In 11.1’s 3-bit quantizer the step is , so the rounding error is uniform from −0.125 to 0.125. Its density is , its variance , and its standard deviation .
A width of instead gives variance and density .
3. Estimates from the seeded draws. With seed 241 the Gaussian draws estimate the variance as 1.255 from 10 draws and 1.027 from 10 000. The means are −0.005 and −0.002.
4. Making a correlation. For , , so . The 500 seeded pairs measure 0.543.
Where you’ll meet this
Every receiver and measuring instrument has a noise budget. Its noise sources are usually independent, so their variances add, as here. Two sensors whose errors have correlation and equal variance average to a variance of : half when the errors are uncorrelated, no gain at all when .
Quantization noise is modelled as uniform, as in 11.1, and the thermal noise of sensors and radios as Gaussian. How often Gaussian noise crosses a threshold, the area beyond a few standard deviations, is the question Matched filters and detection (26.1) answers.
Next, Random processes (24.2) lets draws depend on their neighbours, and Correlation (24.3) measures the correlation of a signal with a shifted copy of itself or of another signal.
NumPy computes this page’s estimates with histogram (its density=True scales the bars as here), mean, var and corrcoef. For more, see appendix A, “Random signals”, of A. V. Oppenheim and R. W. Schafer, Discrete-Time Signal Processing (3rd ed., 2010). See also A. Papoulis and S. U. Pillai, Probability, Random Variables and Stochastic Processes (4th ed., 2002), chapters 4 to 6.
Reference card
| Quantity | Formula | Notes |
|---|---|---|
| Probability | area under | total area 1 |
| Mean, variance | , | estimates , from draws |
| Gaussian | 68.27 %, 95.45 %, 99.73 % | |
| Uniform, width Δ | density , variance | rounding error |
| Sum of independent draws | variances add | many look Gaussian |
| Correlation | straight-line relation only | |
| Independent | joint density = product | ⇒ uncorrelated, not ⇐ |