The minimal LFSR also has period 1, so it's always within half-a-bit
of synchronized, so it's not a counterexample :)

OK, here's a better counterexample:

max [15 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 15]
sub [15 -1 -1 -1 -5 -1 -1  7  7 -1 -1 -5 -1 -1 -1 15]

It's fixed point; divide by 15 to get the -1..1 range we've been discussing.

Note the application of MXOR to form a shift register with taps.

-Dave

:: :: ::

from Numeric import *

iota = arange
rho  = reshape
def l(*es): return array(es)

maximal = rho(l(0,0,0,1,
                1,0,0,1,
                0,1,0,0,
                0,0,1,0), (4,4))

submax =  rho(l(0,0,0,1,
                1,0,0,1,
                0,1,0,1,
                0,0,1,0), (4,4))

def cycle(m):
        def mxor(m,v):  return matrixmultiply(m,v) % 2
        n  = m.shape[0]
        v  = zeros(n) + 1
        rs = []
        for i in iota(2**n-1):
                rs.append(v[0])
                v = mxor(m,v)
        return rs

def autocorr(seq):
        def phi(v,n):   return concatenate((v[n:],v[:n]))
        def corr(a,b):  return sum((a==b)-(a!=b))
        return array([corr(seq,phi(seq,i))
                         for i in iota(len(seq)+1)])

print "max", autocorr(cycle(maximal))
print "sub", autocorr(cycle(submax))


Reply via email to