## 2 Materials and Methods
### Constructing Simple HAPI Codes  
In order to construct Hadamard Aperiodic Interval codes, varying sequences of zeros are interposed between non-zero bits obtained from a Hadamard sequence. The aperiodic interval sequence is based on a so-called Golomb ruler. A Golomb ruler is a set of marks at integer positions along a ruler such that no two pairs of marks are the same distance apart. The number of marks on the ruler is its order. Codes designed in this manner can ensure that a maximum of one pair of non-zero bits would multiply in a cross-correlation of two codes at any given lag, which produces an outcome that is bounded by unity. In addition, the autocorrelation of any code at zero lag will produce a value equal to the sum of the square of the bits of the Hadamard sequence, or M for an M-bit Hadamard matrix. The following example illustrates how to build a simple 4 non-zero-bit HAPI code. In order to construct a 4-bit HAPI code, we require 3 non-repeating intervals of zeros to interpose between the 4 non-zero bits. If we start with intervals of 2 and 3, we can pick a third interval, 4, which is not a combination of 2 and 3. Hence, our chosen intervals are [2; 3; 4]. Next, we can construct four HAPI codes by interposing the non-zero bits sampled from each row or column of a 4 \(\times\) 4 Hadamard matrix with the intervals of zeros chosen above. The 4 \(\times\) 4 Hadamard Matrix is given as  
\[H=\left[ \begin{array}{cccc}+1&+1&+1&+1\\ +1&-1&+1&-1\\ +1&-1&-1&+1\\ +1&+1&-1&-1\end{array} \right]\]  
For this example, we chose to sample each Hadamard sequence from each row of the matrix. However, we could have chosen to sample our bits from the columns of the matrix instead because both rows and columns of a Hadamard matrix are mutually orthogonal to each other. We can then interpose the sampled non-zero bits from the rows of this matrix with the sequences of zero intervals to construct four codes, as shown in Table 1.  
Table 1 shows the four HAPI codes we can generate from the rows of the 4 \(\times\) 4 Hadamard matrix. The table also shows our chosen intervals of \(\{2,3,4\}\) and the combination of these intervals, \([5,7,9]\), shaded underneath. If we were to add one more non-zero bit, and thus require one more interval, then that interval cannot be chosen from the list of combinations \(\{5,7,9\}\). Hence, our intervals of \(\{2,3,4\}\) are correctly chosen such that there are no repeating intervals or combinations of intervals. Now, let us examine the autocorrelation properties of these codes and the cross-correlation properties at various lags. Figure 1 shows the cross-correlation of codes \(v_{2}\) and \(v_{4}\) at every lag, and the autocorrelation of code \(v_{2}\) to demonstrate that cross-correlation is bounded by unity for every lag, and that the autocorrelation is a delta function. We can see from Figure 1a-e that for any lag, the cross-correlation is bounded by unity, i.e., the result of a cross-correlation at any lag will be in the set \([-1,1]\). The bounded property of the cross-correlation can be visually seen in Figure 2c below. \begin{table} \begin{tabular}{c c c c c c c c c c c} \hline \(v_{1}\) & 1 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & 1 \\ \hline \(v_{2}\) & 1 & 0 & \(-1\) & 0 & 0 & 1 & 0 & 0 & 0 & \(-1\) \\ \hline \(v_{3}\) & 1 & 0 & \(-1\) & 0 & 0 & \(-1\) & 0 & 0 & 0 & 1 \\ \hline \(v_{4}\) & 1 & 0 & 1 & 0 & 0 & \(-1\) & 0 & 0 & 0 & \(-1\) \\ \hline \end{tabular} \begin{tabular}{c c c c c c c c c c c} \hline \(v_{4}\) & 1 & 0 & 1 & 0 & 0 & 0 & \(-1\) & 0 & 0 & 0 & \(-1\) \\ \hline \end{tabular} \begin{tabular}{c c c c c c c c c c} \hline \(v_{2}\) & 1 & 0 & \(-1\) & 0 & 0 & 1 & 0 & 0 & \(-1\) & 0 & 0 & 0 & \(-1\) \\ \hline \(v_{3}\) & 1 & 0 & \(-1\) & 0 & 0 & 0 & \(-1\) & 0 & 0 & 0 & 1 \\ \hline \(v_{4}\) & 1 & 0 & 1 & 0 & 0 & \(-1\) & 0 & 0 & 0 & \(-1\) \\ \hline \end{tabular} \begin{tabular}{c c c c c c c c c} \hline \(v_{4}\) & 1 & 0 & 1 & 0 & 0 & 0 & \(-1\) & 0 & 0 & 0 & \(-1\) \\ \hline \end{tabular}  \