The focusing quality of a SAR processor greatly depends on the accuracy of the system geometry estimate. Sometimes ancillary data do not provide enough accuracy, therefore autofocusing has to be performed to get the finest quality possible. A "residual" azimuth compression is introduced to show how a defocused image can be compensated by means of a monodimensional local operator. The residual transfer function that generates defocusing is then derived. The effects of the defocusing are shown on both a complex single SAR image and a SAR interferogram. SAR interferograms, however, are much more sensitive to defocusing than the single SAR image. Two algorithms have been developed to estimate, and compensate for, the defocusing in both the single SAR image and SAR interferometric cases. The processors select data suitable for estimating focusing parameters from the whole images by exploring Kurtosis (for single image focusing) or coherence (for interferometric autofocusing). The residual, short time-domain operator is then exploited to retrieve the focusing parameter values and, finally, to get the focused image. The limitations and accuracy of the algorithm in terms of parameter estimation are investigated. Experimental results, obtained from different SAR missions, are presented.