We propose a robust autofocus method for reconstructing digital Fresnel holograms. The numerical reconstruction involves simulating the propagation of a complex wave front to the appropriate distance. Since the latter value is difficult to determine manually, it is desirable to rely on an automatic procedure for finding the optimal distance to achieve high-quality reconstructions. Our algorithm maximizes a sharpness metric related to the sparsity of the signal's expansion in distance-dependent waveletlike Fresnelet bases. We show results from simulations and experimental situations that confirm its applicability.