Design of a Mechanical Analog Autocorrelator to Demonstrate Properties of Pseudonoise (PN) Sequences

Sean E. O'Connor

Introduction

mechanical autocorrelator image.

The mechanical autocorrelator.

Pseudonoise sequences are bit streams used in communications engineering for spread spectrum communications, radio distance measurements, and analyzing concert hall acoustics during live performances.

This is due to their sharply peaked autocorrelation properties. We'll show how their properties can be derived directly from Galois field arithmetic. We'll generalize to mod p arithmetic, leaving the binary PN sequences as a special case when p=2.

We'll conclude by showing how to build a mechanical autocorrelator as a teaching tool which dramatically demonstrates their properties. This is a new and unique design for which there exists no prior art to the best of my knowledge.

Prerequisites: Knowledge of Galois (finite) field theory.

Finite Field Review

Notation: Let the unique Galois field with equation001. elements be denoted equation003.

Let a primitive monic polynomial which generates it be equation005.

The exponential and polynomial forms of the field elements are

equation007.

equation009.

equation011.

equation012.

equation015.

equation012.

equation013.

Example: The field with 16 elements, equation017. is generated by the primitive polynomial, equation019. which has as elements, equation021. equation023. and equation025.

Pseudonoise Sequences

Definition. The pseudonoise (PN) sequence of length equation027. is the sequence equation029. where equation031. and equation032. constant coefficient of the polynomial representation of field element equation033. When the Galois field elements are written out as a list of polynomial coefficients, the PN sequence is the last column.

Example: reading off the constant coefficient of the polynomials in our example field we get equation035. which generates the length 15 sequence equation037.

Difference Equation

We don't need to generate the field and do time consuming finite field arithmetic to find a PN sequence, but can use a recursive method instead.

Note that, equation039. and so equation041.

Expanding out we get

equation042.

Now applying the mod operation throughout,

equation043.

Take the constant coefficient of each polynomial term,

equation044.

And rearrange to get the difference equation,

equation045. for equation014.

with initial conditions

equation051.

equation053.

equation012.

equation055.

That is, the all zeros except for the first coefficient.

Example:

equation057.

are the initial conditions and the difference equation is

equation059.

which generates the same PN sequence as before, (Note that we can omit the -1 since -1 = 1 (mod 2)).

equation061.

equation063.

We continue shifting until we come back to the initial state at equation065.

Hardware Implementation

shift register figure

PN Sequence Shift Register Output
k ak+4(feedback) ak+3 ak+2 ak+1 ak(output)
010001
101000
200100
310010
411001
501100
..................
1400011
1510001 (same as k=0)

Software Implementation

In the C language, we can emulate the hardware bit operations with bit shifting and masking. Here is sample C code which computes values of a binary PN sequence.

The program output is,

pn 1 = 1, pn 2 = 0, pn 3 = 0, pn 4 = 0, pn 5 = 1, pn 6 = 0

pn 7 = 0, pn 8 = 1, pn 9 = 1, pn 10 = 0, pn 11 = 1, pn 12 = 0

pn 13 = 1, pn 14 = 1, pn 15 = 1

Circular Autocorrelation

The circular autocorrelation of the PN sequence

equation067.

is defined to be

equation069.

where indices are taken modulo equation071. We will show that in the binary case p=2, the autocorrelation has a sharp peak at j=0 and is flat elsewhere.

Example.

Our sample sequence has autocorrelation,

equation073.

We get

equation075.

equation077.

equation079.

equation081.

The autocorrelation is very sharply peaked:

equation083.

I tossed a penny 15 times to get a random sequence,

equation085.

and the autocorrelation was much less sharply peaked:

equation087.

Correlations compared chart

Theorem. The circular autocorrelation of the PN sequence,

equation089.

is

equation091.

Proof.

Case j=0.

equation093.

Case

equation095.

equation097.

where indices are taken modulo

equation099.

Now we digress to note that since

equation101.

is a primitive element of the field we can write

equation103.

for

equation105.

where Z(j) is called the Zech's logarithm of j.

equation107.

since the unique inverse of 1 is p-1, which will not happen.

equation109.

rewriting into polynomial form, taking mod f(x) and p, and looking

at the constant term gives,

equation111.

Then

equation113.

where the last step follows because the indices are merely shifted modulo

equation115.

Now consider the sum for even p and odd p cases.

odd p case, e.g. p = 5, n = 3
Field Elements bk Partial Sum
0 1 1
1 -1 0
2 1 1
3 -1 0
4 1 1
x+0 1 1
x+1 -1 0
x+2 1 1
x+3 -1 0
x+4 1 1
... ... ...
3x2+0 1 1
3x2+1 -1 0
3x2+2 1 1
3x2+3 -1 0
3x2+4 1 1
even p case, e.g. p = 2, n = 4
Field Elements bk Partial Sum
0 1 1
1 -1 0
x+0 1 1
x+1 -1 0
x2+0 1 1
x2+1 -1 0
... ... ...
x3+x2+x+0 1 1
x3+x2+x+1 -1 0

Now each group of odd p constant coefficients has an extra unpaired 1.

Number of groups = (total number of field elements) / p =

equation117.

Mechanical Autocorrelator

To illustrate the autocorrelation properties of the PN sequence, I've designed a mechanical autocorrelator.

The device is made of two plastic disks which rotate on a common axis. Each disk has equation119. magnets equally spaced along its rim. A ratchet and pawl mechanism contrains the magnets to hold positions in which they line up facing each other when the disks are rotated. When rotated, the disks attract each other in all positions (autocorrelation minima) except one --- in that position (autocorrelation maximum), they repel very strongly.

The figure shows a mechanical autocorrelator based on the binary PN sequence of our examples of length 15.

autocorrelation figure

Let's demonstrate the connection between the autocorrelation formula just proved and our analog computer.

Theorem. When similar magnets line up, the disks repel with a force of equation121. magnet pairs, corresponding to the autocorrelation peak at j=0. In all other positions, the disks attract with the force of 1 magnet pair, corresponding to the autocorrelation minima of -1.

Proof. We set up a direct correspondence between the equations and the mechanism. As Sherlock Holmes would say, "The parallel is exact".

Correspondence
PN Equation Mechanism
bk=+1 North pole of magnet facing up
bkbk+j=+1 Repulsion of magnets k and k+j
bkbk+j=-1 Attraction of magnets k and k+j
cj Sum of forces of all 2n-1 magnet pairs in offset position j

References


Copyright © 1986-2008 by Sean Erik O'Connor. All Rights Reserved.     last updated 23 Feb 08.