<p>The ocean is a temporally and spatially varying environment, the characteristics of which pose significant challenges to the development of effective underwater wireless communications and sensing systems. An underwater sensing system such as a sonar detects the presence of a known signal through correlation. It is advantageous to use multiple transducers to increase surveying area with reduced surveying costs and time. Each transducers is assigned a dedicated code. When using multiple codes, the sidelobes of auto- and crosscorrelations are restricted to theoretical limits known as bounds. Sets of codes must be optimised in order to achieve optimal correlation properties, and, achieve Sidelobe Level (SLL)s as low as possible. In this thesis, we present a novel code-optimisation method to optimise code-sets with any number of codes and up to any length of each code. We optimise code-sets for a matched filter for application in a multi-code sonar system. We first present our gradient-descent based algorithm to optimise sets of codes for flat and low crosscorrelations and autocorrelation sidelobes, including conformance of the magnitude of the samples of the codes to a target power profile. We incorporate the transducer frequency response and the channel effects into the optimisation algorithm. We compare the correlations of our optimised codes with the well-known Welch bound. We then present a method to widen the autocorrelation mainlobe and impose monotonicity. In many cases, we are able to achieve SLLs beyond the Welch bound. We study the Signal to Noise Ratio (SNR) improvement of the optimised codes for an Underwater Acoustic (UWA) channel. During its propagation, the acoustic wave suffers non-constant transmission loss which is compensated by the application of an appropriate Time Variable Gain (TVG). The effect of the TVG modifies the noise received with the signal. We show that in most cases, the matched filter is still the optimum filter. We also show that the accuracy in timing is very important in the application of the TVG to the received signal. We then incorporate Doppler tolerance into the existing optimisation algorithm. Our proposed method is able to optimise sets of codes for multiple Doppler scaling factors and non-integer delays in the arrival of the reflection, while still conforming to other constraints. We suggest designing mismatched filters to further reduce the SLLs, firstly using an existing Quadratically Constrained Qaudratic Program (QCQP) formulation and secondly, as a local optimisation problem, modifying our basic optimisation algorithm.</p>