ACF Binary Sequence Analysis

Binary Autocorrelation Calculator

Calculate the autocorrelation of a binary sequence at a selected lag. Compare the sequence with its shifted version using bipolar binary mapping and view normalized autocorrelation, raw correlation, overlap, matches and mismatches.

Autocorrelation Selected Lag Bipolar Binary Sequence Periodicity -1 to +1
Binary Autocorrelation 0 → -1 · 1 → +1
Enter the binary sequence to compare with its shifted version.
Lag 0 compares the sequence with itself. Maximum lag is sequence length minus 1.
Bipolar mapping: 0 → -1, 1 → +1
Raw R(k) = Σ x[n] × x[n+k]
Normalized R(k) = Raw Sum ÷ (N – k)
This calculator uses non-circular autocorrelation. Bits shifted outside the sequence are excluded. At lag k, the overlap contains N – k bit pairs.
Binary Autocorrelation Result
Normalized Autocorrelation
Raw Autocorrelation
Selected Lag
Overlap Length
Matching Bits
Mismatching Bits
Match Rate
Sequence Length
Original vs Shifted Overlap
Original -
Shifted -
Compare -
Calculation

What Is Binary Autocorrelation?

Binary autocorrelation measures how closely a binary sequence resembles a shifted version of itself. Instead of comparing two independent sequences, the same sequence is compared at two different positions separated by a selected lag.

Autocorrelation is useful when studying repetition, periodic structure and similarity inside binary sequences.

Binary Autocorrelation Formula

This calculator first converts the binary sequence into bipolar values:

Binary 0 → -1
Binary 1 → +1

For lag k, the raw autocorrelation is calculated from the overlapping samples:

R(k) = Σ x[n] × x[n+k]

The normalized autocorrelation used by this calculator is:

Normalized R(k) = Raw R(k) ÷ (N – k)

where N is the original sequence length.

Why Use Bipolar Binary Mapping?

Directly multiplying ordinary 0 and 1 values would cause every pair containing a zero to contribute zero. Bipolar mapping avoids this problem.

Original Pair Bipolar Pair Product
1 and 1 +1 and +1 +1
0 and 0 -1 and -1 +1
1 and 0 +1 and -1 -1
0 and 1 -1 and +1 -1

Therefore matching bits contribute +1 and different bits contribute -1.

Autocorrelation at Lag 0

Lag zero compares every bit with itself. Every pair therefore matches.

Sequence: 10110100

Lag: 0

Matches: 8

Raw autocorrelation: 8

Normalized autocorrelation: 8 / 8 = 1

For any non-empty valid sequence, the normalized autocorrelation at lag zero is 1 with this calculation method.

Binary Autocorrelation Example

Consider the repeating sequence:

10101010

At lag 2, the overlapping portions are:

Original: 101010

Shifted: 101010

All six positions match.

Raw: 6

Overlap: 6

Normalized: 6 / 6 = 1

This strong correlation reflects the repeating two-bit structure of the sequence.

Negative Autocorrelation Example

The same alternating sequence behaves differently at lag 1.

Sequence: 10101010

Original overlap: 1010101

Shifted overlap: 0101010

Every overlapping bit is opposite.

Raw: -7

Normalized: -7 / 7 = -1

The negative value indicates complete opposition at that lag.

What Does Autocorrelation +1 Mean?

A normalized value of +1 means every bit in the two overlapping portions matches.

R(k) = +1

All overlapping bits agree.

This can occur at lag zero and can also occur at non-zero lags when the sequence contains a repeating structure.

What Does Autocorrelation -1 Mean?

A normalized autocorrelation of -1 means every overlapping binary bit is opposite after bipolar mapping.

Original: 10101

Shifted: 01010

R(k): -1

What Does Autocorrelation Near Zero Mean?

A value near zero occurs when positive contributions from matching bits and negative contributions from mismatching bits approximately cancel.

Matches: 5

Mismatches: 5

Raw: 5 – 5 = 0

Normalized: 0

The interpretation applies only to the selected lag.

What Is Lag?

Lag is the number of positions separating the two copies of the sequence being compared.

Lag 0: x[n] vs x[n]

Lag 1: x[n] vs x[n+1]

Lag 2: x[n] vs x[n+2]

As lag increases, fewer positions remain available for comparison.

Overlap Length

This calculator performs non-circular autocorrelation. It does not wrap bits from the end of the sequence back to the beginning.

Overlap = N – lag

For a 10-bit sequence:

Lag 0 → 10 overlapping bits
Lag 1 → 9 overlapping bits
Lag 2 → 8 overlapping bits
Lag 5 → 5 overlapping bits
Lag 9 → 1 overlapping bit

Raw vs Normalized Autocorrelation

