Shack Hartmann wavefront sensor with array of phase coded masks

Shack-Hartmann wavefront sensors (SHWS) are generally used to measure the wavefront curvature of light beams. Measurement accuracy and the sensitivity of these sensors are important factors for better wavefront sensing. In this study, we demonstrate a new type of SHWS with better measurement accuracy than the regular SHWS. The lenslet array in the regular SHWS is replaced with an array of coded phase masks and the principle of coded aperture correlation holography (COACH) is used for wavefront reconstruction. Sharper correlation peaks achieved by COACH improve the accuracy of the estimated local slopes of the measured wavefront and consequently improve the reconstruction accuracy of the overall wavefront. Experimental results confirm that the proposed method provides a lower mean square wavefront error by one order of magnitude in comparison to the regular SHWS.

Shack-Hartmann wavefront sensors (SHWS) are generally used to measure the wavefront curvature of light beams. Measurement accuracy and the sensitivity of these sensors are important factors for better wavefront sensing. In this study, we demonstrate a new type of SHWS with better measurement accuracy than the regular SHWS. The lenslet array in the regular SHWS is replaced with an array of coded phase masks and the principle of coded aperture correlation holography (COACH) is used for wavefront reconstruction. Sharper correlation peaks achieved by COACH improve the accuracy of the estimated local slopes of the measured wavefront and consequently improve the reconstruction accuracy of the overall wavefront. Experimental results confirm that the proposed method provides a lower mean square wavefront error by one order of magnitude in comparison to the regular SHWS.
Shack-Hartmann wavefront sensor (SHWS) was developed for optical metrology purposes [1] and later has been used in various other fields, such as adaptive optics [2], microscopy [3], retinal imaging [4], and high-power laser systems [5]. Usually, in SHWS a microlens array is used to measure the wavefront local gradients. For this, the incident wavefront is spatially sampled such that each lenslet focuses the local sub-aperture into an imaging sensor located at the focal plane of the lenslet. The position of the focused spot corresponds to the average slope of the local wavefront of each microlens. The local slope of the wavefront can be evaluated by calculating the spot displacement from the optical axis. Afterward, a wavefront reconstruction algorithm is utilized to estimate the complete wavefront using these estimated slopes [6].
Recently, an incoherent digital holography technique called coded aperture correlation holography (COACH) [7,8] has been developed. In this study, we present a new technique of COACHbased SHWS that increases the accuracy of wavefront sensing. Instead of using the regular lenslet array, a coded phase mask (CPM) is introduced in each sub-aperture of the array. Based on several recently published studies [9][10][11] about interferenceless COACH, we conclude that using a certain CPM can yield at the end of the process a spot that is narrower than the focused spot of the regular SHWS. In any SHWS, the size of each spot constraints the sensitivity and accuracy of the measured slope of the local wavefront. Thus, by use of the CPM array, one can achieve narrower correlation peaks which improve the accuracy of the measured wavefront.
Modified Gerchberg-Saxton algorithm (GSA) is utilized for synthesizing the CPMs [9][10][11]. The CPMs displayed on a spatial light modulator (SLM) generate an ensemble of sparse randomly distributed intensity dots on the sensor plane. The ensemble of dots obtained from the measured wavefront are cross-correlated with a reference dot pattern created by illuminating a single CPM with a plane wave. The intensity response in each cell of the array is shifted according to the average slope of the wavefront in each corresponding cell. Composing the entire slopes yields a three-dimensional curvature used as an approximation to the wavefront incident on the SHWS.
The optical scheme of COACH-based SHWS is shown in Fig. 1(a). A plane wave passes through a phase object and the emitted wavefront is sampled by an array of identical phase elements each of which is a product of the CPM and a lens transmittance. The lens performs a Fourier transform which according to the GSA is needed for the response of the dots on the camera plane. As in conventional SHWS, in front of each CPM, the local wavefront emitted from the phase object is approximated to a tilted plane wave. The goal of the system is to measure the tilt angle of each local planar wavefront and to estimate the global curvature by fusing all the local angles. As in ordinary SHWS, estimating the tilt angle is done by measuring the shift of the intensity response recorded on the camera. Since in COACH-based SHWS, this intensity response is the ensemble of dots, their common shift is measured by cross-correlation with a reference pattern. As much as the cross-correlation peak is sharper, the accuracy of the measurement is higher. Therefore, to narrow the peak as much as possible, the crosscorrelation is done by a non-linear process with two parameters optimized to yield the sharpest cross-correlation peak.
We start the formal analysis by calculating the distribution of the reference pattern. Each cell of the size aa in the CPM designed by the GSA has the distribution of t(x,y)=exp[iφ(x,y)]Rect(x/a,y/a), where φ(x,y) is a chaotic phase function and Rect(x/a,y/a)=1 for all |x|,|y|<a/2 and 0 otherwise. t(x,y) is attached to a diffractive microlens with f focal length. It is well-known that illuminating these combined phase elements at a single cell of the array with a plane wave yields the following intensity [12], where  is 2D Fourier transform and  [•] is the scaling operator such that  [1/b]g(x)=g(bx). IR(x,y) plays the role of the reference pattern in the cross-correlation. As mentioned above φ(x,y) is designed by the GSA to yield an ensemble of sparse randomly distributed dots as a result of a Fourier transform of exp[iφ(x,y)] [9]. Therefore, Cp is appositive constant, P is the number of dots, and {x1,…,xP} is a set of random numbers determined by the GSA. IR(x,y) is measured once by illuminating the central CPM cell in the array with a plane wave propagating in the z-direction and without the presence of the phase object.
Once the reference function is known, the phase object is introduced into the setup and wavefront sensing is performed. The wavefront coming from the phase object is divided into M×N subareas as the number of phase elements at the array. At each subarea, the wavefront is approximated to a tilted planar wavefront with a tilt angle that should be measured to estimate the shape of the overall wavefront. Since each phase element in the array is multiplied by approximated linear phase, the dot response in the Fourier plane is shifted a distance proportional to the tilt angle. The intensity response at the (m,n)-th subarea on the camera for the tilted planar wavefront with a tilt angle of (θm,θn) is, Cross-correlation between Im,n(x,y) and IR(x,y) yields a correlation peak at the distance (f·tanθm,f·tanθn) from the center of the (m,n)-th subarea. Measuring this shift of the peak gives an estimation on the value of the tilt angle of (θm,θn), and collecting all the local angles of the entire M×N subareas enables the restoration of the wavefront emitted from the phase object. The accuracy of the peak shift is dependent on the peak width, and therefore we propose to cross-correlate the signals in a nonlinear way with two parameters optimized to produce the narrowest peak [10]. To understand the relation of the peak width with the parameters of the nonlinear cross-correlation, we consider the Fourier transforms of the two correlated functions as follows, Λ(·) is the peak function which should be as narrow as possible to increase the accuracy of the tilt angle measurement. Theoretically, the values of α and β that yield the sharpest peak are the values that satisfy the equation α + β = 0. However, the noisy experimental environment usually yields different optimal parameters and may not follow this equation. In this study, the optimal parameters α and β of the NCC are found by minimizing the mean square error (MSE), because minimum MSE is the measure of accuracy which we aim to increase. The MSE assesses the reconstruction error by calculating the deviation of the reconstructed wavefront from the digitally simulated wavefront. The MSE is calculated as, where Ŵk, l, and Wk, l are the digital and experimental reconstructed wavefronts, respectively. K, L are the numbers of data points in the wavefront. In case the measured wavefront is a-priory unknown, two strategies can be followed. First, the values of α and β can be calibrated with a phase object that its wavefront is a-priory known and then the same α and β can be used for the unknown wavefront. Alternatively, α and β can be found directly for the unknown wavefront, using an optimization function that does not need any reference wavefront [10,11,13]. Following the procedure of the NCC, the center of the correlation peak for each cell is calculated by the center-of-mass method. The average slope of the tested wavefront in each cell is directly related to the displacement of the correlation peak from the center of the cell. Once the slope for each sub-aperture is calculated, then with the help of the zonal reconstruction technique [14,15], these slope values are fused to reconstruct the full wavefront. Based on our previous investigations [8,9,11], it is well-known that cross-correlation between two bipolar functions reduces the noise and increases the sharpness of the correlation peaks. Therefore, to further increase the accuracy of the tilt angle measurement, we tested the option of using bipolar functions by recording two camera shots with two independent CPMs and with two different dot responses, where one response is subtracted from the other. In this scheme, the bipolar reference pattern is, where tj(x,y)=exp[iφj(x,y)]Rect(x/a,y/a), and φj(x,y) is the phase distribution of the j-th CPM (j=1,2). Im, n(x,y) is also obtained by two exposures with the same two CPMs so that its distribution is, where the two random series {x1, 1,…x1,P} and {x2, 1,…x2,P} are independent. The rest of the process is identical to the above-mentioned description of the process of the unipolar patterns. The schematic of the experimental setup for COACH-based SHWS is shown in Fig. 1(b). A HeNe laser with a beam size of 8mm is used as the source, where a pair of lenses (f1=10cm; f2=48cm) is used to expand the beam diameter from 8mm to about 38mm. A pinhole of 20μm diameter used as a lowpass filter is placed at the common focal plane of the two lenses. The lowpass filter makes the wavefront after the beam expander as close as possible to a plane wave. This plane wave propagates through a phase object such that its phase distribution is represented by the wavefront emitted from the object. In the experiment, a positive lens of 30cm focal length is used as the phase object. The beam is polarized to the active orientation of the SLM (Holoeye PLUTO, 1920×1080 pixels, 8μm pixel pitch). The array of coded phase patterns displayed on the SLM is obtained by modulo-2π phase addition of the CPMs with the lenslet array of f=6.5mm focal length. The reflective SLM and the focal length enforce using a beamsplitter to reflect the modulated light coming from the SLM toward a digital camera (PCO.Edge 5.5 CMOS, pixel pitch=6.5μm, 2560×2160 pixel). An optical relay system is used to translate the focal plane of the microlens array onto the sensor plane. For comparison with our proposed method, we measured the wavefront with a regular SHWS implemented on the same setup by changing the phase pattern on the SLM to a lenslet array of f=6.5mm focal length. The central 1020×1020 pixels of the SLM were used to display an array of 30×30 CPMs attached to microlenses. The size of each cell is 34×34 pixels. The experimental results were compared with the digital wavefront. The digital wavefront is created by numerical Fresnel propagation from the phase object to the SLM plane using MATLAB with the same parameters as the experimental setup. The MSE was calculated between the digital wavefront and the tested wavefront reconstructed by the regular and by the COACH-based SHWS systems. For COACH-based SHWS, both techniques, unipolar and bipolar, were tested. To find the optimal number of dots of the sparse response, numbers of 3, 5, 10, and 12 dots were tested.
Figures 2(a1) and 2(a2) present the intensity response for two different CPMs when only the central cell is activated in the array. The dot structure is clearly seen in both figures and in the bipolar pattern of Fig. 2(a3) obtained as the difference of the intensities of Figs. 2(a1) and 2(a2). Figures 2(b1) and 2(b2) show the intensity response in the center of the COACH-based array equipped with two different CPMs, where the tested wavefront is introduced into the system. The corresponding bipolar response is shown in Fig. 2(b3). Figure 3 shows the experimental results of the NCC in comparison with the focal spot of a single microlens shown in Fig. 3(a). The autocorrelation of Fig. 2(a1) by the NCC technique with (α=0.0; β=1.0) and (α=0.1; β=0.9) is shown in Figs. 3(b) and 3(c), respectively. The autocorrelation of Fig. 2(a3) by NCC technique with (α=0.0; β=1.0) and (α=0.1; β=0.9) is shown in Figs. 3(d) and 3(e), respectively. The NCC parameters (i.e. α and β) can vary between -1 to +1 and are optimized by searching the minimum MSE between the experimental and the digital wavefronts. With the parameters (α=0.0; β=1.0) and (α=0.1; β=0.9), the wavefront reconstruction result was the best with the lowest MSE in comparison to other values. Figure 3(f) shows the intensity response of regular SHWS for the test wave. Figure 3(h) shows the NCC of Fig. 2(a3) with Fig.  2(b3) [when the scale of 2(a3) is the same as one cell of 2(b3)] with the parameters α=0.0 and β=1.0. The cross-section plots of correlation peaks with optimized values of α and β are shown in Fig. 3(g) in comparison to the curve of the microlens focal spot (blue). Based on the plots of Fig. 3(g), it is clear that the NCC technique gives a sharper and narrower peak in comparison with the microlens focal spot of the regular SHWS.   The reconstruction results of both the unipolar and bipolar SHWS are compared with the regular SHWS in Fig. 4. For the experiments, 1020×1020 pixels of SLM were used to display a 30×30 array of microlenses and CPMs. The 30×30 data points of a reconstructed wavefront are resized into 1020×1020 data points and compare with the simulated digital wavefront. Figures 4(a1) and 4(b1) show the 3D maps of the reconstructed wavefronts by the regular SHWS and bipolar COACH-based SHWS with 5 sparse dots, respectively. The 3D error maps between the reconstructed and digital wavefront for both the cases are shown in Figs. 4(a2) and 4(b2). The calculated MSE values of the various tested SHWS for each number of sparse dots are given in Table 1. From the error maps in Figs. 4(a2) and 4(b2), it can be seen that the boundary region of the wavefront extremely deviated from the digital shape resulting in higher MSE values because of the peripheral areas. Therefore, the 3D error maps for the centrally cropped 800×800 data points for both cases are shown in Figs. 4(a3) and 4(b3), respectively. From the flat error map in Fig. 4(b3), it is clear that the reconstructed wavefront of the bipolar method has a closer fit to the digital wavefront. MSE values of the centrally cropped wavefront are also calculated and given in Table 2. The MSE of 5-dot patterns for the unipolar case and most of the 3-dot patterns for the bipolar method yield minimum MSE among the tested cases and these minimum values are bolded in the tables. The case of 3-dot bipolar COACH-based SHWS has a smaller MSE by order of magnitude in comparison to the regular SHWS. The lower MSE values confirm the improvement in the wavefront reconstruction accuracy of the COACH-based SHWS. Furthermore, it should be noted that all the tested bipolar reconstruction results are better than the 5-dot bipolar but still the 5dot unipolar gives better reconstruction results in comparison to the regular SHWS and to unipolar cases with other dot numbers.
In conclusion, we have presented a new SHWS technique with improved measurement accuracy. Coded phase masks are synthesized using the modified GSA algorithm to produce sparse dot patterns. Further, the bipolar sparse dot patterns are generated to reduce background noise. The experimental results with a different number of dot patterns are compared with the regular SHWS and the results confirm the validity and effectiveness of our method. From the calculated MSE values it can be noted that for the best case of 3-dot bipolar (overall 6 dots), the accuracy of COACH-based SHWS is improved by one order of magnitude in comparison with the regular SHWS. The cost of such improvement is the need for two camera shots. In case the speed of the measurement is more critical than the accuracy, the single-shot unipolar COACH-based SHWS can offer approximately double the accuracy than of the regular SHWS.