xdesign.codes

Generate codes for space- and time-coded apertures.

Module author: Daniel Ching

Code Generating Functions:

mura_1d(L)

Return the longest MURA whose length is less than or equal to L.

mura_2d(M[, N])

Return the largest 2D MURA whose lengths are less than M and N.

raskar(npool)

Return the coded mask from Raskar et al.

xdesign.codes.mura_1d(L)[source]

Return the longest MURA whose length is less than or equal to L.

From Wikipedia: A Modified uniformly redundant array (MURA) can be generated in any length L that is prime and of the form:

L = 4m + 1, m = 1, 2, 3, ...,

the first six such values being L = 5, 13, 17, 29, 37. The binary sequence of a linear MURA is given by A[0:L] where:

A[i] = {
    0 if i = 0,
    1 if i is a quadratic residue modulo L, i != 0,
    0 otherwise,
}
xdesign.codes.mura_2d(M, N=None)[source]

Return the largest 2D MURA whose lengths are less than M and N.

From Wikipedia: A rectangular MURA, A[0:M, 0:N], is defined as follows:

A[i, j] = {
    0 if i = 0,
    1 if j = 0, i != 0,
    1 if C[i] * C[j] = 1,
    0 othewise,
}

C[i] = {
    1 if i is a quadratic residue modulo p,
    -1 otherwise,
}

where p is the length of the matching side M, N.

xdesign.codes.raskar(npool)[source]

Return the coded mask from Raskar et al.