Autocorrelation Calculator

Calculate autocorrelation to analyze periodicity and self-similarity in signals.

Input Signal

Autocorrelation Formula

Rxx[l] = Σ (x[n]-μ)(x[n+l]-μ)

Biased: divided by N

Quick Examples

Autocorrelation at lag 0 (Variance)

1.061224

Signal Mean

2.2857

Std Deviation

1.0302

First Zero Crossing

lag 2

Period Estimate

3

Normalized Autocorrelation

lag 01.0000
lag 10.3736
lag 2-0.3104
lag 3-0.6484
lag 4-0.2363
lag 50.0989
lag 60.2225

Properties

  • • R[0] = signal variance
  • • R[l] = R[-l] (symmetric)
  • • |R[l]| ≤ R[0] for all l
  • • Peaks indicate periodicity

What Is Autocorrelation?

Autocorrelation measures how a signal correlates with a delayed copy of itself as a function of the lag. For a discrete signal x[n], the autocorrelation at lag l is Rxx[l] = Σ (x[n] - μ)(x[n+l] - μ), where μ is the signal mean. This calculator takes a comma-separated signal, centers it by subtracting the mean, computes the autocorrelation at every lag from 0 to N−1, and normalizes by R[0] so the self-correlation at lag 0 equals 1.

Autocorrelation is a core tool in signal processing, time series analysis, and statistics. A strong peak at a non-zero lag indicates periodicity — the signal repeats at that interval. A slow decay suggests trend or persistence; a sharp drop to zero suggests white noise. The calculator highlights key properties: the variance (R[0]), the first zero crossing, and an estimate of the fundamental period based on the first local minimum in the autocorrelation sequence.

Autocorrelation Formula

The autocorrelation function compares the centered signal with itself shifted by lag l. The normalization can be biased (divided by N, the total signal length) or unbiased (divided by N−|l|, the number of valid overlapping samples).

Autocorrelation Function

Rxx[l] = Σ (x[n] − μ)(x[n+l] − μ) / N (biased) or /(N−l) (unbiased) R_norm[l] = Rxx[l] / Rxx[0]

Where:

  • x[n]= The discrete signal values — enter as comma-separated numbers like 1,2,3,4,3,2,1
  • μ= The mean of the signal, subtracted to center the data before computing correlations
  • l= The lag — the number of steps the signal is shifted relative to itself

Understanding the Results

MetricMeaning
R[0] (Variance)The signal's variance — always the maximum autocorrelation value
Normalized R[l]Values between −1 and 1. Near 1 at non-zero lag = strong periodicity; near 0 = uncorrelated
First Zero CrossingThe lag where correlation first drops to zero or negative — rough indicator of decorrelation time
Period EstimateLag of the first local minimum after lag 0 — often suggests the fundamental period

How to Use This Calculator

  1. Enter your signal: Type a comma-separated list of numbers. Example presets are provided: periodic (T=2), linear trend, and impulse — click to load them.
  2. Choose biased or unbiased: The biased estimator divides by N (total samples), producing a more stable estimate for large lags. The unbiased estimator divides by N−l (overlapping samples only), giving equal weight to each correlation estimate.
  3. Interpret the results: R[0] is the variance. The normalized autocorrelation at each lag is shown in a scrollable list. The period estimate and zero-crossing lag provide quick insights into signal structure.

Real-World Applications

Autocorrelation is essential in audio and speech processing for pitch detection — the lag of the first peak in the autocorrelation of a voiced speech signal corresponds to the fundamental frequency (pitch period). In finance, autocorrelation of stock returns reveals momentum or mean-reversion patterns: positive autocorrelation suggests trending, negative suggests oscillation. In seismology, autocorrelation of ground motion records helps identify repeating seismic events and characterize subsurface structure.

In communications, autocorrelation is used in CDMA (Code Division Multiple Access) systems where each transmitter uses a unique spreading code with a sharp autocorrelation peak for synchronization. In astronomy, autocorrelation of light curves from variable stars reveals rotation periods. In quality control, autocorrelation of process measurements detects when a manufacturing process drifts out of statistical control.

Worked Examples

Perfectly Periodic Signal

Problem:

Analyze the signal [1, 0, 1, 0, 1, 0, 1, 0, 1, 0] for periodicity.

Solution Steps:

  1. 1Enter 1,0,1,0,1,0,1,0,1,0 or click the Periodic (T=2) preset.
  2. 2Mean = 0.5; centered signal alternates between 0.5 and −0.5.
  3. 3R[0] = 0.25 × 10 / 10 = 0.25 (biased).
  4. 4At lag 2, the centered signal aligns perfectly → R[2] normalized ≈ 1.0.
  5. 5Period estimate = 2 — the first local minimum is at lag 1, but the strong peak at lag 2 reveals the true period.

Result:

R[0] = 0.2500, period estimate = 1, but the dominant cycle is clearly T = 2 based on the R[2] peak near 1.0.

Linear Trend Signal

Problem:

Compute autocorrelation of [1, 2, 3, 4, 5, 6, 7, 8].

Solution Steps:

  1. 1Enter 1,2,3,4,5,6,7,8.
  2. 2Mean = 4.5. Centered signal: −3.5, −2.5, −1.5, −0.5, 0.5, 1.5, 2.5, 3.5.
  3. 3R[0] = (3.5²+2.5²+...)/8 = 5.25.
  4. 4Normalized correlations decay smoothly — no strong periodicity detected.

Result:

R[0] ≈ 5.2500. The correlations decay monotonically with lag, consistent with a trend (non-stationary) signal.

Tips & Best Practices

  • R[0] always equals the signal variance and is the maximum autocorrelation value — use it to verify the computation.
  • The biased estimator is more stable for visual inspection of autocorrelation; the unbiased estimator is more accurate for statistical testing.
  • A periodic signal shows peaks in autocorrelation at multiples of the period; the height of these peaks indicates how clean the periodicity is.
  • White noise has autocorrelation ≈ 0 at all non-zero lags — use this as a baseline for comparison.
  • Always subtract the mean first — autocorrelation of uncentered data confuses the DC offset with actual correlation.

Frequently Asked Questions

The biased estimator divides the correlation sum by N (total signal length) regardless of lag, which means estimates at large lags use fewer valid overlaps and are artificially attenuated. The unbiased estimator divides by N−l (the actual number of overlapping samples), giving each lag estimate equal reliability. Choose biased for smoother results; choose unbiased for accuracy at all lags.
Negative autocorrelation means the signal tends to alternate — high values are followed by low values and vice versa. For example, [1, −1, 1, −1] has R[1] = −1 because each value is the opposite of the next. In financial data, negative autocorrelation suggests mean-reverting behavior.
The period estimate finds the first lag (after lag 0) where the normalized correlation reaches a local minimum and then starts increasing. This corresponds to half a cycle; the location of the first minimum often approximates the fundamental period of the signal. It's a heuristic — for precise period detection, look at peak positions in the autocorrelation list.

Sources & References

Last updated: 2026-06-06

💡

Help us improve!

How would you rate the Autocorrelation Calculator?

<>

Editorial Note

MyCalcBuddy Editorial Team

This page is maintained as an educational calculator reference.

Source

Formula Source: Handbook of Mathematical Functions

by Abramowitz & Stegun

UpdatedLast reviewed: May 2026
CheckedFormula checks are based on standard references and internal QA review.