Library / Signal processing and digital filters / DSP-24
Signal processing and digital filters
Finite-record biased autocovariance
Autocovariance of a real record of N samples (up to 8) at lag ℓ, summing over the overlapping pairs but always dividing by the full length N, with μ the sample mean.
- Ref
- DSP-24
- Rev
- v1
- Field
- Signal processing and digital filters
- Result
- c[ℓ] [V²]
The biased autocovariance sums the products of deviations from the mean over the N − ℓ overlapping pairs but divides by the full record length N. This keeps the estimate non-negative-definite, and at ℓ = 0 gives the population variance. The unbiased form divides by N − ℓ, which has lower bias and a higher variance at large lags.
Autocovariance of a real record of N samples (up to 8) at lag ℓ, summing over the overlapping pairs but always dividing by the full length N, with μ the sample mean. At zero lag this is the population-form sample variance. It needs 0 ≤ ℓ < N.
Calculator
- Sample mean, μ2.5 V
- Variance, c[0]1.25 V²
- Normalised autocorrelation, c[ℓ]/c[0]0.25
What drives the result
Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.
- The autocovariance at lag 1 is 0.3125 V², 25 % of the variance of 1.25 V².
- The sequence rises steadily, so neighbouring samples are strongly related and the autocovariance stays high at short lags.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing (V²) | Local step | Change in result |
|---|---|---|---|---|---|---|
| x2 Sample 2 | −10 to 10 V | −16.14 | 0.5122 | 16.65 | +0.4 V | +28 % |
| x1 Sample 1 | −10 to 10 V | −7.938 | 0.5069 | 8.444 | +0.4 V | −36 % |
| x3 Sample 3 | −10 to 10 V | −4.5 | 0.5625 | 5.063 | +0.4 V | +15.2 % |
| x0 Sample 0 | −10 to 10 V | −2.078 | 0.5608 | 2.639 | +0.4 V | −16.8 % |
| ℓ Lag | 0 to 3 samples | −0.5625 | 1.25 | 1.813 | +1 samples | −220 % |
| N Record length | 4 to 8 samples | −0.4 | 0.8984 | 1.298 | +1 samples | −228 % |
| x4 Sample 4 | −10 to 10 V | 0.3125 | 0.3125 | 0 | +0.4 V | 0 % |
| x5 Sample 5 | −10 to 10 V | 0.3125 | 0.3125 | 0 | +0.4 V | 0 % |
| x6 Sample 6 | −10 to 10 V | 0.3125 | 0.3125 | 0 | +0.4 V | 0 % |
| x7 Sample 7 | −10 to 10 V | 0.3125 | 0.3125 | 0 | +0.4 V | 0 % |
Sweep of Lag
| Lag (samples) | Autocovariance (V²) |
|---|---|
| 0 | 1.25 |
| 0.375 | 1.25 |
| 0.75 | 0.3125 |
| 1.125 | 0.3125 |
| 1.5 | −0.375 |
| 1.875 | −0.375 |
| 2.25 | −0.375 |
| 2.625 | −0.5625 |
| 3 | −0.5625 |
Sweep one variable
Variables and how each one contributes
Autocovariance
What the equation gives you. Everything else feeds it.
Record length
The record length, 4 to 8 here. Divides the sum, and sets the mean and the number of overlapping pairs. Raising it by 10 % (to 4.4) moves the result by +0 %, from 0.3125 to 0.3125 V².
Lag
The lag, from 0 to N − 1. A larger lag leaves fewer overlapping pairs, so the estimate shrinks towards zero. Raising it by 10 % (to 1.1) moves the result by +0 %, from 0.3125 to 0.3125 V².
Sample 0
The sample x[0], in V (ignored if 0 ≥ N). Changes the mean and the deviation products involving this sample. Raising it by 10 % (to 1.1) moves the result by −4.05 %, from 0.3125 to 0.2998 V².
Sample 1
The sample x[1], in V (ignored if 1 ≥ N). Changes the mean and the deviation products involving this sample. Raising it by 10 % (to 2.2) moves the result by −17 %, from 0.3125 to 0.2594 V².
Sample 2
The sample x[2], in V (ignored if 2 ≥ N). Changes the mean and the deviation products involving this sample. Raising it by 10 % (to 3.3) moves the result by +21.8 %, from 0.3125 to 0.3805 V².
Sample 3
The sample x[3], in V (ignored if 3 ≥ N). Changes the mean and the deviation products involving this sample. Raising it by 10 % (to 4.4) moves the result by +15.2 %, from 0.3125 to 0.36 V².
Sample 4
The sample x[4], in V (ignored if 4 ≥ N). Changes the mean and the deviation products involving this sample. Raising it by 10 % (to 0) moves the result by +0 %, from 0.3125 to 0.3125 V².
Sample 5
The sample x[5], in V (ignored if 5 ≥ N). Changes the mean and the deviation products involving this sample. Raising it by 10 % (to 0) moves the result by +0 %, from 0.3125 to 0.3125 V².
Sample 6
The sample x[6], in V (ignored if 6 ≥ N). Changes the mean and the deviation products involving this sample. Raising it by 10 % (to 0) moves the result by +0 %, from 0.3125 to 0.3125 V².
Sample 7
The sample x[7], in V (ignored if 7 ≥ N). Changes the mean and the deviation products involving this sample. Raising it by 10 % (to 0) moves the result by +0 %, from 0.3125 to 0.3125 V².
Worked example with the values above
- Mean: μ = 2.5 V, and 3 overlapping pairs.
- Sum of deviation products: 1.25 V².
- c[1] = 1.25 / 4 = 0.3125 V².
Assumptions and limits
- Finite real sequences indexed from zero and taken as zero outside their stored length.
- Equally spaced samples, and for the circular forms, periodic extension of both sequences.
Common mistakes
- Mixing up the linear and circular forms when an FFT is used.
- Reversing the lag convention for correlation.
- Dividing by N − ℓ where the biased form divides by N.
Statistics and uncertainty
Convolution and correlation sums are exact, so errors come from the data; a delay found from a correlation peak is limited to the sampling interval unless interpolated, and finite records bias the autocovariance by a factor of (N − ℓ)/N.
Where it is used
- Computing filter outputs, delays and covariance by hand for checks.
- Choosing block sizes for fast FFT-based filtering.
Maths you need
- Linear convolution: y[n] = Σ h[j] x[n − j]
- Circular convolution: the same sum with indices wrapped modulo N
- Correlation: a sliding product that measures similarity at each lag