Your Equation

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

Solve for
V²
samples
48
samples
03
V
−1010
V
−1010
V
−1010
V
−1010
V
−1010
V
−1010
V
−1010
V
−1010
  • 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.

Autocovariance (V²) current value 0.3125 V²
x2Sample 2Key driver
−16.10.512
x1Sample 1
−7.940.507
x3Sample 3
−4.50.563
x0Sample 0
−2.080.561
ℓLag
−0.5631.25
NRecord length
−0.40.898
x4Sample 4
x5Sample 5
x6Sample 6
x7Sample 7
  • 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

VariableTypical rangeLowest resultHighest resultSwing (V²)Local stepChange in result
x2 Sample 2−10 to 10 V−16.140.512216.65+0.4 V+28 %
x1 Sample 1−10 to 10 V−7.9380.50698.444+0.4 V−36 %
x3 Sample 3−10 to 10 V−4.50.56255.063+0.4 V+15.2 %
x0 Sample 0−10 to 10 V−2.0780.56082.639+0.4 V−16.8 %
ℓ Lag0 to 3 samples−0.56251.251.813+1 samples−220 %
N Record length4 to 8 samples−0.40.89841.298+1 samples−228 %
x4 Sample 4−10 to 10 V0.31250.31250+0.4 V0 %
x5 Sample 5−10 to 10 V0.31250.31250+0.4 V0 %
x6 Sample 6−10 to 10 V0.31250.31250+0.4 V0 %
x7 Sample 7−10 to 10 V0.31250.31250+0.4 V0 %

Sweep of Lag

Lag (samples)Autocovariance (V²)
01.25
0.3751.25
0.750.3125
1.1250.3125
1.5−0.375
1.875−0.375
2.25−0.375
2.625−0.5625
3−0.5625

Sweep one variable

Autocovariance (V²)Hover, touch, or use the arrow keys on the chart
−0.500.51 00.511.522.53 Lag (samples) now 0.3125

Variables and how each one contributes

c[ℓ]

Autocovariance

Result · V²

What the equation gives you. Everything else feeds it.

N

Record length

samples · typical 4 to 8

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

samples · typical 0 to 3

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².

x0

Sample 0

V · typical −10 to 10

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².

x1

Sample 1

V · typical −10 to 10

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².

x2

Sample 2

V · typical −10 to 10

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².

x3

Sample 3

V · typical −10 to 10

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².

x4

Sample 4

V · typical −10 to 10

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².

x5

Sample 5

V · typical −10 to 10

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².

x6

Sample 6

V · typical −10 to 10

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².

x7

Sample 7

V · typical −10 to 10

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

  1. Mean: μ = 2.5 V, and 3 overlapping pairs.
  2. Sum of deviation products: 1.25 V².
  3. 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

Related formulas

Practise this formula