Normally, depth of focus and resolution of an optical system are complementary parameters. According to an established technique known as wavefront coding the depth of focus can be enhanced by inserting a phaseplate with a cubic surface function into the exit pupil plane of an optical system. Although contrast is reduced the image quality can be restored very efficiently by inverse filtering because the modulation transfer function (MTF) almost does not change when the system is defocused. In addition the MTF has no zero crossings. Therefore inverse filtering has no singularities. Thus, three dimensional objects can be imaged with microscopes with a large depth of focus. The waveoptical performance of a commercial microscope equipped with a cubic phase plate has been simulated. The simulation results are discussed and compared with experimental data. The system has been analyzed both regarding effects specifically related to the phase plate design and regarding effects related to the optical properties which result from the combination of the phase plate with the microscope system. A variable phase plate design is also presented which can be adapted to specific objects and optical systems.