Raw autocorrelation is the sum of the bipolar products. Its possible magnitude depends on the number of overlapping positions.

Normalized autocorrelation divides this sum by the overlap length.

Measurement Meaning Range
Raw Autocorrelation Sum of bipolar products -L to +L
Normalized Autocorrelation Raw value divided by overlap -1 to +1

L represents the number of overlapping positions.

Matches, Mismatches and Autocorrelation

Because each matching pair contributes +1 and each mismatching pair contributes -1, raw autocorrelation can also be calculated as:

Raw Autocorrelation = Matches – Mismatches

For example:

Matches: 7

Mismatches: 3

Raw: 7 – 3 = 4

Overlap: 10

Normalized: 4 / 10 = 0.4

Binary Autocorrelation and Periodicity

One important use of autocorrelation is examining repeating structure. If a sequence repeats after a certain number of positions, its autocorrelation may become high at a lag corresponding to that repetition.

Sequence: 10101010

Repeating pattern: 10

Lag 2: R(2) = 1

A high value at one lag does not by itself prove a general statistical property, but it can reveal strong self-similarity at that displacement.

Autocorrelation of Pseudorandom Binary Sequences

Autocorrelation is commonly studied when evaluating pseudorandom and coding sequences. Different sequence families can have characteristic autocorrelation behavior at zero and non-zero lags.

This calculator gives the direct result for one selected lag. It does not automatically certify randomness, identify an LFSR polynomial or determine whether a sequence is cryptographically secure.

Binary Autocorrelation vs Cross-Correlation

The distinction between the two BinaryCon calculators is important.

Calculator Input Purpose
Binary Autocorrelation One sequence Compare sequence with shifted copy of itself
Binary Cross-Correlation Two sequences Compare two different binary sequences at a lag

They therefore serve different analysis tasks even though both use correlation concepts.

Binary Autocorrelation vs Sequence Period Calculator

Autocorrelation can reveal similarity at a particular lag, but it is not the same calculation as determining the exact fundamental period of a sequence.

Autocorrelation: How similar is the sequence to itself at lag k?

Sequence period: What is the shortest repeating period?

The existing Binary Sequence Period Calculator handles the second task directly.

Applications of Binary Autocorrelation

Binary autocorrelation is relevant to digital communications, sequence analysis, coding theory, signal synchronization concepts, spread-spectrum systems, pseudorandom sequence analysis, digital hardware testing and communications education.

It can provide a compact way to examine whether a binary pattern resembles itself after a known displacement.

Non-Circular vs Circular Autocorrelation

This calculator deliberately uses non-circular autocorrelation.

Non-circular: Bits shifted beyond the sequence boundary are discarded.

Circular: Bits shifted beyond one end wrap around to the other end.

Circular autocorrelation is a different calculation and is not silently mixed into this tool.

Important Binary Autocorrelation Notes

Important: this calculator uses one binary sequence.

Binary 0 is mapped to -1 and binary 1 is mapped to +1.

Matching bits contribute +1.

Mismatching bits contribute -1.

This is non-circular autocorrelation. Bits do not wrap around.

Lag must be a non-negative whole number.

The maximum valid lag is N – 1.

Overlap length equals N – lag.

Raw autocorrelation equals matches minus mismatches.

Normalized autocorrelation equals raw autocorrelation divided by overlap length.

Normalized autocorrelation ranges from -1 to +1.

At lag zero, normalized autocorrelation is always +1 for a valid non-empty sequence.

This tool does not calculate cross-correlation between two independent sequences, automatically search all lags, determine an exact sequence period or certify randomness.

Binary Autocorrelation Calculator FAQs

What does the Binary Autocorrelation Calculator do?
It compares a binary sequence with a shifted version of itself and calculates raw and normalized autocorrelation at the selected lag.
What does autocorrelation measure?
It measures self-similarity between different positions of the same sequence.
What does lag 0 mean?
Lag zero compares every bit with itself, so normalized autocorrelation is +1.
What does autocorrelation +1 mean?
Every pair of overlapping bits matches at that lag.
What does autocorrelation -1 mean?
Every overlapping bit pair is opposite under the bipolar binary mapping.
Why is binary 0 converted to -1?
This allows matching zero bits to contribute positively and mismatching binary pairs to contribute negatively.
What is raw autocorrelation?
It is the sum of all bipolar products in the overlapping region.
What is normalized autocorrelation?
It is raw autocorrelation divided by the overlap length, giving a value from -1 to +1.
Does this calculator use circular autocorrelation?
No. It uses non-circular autocorrelation, so shifted bits outside the sequence are excluded rather than wrapped around.
Is autocorrelation the same as cross-correlation?
No. Autocorrelation compares one sequence with itself, while cross-correlation compares two different sequences.
Scroll to Top