^{1}

^{2}

^{2}

This paper presents binary phase codes and corresponding decoding filters which are optimal in the sense that they produce no sidelobes and they maximise the signal-to-noise ratio (SNR henceforth). The search is made by investigating all possible binary phase codes with a given length. After selecting the code, the first step is to find a filter which produces no sidelobes. This is possible for all codes with no zeros in the frequency domain, and it turns out that most codes satisfy this requirement. An example of a code which cannot be decoded in this way is a code with a single phase, i.e. a long pulse. The second step is to investigate the SNR performance of the codes. Then the optimal code of a given length is the one with the highest SNR at the filter output. All codes with lengths of 3–25 bits were studied, which means investigating 33554428 binary phase codes. It turns out that all Barker codes except the 11-bit code are optimal in the above sense. It is well known that the performance of matched-filter decoding of Barker codes is better than decoding without sidelobes. In the case of the 7-bit Barker code, it is shown here that the SNR given by sidelobe-free decoding is nearly 30% worse than that of standard decoding, but for the 13-bit code sidelobe-free decoding is only about 5% worse. The deterioration of SNR should be evaluated against the benefits gained in disposing of the sidelobes, which, even for the 13-bit code, contribute by 7.1% to the total signal power from a homogeneous target. Thus, regions of weak scattering can be contaminated by the sidelobes from neighbouring layers of strong scattering, causing broadening of thin spatial structures and giving a lower spatial resolution than implied by the bit length. A practical example is shown where sidelobes mask a weak signal when the standard matched filter is used in the analysis. An improvement is achieved when sidelobe-free filtering is carried out.<br><br><b>Key words.</b> Radio science (ionospheric physics; signal processing; instruments and techniques)