A method is proposed for designing apodized apertures with a transmission profile which follows a curve defined using a cubic spline interpolation. The method is applied in digital holographic microscopy to perform digitally the apodization of the aperture of holograms recorded by a CCD camera. The transmission of the apodized aperture is entirely defined by four parameters which are adjusted iteratively to minimize intensity and phase fluctuations appearing in the images obtained by numerical reconstruction of the holograms. The performances of the method have been studied in the absence of experimental sources of noise using a computer generated hologram with which we demonstrate that the aperture apodization reduces the standard deviation of the reconstructed phase distribution from 1.6 nm to 0.15 nm.