In this work we obtain a computer simulation of amplitude cosinusoidal filters for the correction of aberrated wavefronts with third order aberrations (spherical, coma, astigmatism, defocus and tilt), the filters are calculated near to the exit pupil and they are similar to Twyman-Green interferograms. It is possible to obtain the filters for other planes, since we use ray tracing. To test the operation of the filters we developed an algorithm that calculated the irradiance in the focal plane, then we observed the change in the impulse response due to the filter; this algorithm also uses ray tracing and considers, in addition to the direction, the relative phase of each ray with respect to the axial ray.