Wavefront coding (WFC) is an optical-digital technique that consists in introducing a suitable phase mask (PM) in the aperture plane able to extent, after image processing, the depth of field of an optical system. The key to WFC lies in the shape of the PMs to achieve the invariant imaging properties over the range of defocus. Cubic PM was the first proposed. Next, trefoil mask avoided periodic artifacts in the images keeping the goal of depth extension. The performance of the masks, resolution and noise of the coded images, depends on their strength, required range of defocus and f-number of the optical system. Here, we will provide the experiments that will support that a member of the Jacobi–Fourier phase masks can be chosen depending on the f-number of the optical system to get the best balance between resolution, noise level and artifact presences while keeping depth of focus.