## 2 Materials and Methods  
### Mathematical Modeling Framework  
In order to acquire a set of synthetic transmit-receive aperture data with one transmit event, we desire a set of codes such that a different code can be transmitted from a set of transmitters and then received signals from a set of receivers can be decoded for each transmit code with minimal interference between signals after decoding. We create a modeling framework for ultrasound imaging in this section; however, this analysis is valid for any multi-transmitter multi-receiver system. First, consider an array of \(N\) transducer elements. The driving voltage signals of all elements can be represented as Equation (1). \[\mathbf{V}(t)= \begin{bmatrix}v_{1}(t)&v_{2}(t)&\cdots&v_{N}(t)\end{bmatrix}  \tag{1}\]  
where \(v_{N}(t)\) is the voltage as a function of time driving element \(n\), which can be represented in its discrete form as a vector of \(M\) time samples, \(v_{n}= \begin{bmatrix}v_{n1}&v_{n2}&\cdots&v_{nM}\end{bmatrix} ^{T}\). We want to transmit a set of codes such that the cross-correlation between different sequences is close to zero, and the autocorrelation is approximately a delta function (Equation (2)):  
\[v_{n}(t)\star v_{m}(t)\approx\delta_{nm}(t)=\left\{ \begin{array}{c}0\ if\ n\
eq m\\ \delta(t)\ if\ n=m\end{array} \right. \tag{2}\]  
where \(\star\) is the autocorrelation operator and \(\delta(t)\) is the delta function. The received signal due to an ensemble of scatterers on receiver element \(k\) is given as Equation (3). \[r_{k}(t)=\sum_{l,j}v_{l}(t)*h_{Tx}\big{(}t,\mathbf{x}_{l}\to\mathbf{x}_{j}\big{)}*s \big{(}t,\mathbf{x}_{j}\big{)}*\frac{\partial}{\partial t}h_{Rx}\big{(}t,\mathbf{x}_{j }\to\mathbf{x}_{k}\big{)} \tag{3}\]  
where \(r_{k}(t)\) is the signal due to an ensemble of scatterers at location \(\mathbf{x}_{j}\) using elements at location \(\mathbf{x}_{l}\) to transmit, \(v_{l}(t)\) is the driving signal for elements at location \(\mathbf{x}_{l}\), \(h_{Tx}\big{(}t,\mathbf{x}_{l}\to\mathbf{x}_{j}\big{)}\) is the transmitter spatio-temporal impulse response, \(s\big{(}t,\mathbf{x}_{j}\big{)}\) is the scatterer response at location \(\mathbf{x}_{j}\), \(h_{Rx}\big{(}t,\mathbf{x}_{j}\to\mathbf{x}_{k}\big{)}\) is the receiver spatio-temporal impulse response, and \(*\) is the cross-correlation operator. If effectively orthogonal transmit sequences are used, we can estimate the signal transmitted from element \(m\) and received on element \(k\), \(r_{mk}(t)\), by cross-correlating the receive signal \(r_{k}(t)\) with \(v_{m}(t)\) as shown in Equation (4):  
\[\hat{r}_{mk}(t)=r_{k}(t)\star v_{m}(t)\approx\sum_{l,j}h_{Tx}\big{(}t,\mathbf{x}_ {m}\to\mathbf{x}_{j}\big{)}*s\big{(}t,\mathbf{x}_{j}\big{)}\star\frac{\partial}{ \partial t}h_{Rx}\big{(}t,\mathbf{x}_{j}\to\mathbf{x}_{k}\big{)} \tag{4}\]  
We can then obtain an estimate of the full synthetic aperture data for all elements. Then, transmit-receive synthetic aperture delay and sum focusing can produce high spatial resolution and high contrast-to-noise images. We desire tri-state codes of len gth \(M\) with states {\(-1\), 0, 1} which satisfy minimal correlation and orthogonality conditions with the constraints:  
\[ \begin{array}{l}|\rho_{nm}(\tau)|\leq 1\;\forall\tau\;if\;n\
eq m\\ \rho_{nm}(0)=0\;if\;n\
eq m\\ \rho_{mm}(0)=M\;\forall m\end{array} \]  
where \(\rho_{nm}(\tau)\) is the cross-correlation between \(v_{n}(t)\) and \(v_{m}(t)\) at time-lag \(\tau\). With these constraints, the mainlobe-to-sidelobe ratio will be equal to \(M\), and the sidelobe levels will be bounded for any code length.