## 2 Materials and Methods
### Methods of Simulation  
Traditional synthetic aperture (SA) imaging involves transmitting a signal from each transmitter one at a time, and then receiving on all receiver elements simultaneously. This approach requires significant time delays to propagate signals over multiple transmission events, and this time increases linearly as the transmit/receive array size increases. With HAPI synthetic aperture (HAPI-SA), different HAPI codes can be transmitted simultaneously from different elements, and the receive signals can all be received simultaneously. The receive signals on each receiver can then be decoded for each possible transmit signal to obtain the full synthetic aperture data set. This data set can then be beamformed to obtain a high-resolution image that is focused everywhere. This is all conducted with one parallel coded extended transmit event, rather than the many transmit events of the traditional synthetic aperture method. To test the potential of HAPI codes for imaging, we performed a set of simulations. Field II is used to simulate the performance of the HAPI synthetic aperture algorithm (HAPI-SA) and compare it to coherent plane wave compounding (7 angles equally spaced between \(-18^{\circ}\) and \(18^{\circ}\)), traditional synthetic aperture (SA), and fast synthetic aperture imaging (3 sub-apertures) for linear array transducers. Field II is an ultrasound simulation package that uses the Tupholme-Stepanishen method to calculate pulsed ultrasound fields [32; 33]. For 2D imaging, the simulations were performed using a 5 MHz center frequency linear array transducer. The transducer has 128 elements, with a kerr of 15.4 \(\upmu\)m. Each element has a width of 292.6 \(\upmu\)m, and a height of 5 mm. The whole array has an aperture of 3.94 cm. For 3D imaging, the simulations were performed using a 2D sparse array with 128 active elements where the active element positions are determined randomly. Each element has a width of 292.6 \(\upmu\)m, and a height of 292.6 \(\upmu\)m.  
All simulations were performed with a sampling frequency of 100 MHz. The 2D synthetic aperture beamforming was performed using a beamforming toolbox developed by [PERSON] [34]. A custom delay and sum algorithm was implemented for 3D synthetic aperture imaging, which was validated against the Nikolov toolbox in the limit of a linear array. Frequency-dependent simulations were implemented by setting the attenuation property in Field II using the function _set_field_. As frequency-dependent attenuation calculations were computationally burdensome, we used frequency-independent attenuation in the results presented, implemented by attenuating the scatterer amplitudes. To validate this approach, we compared frequency-independent and frequency-dependent small-scale simulations and found negligible differences in resulting images. Parallel code transmission was simulated by summing the pulse-echo channel data of codes transmitted from individual elements. Summed pulse-echo channel data were then decoded by cross-correlating respective HAPI codes to reconstruct the estimated full synthetic transmit-receive aperture (STRA) dataset. This STRA dataset was then beamformed using the synthetic aperture reconstruction code mentioned above. For our simulations, we used HAPI codes with 128 non-zero bits, generated by our algorithm described above (and shown in Appendix A). This algorithm generated the following set of intervals between non-zero bits: [2, 3, 4, 6, 8, 11, 16, 12, 24, 20, 17, 38, 30, 49, 31, 33, 26, 76, 94, 43, 66, 54, 88, 42, 74, 145, 87, 125, 98, 51, 136, 140, 119, 171, 194, 180, 151, 200, 234, 67, 155, 65, 354, 173, 205, 407, 92, 96, 247, 211, 427, 284, 128, 364, 335, 78, 416, 153, 524, 199, 112, 273, 202, 581, 474, 253, 518, 439, 336, 691, 433, 508, 402, 598, 314, 510, 313, 342, 936, 631, 428, 107, 526, 812, 70, 400, 683, 849, 1432, 810, 802, 175, 695, 890, 649, 483, 673, 937, 69, 874, 482, 368, 337, 1363, 925, 911, 1148, 643, 1568, 762, 471, 944, 1744, 703, 1172, 845, 651, 861, 1023, 1229, 763, 1062, 536, 393, 880, 467, 2088, 968].