Variations in the lift-off separation between a probe and the surface of a structure to be tested often mask the detection of defects in the structure. A method and apparatus for automatically classifying and compensating for variations in the lift-off is described. A reference signal at a known lift-off may be weighted by a corresponding calculated ratio parameter and subtracted from a test signal to compensate for lift-off. A number of reference signals are preferably obtained and the largest magnitude gradient for each reference signal is preferably determined. The largest magnitude gradient for subsequent test signals is also obtained and the corresponding reference signal with the closest largest magnitude gradient to the test signal is identified and the corresponding reference signal is selected in the related compensation procedure. Such a method has been found to restore the signal such that lift-off is removed and defects are easily identified.