4
$\begingroup$

Basically, I'm trying to figure out the name of the thing I want to look up. All the terms I've looked up so far have been related, but not close enough to be useful.


I'm trying to find bit strings where the auto-correlation between the string and some rotation of the string shows a clean maximum at the rotated-by-zero position. A little logic suggests that on average, bits will match at least half the time. Some brute force searching supports than and shows that (for some lengths: 2,3,4,5,6,7,11,13,15,19,23) it's possible to find strings that match at exactly the same number of position (usualy $\lceil n/2 \rceil$) for all non-trivial rotations. My application would benefit from longer strings than are tractable to brute force so I'm really hoping I can look up the theory behind these structures.

There are some other interesting properties and application I'm seeing that suggest this would be interesting to research, so I strongly suspect that someone has, but I've been unable to find anything so far.

$\endgroup$
7
  • 1
    $\begingroup$ Are you looking for something like a Gold code? There are also relatives like the Kasami codes. $\endgroup$
    – Dan Piponi
    Commented Jan 27 at 0:35
  • $\begingroup$ @DanPiponi Those also look very closely related (i.e. worth looking into), and could easily be subsets of what I'm thinking of (or lead to it), but they also seems focused on something a bit different than my case (so I'm not going to call that the answer). $\endgroup$
    – BCS
    Commented Jan 27 at 1:01
  • 2
    $\begingroup$ Are you looking for "Barker codes"? en.wikipedia.org/wiki/Barker_code $\endgroup$ Commented Jan 27 at 20:56
  • $\begingroup$ @GerryMyerson Barker codes seem very similar, but not exactly the same. The criteria that defines them seems to only be know to exist up to n=13 where as I have ideal examples for my criteria up to n=23 (and got that by trial brute-force in python in under an hour). $\endgroup$
    – BCS
    Commented Jan 28 at 0:48
  • 2
    $\begingroup$ @BCS If your application would benefit from sequences that don't quite satisfy your condition, but come close, then I found a page that seems to give sequences that are nearly Barker codes. Is that useful to you? $\endgroup$ Commented Jan 28 at 1:35

1 Answer 1

9
$\begingroup$

Gold codes are not really what you are looking for as far as I understand. With Gold codes you have many sequences and you want to control (i.e., have small absolute values) for all nontrivial auto and cross correlations in the set. That's overkill for you, and the Welch bound implies that you cannot obtain the $\lceil n/2 \rceil$ Hamming distance between shifts that you require.

You have one binary sequence, say $(x_0,\ldots,x_{n-1})$ and the usual definition of (cyclic) autocorrelation is $$ \theta_{x}(\tau)=\sum_{0\leq k \leq n-1} (-1)^{x_t + x_{t+\tau}} $$ where the shift in the index is taken modulo $n.$ There is a one to one correspondence between the Hamming distance between a sequence and its cyclic shift and this correlation.

Clearly if $n$ is odd then this correlation is in the best case equal to $-1$ for nontrivial shifts.


For $n=2^m-1,$ you can use maximum length sequences obtained from the Galois field trace function to get what you want. Let $$ x_k=\mathrm{tr}(c \alpha^k),\quad c\neq 0, $$ where $\mathrm{tr}:GF(2^m)\rightarrow GF(2)$ is the trace map and $\alpha$ is a primitive element (of multiplicative order $2^m-1$) in $GF(2^m).$


For $n=p$, for some prime $p$ congruent to $3$ modulo 4 you can use the Legendre sequences to get the same correlation. Use the Legendre symbol as a multiplicative character which means map the quadratic residues in $GF(p)^\ast$ to $+1$ and the quadratic nonresidues to $-1$ with the zero element mapped to $+1$ as well.

Example: $N=7,$ the quadratic residues are $1,4,9\equiv 2\pmod 2,$ so you get the sequence $$ \begin{array}{c|rrrrrrr} k & 0 & 1 & 2& 3& 4 & 5& 6 \\ \hline x_k & +1 & +1 & +1 & -1 & +1 & -1& -1 \end{array} $$


Relevant keywords are m-sequences (maximum length sequences), Legendre sequences. For ranging applications m-sequences are used very widely in communications, Legendre sequences are used in the GPS system, as well as other places.

Finally, for $n=4,$ there is the circulant Hadamard sequence $(-1,+1,+1,+1)$ which gives perfect autocorrelation, but no longer examples are known and are believed not to exist.

Edit: For Barker codes and similar signal sets the relevant correlation is aperiodic correlation, given by $$ C_{x}(\tau)=\sum_{0\leq k \leq n-1-|\tau|} (-1)^{x_t + x_{t+\tau}},\quad |\tau|<n. $$

$\endgroup$
8
  • 1
    $\begingroup$ This is very interesting! FWIW, I was looking for more information on circulant Hadamard sequences and came across a manuscript claiming to have proved the conjecture that n=4 is the longest possible example: arxiv.org/abs/2302.08346 I'm curious if this is considered a solid result. $\endgroup$ Commented Jan 27 at 14:38
  • 2
    $\begingroup$ Looks reasonable at a quick glance. I wonder if it's been peer-reviewed yet. $\endgroup$
    – kodlu
    Commented Jan 27 at 14:54
  • $\begingroup$ While the ceil(n/2) (or maybe floor(n/2) I might have stated that backwards?) condition can't be done in general it can be done for some cases: e.g. for length=23 the string 000000010101100110100111 matches at 11 positions for every non-trivial rotation $\endgroup$
    – BCS
    Commented Jan 28 at 0:00
  • 1
    $\begingroup$ @BCS Sequences in which all non-trivial autocorrelations are -1 can be used to construct Hadamard matrices with circulant core. The Paley and Sylvester matrices arise in this way from Legendre sequences constructed from quadratic residues and m-sequences respectively (as in the answer above). You just add a row and column of 1's. Otherwise, Hadamard matrices are not in general of use. The circulant of order 4 has been noted, Bernhard Schmidt has shown there are no others of order < 10^20 or so. $\endgroup$ Commented Jan 28 at 9:14
  • 3
    $\begingroup$ The preprint mentioned by Martin has a flaw - some of the claims about cyclotomic fields work only for $\mathbb{Q}[\zeta_{2^{k}}]$ and results of Turyn rule out further circulant Hadamard matrices for those orders. $\endgroup$ Commented Jan 28 at 9:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.