As a rapid, noncontact, and nondestructive technology, magnetostrictive guided waves have been widely used for the quality inspection of pipes and stay cables. Traditionally, a singlefrequency signal with a high amplitude and a long pulse duration is used to increase the excitation energy and detection distance. However, the longer the pulse duration of a single-frequency signal is, the lower the resolution of adjacent defects and the accuracy of defect location will be. A novel method of addressing this problem is proposed in this paper. An encoded multifrequency excitation signal, whose frequency range is selected from a calculated dispersion curve, is used to excite the guided wave. After passing through the signal-conditioning board, the detected defect signals are sampled, averaged, and then filtered using a matched filter. In this manner, the pulse width of echoes can be greatly compressed. Our experimental results demonstrate that our proposed method can improve the resolution of adjacent defects and the accuracy of defect location in the propagation direction of the magnetostrictive guided wave.