Simultaneous realisation of zonal and modal wavefront sensing using programmable multiplexed grating patterns

: In the present work, we propose a programmable multiplexed grating-based wavefront sensor (MGWS) to realise zonal and modal wavefront sensing approaches simultaneously. This is implemented by employing different bit-planes of a color image such that zonal wavefront sensing is performed with enhanced spatial resolution and modal wavefront sensing is performed to measure a large number of aberration modes present in the incident wavefront, simultaneously. We present proof-of-concept simulation results that demonstrate the working of the proposed MGWS and its ability to compensate for the presence of large number of aberration modes significantly, in comparison to either of the sensing approaches when used independently. Further, simulation results are included to quantify the same by considering an optical imaging system to image an array of two-dimensional bead objects. The proposed sensor is flexible in easy switching between either of the sensing approaches and the number of bit-planes can be increased conveniently to further improve the performance of the proposed MGWS. The grating array based wavefront sensor (GAWS) is a programmable version of the zonal wavefront sensor that consists of a 2D array of plane binary diffraction gratings and a single focusing lens [14,15] which replaces the physical lenslets array of the SHWS. Computer generated holography (CGH) technique is employed such that ± n diffracted orders ( n = ± 1, ± 3, ± 5, etc.) are generated when a collimated laser beam is incident on the binary diffraction grating array, implemented using an LCSLM. The + 1 order spot is primarily chosen among the various diffracted orders due to its high intensity to result in a regular 2D array of + 1 order spots for an unaberrated incident wavefront by appropriately configuring the spatial frequencies of the 2D binary diffraction grating elements. The shift in the array of + 1 order spot centroid positions can thus be considered equivalent to that of the array of focal spot shifts of the SHWS. Therefore, the working principle of GAWS is similar to that of the SHWS but it offers some additional advantages, such as, faster frame rate [16], enhanced spatial resolution [17], improved accuracy [18], etc., due to its programmable nature. A programmable version of the modal wavefront sensor [19,20] is constructed in a similar way where a binary hologram is implemented using an LCSLM, employing CGH technique such that it gives rise to ± n diffracted orders. Such type of sensor is also commonly referred to as holography-based modal wavefront sensor. The transmittance function of the binary hologram can be configured to result in a ± 1 order spot that carries a user defined phase function, such that the + 1 order spot can be considered as the object beam, whereas the − 1 order spot as its complex conjugate. Thus, the pair of ± 1 order spots may be considered as the positive bias ( + ve bias) and negative bias ( − ve bias) orders, resulted due to the incorporation of an orthogonal aberration mode (bias mode), similar to the use of physical phase bias plates. Additionally, it is also possible


Introduction
Optical aberrations are generally measured using two popular wavefront sensing approaches, namely, direct and indirect wavefront sensing [1][2][3], which are also often referred to as zonal wavefront sensing (ZWS) and modal wavefront sensing (MWS) [4,5]. ZWS is performed using a widely known sensor such as Shack-Hartmann wavefront sensor (SHWS) [6], which is composed of a two-dimensional (2D) array of lenslets where each of the lenslets have the same focal length and aperture size, and a detector is placed at the common focal plane of these lenslets to capture the focal spot corresponding to each of the lenslets. A plane wavefront incident on the lenslets array generates an array of uniformly spaced grid of spots on the focal plane of the lenslet array. This array of spots is displaced from their original or reference positions in the event of any deformation in the incident wavefront. The shift of the focal spot centroid positions with respect to the reference positions determine the local slope information of the deformed wavefront and can be used in an estimation algorithm [7,8] to generate the phase profile of the incident wavefront. MWS [5,9] on the other hand, gathers information about an incident wavefront globally in the form of difference in on-axis intensity distribution. In this technique, the incident wavefront is first split into two identical wavefronts and then an equivalent amount of an orthogonal aberration mode (such as Zernike modes) is deliberately added to one copy and subtracted from the other copy of the incident wavefront by allowing the split beams to pass through biasing phase plates. Both the biased beams (referred to as positive and negative biased beams) are then passed through their corresponding focusing lenses and then the on-axis intensities are recorded by using two pinhole detectors. Thereafter, the aberration modes present in the incident wavefront can be measured through an optimization process by defining an image quality metric parameter. Also, different versions of zonal and modal wavefront sensors and correctors are available that is implemented by using a liquid crystal spatial light modulator (LCSLM) to realise an array of binary diffractive lenses [10][11][12][13].
The grating array based wavefront sensor (GAWS) is a programmable version of the zonal wavefront sensor that consists of a 2D array of plane binary diffraction gratings and a single focusing lens [14,15] which replaces the physical lenslets array of the SHWS. Computer generated holography (CGH) technique is employed such that ±n diffracted orders (n = ±1, ±3, ±5, etc.) are generated when a collimated laser beam is incident on the binary diffraction grating array, implemented using an LCSLM. The +1 order spot is primarily chosen among the various diffracted orders due to its high intensity to result in a regular 2D array of +1 order spots for an unaberrated incident wavefront by appropriately configuring the spatial frequencies of the 2D binary diffraction grating elements. The shift in the array of +1 order spot centroid positions can thus be considered equivalent to that of the array of focal spot shifts of the SHWS. Therefore, the working principle of GAWS is similar to that of the SHWS but it offers some additional advantages, such as, faster frame rate [16], enhanced spatial resolution [17], improved accuracy [18], etc., due to its programmable nature. A programmable version of the modal wavefront sensor [19,20] is constructed in a similar way where a binary hologram is implemented using an LCSLM, employing CGH technique such that it gives rise to ±n diffracted orders. Such type of sensor is also commonly referred to as holography-based modal wavefront sensor. The transmittance function of the binary hologram can be configured to result in a ±1 order spot that carries a user defined phase function, such that the +1 order spot can be considered as the object beam, whereas the −1 order spot as its complex conjugate. Thus, the pair of ±1 order spots may be considered as the positive bias (+ve bias) and negative bias (−ve bias) orders, resulted due to the incorporation of an orthogonal aberration mode (bias mode), similar to the use of physical phase bias plates. Additionally, it is also possible to construct a multiplexed hologram [19,[21][22][23] such that M pairs of +1 order spots can be generated simultaneously where different +ve bias modes are applied to one spots of every pair and corresponding −ve bias modes are applied to the other spots of that pair, respectively. For example, a duplex hologram will result in a pair of +1 order spots (also a pair of −1 order spots) where a +ve and −ve bias modes are applied to each of the +1 order spots.
In general, both the type of wavefront sensors have their advantages and disadvantages and a particular sensor is preferred depending on the type of applications or aberrations present in the incident wavefront. Also, the involvement of different design consideration makes it difficult to realise both the sensing approaches simultaneously in a non-programmable version of the sensor. A MWS is preferred in the presence of lower order aberrations or single aberration mode and is considered to work better and faster in such a situation [3,24,25]. However, in the presence of higher order aberrations or with the increase in the number of modes present in the incident wavefront, the performance of the MWS decreases significantly due to modal cross-talk [21,25,26]. In such a case, ZWS is expected to perform better (provided the incident wavefront is sufficiently sampled) as it is more robust [3,27] and does not strictly depends on the orthogonality requirement of the aberration function [28,29]. Moreover, the ZWS estimates the wavefront based on slope information, unlike the MWS that uses intensity information. In a practical situation, there will be a combination of different or lower and higher order aberration modes present [30,31] and it is hard to acquire prior knowledge about the types of aberration present in the incident wavefront. Thus, to deal with a more practical situation it is important to realise both the sensing approaches simultaneously such that any and large number of aberration modes present in the incident wavefront can be compensated more accurately. Moreover, realisation of both the sensing approaches will allow to perform modal and zonal compensation in succession such that it results in reduced impact of modal cross-talk and improved zonal dynamic range.
In the present work, we propose a programmable multiplexed grating-based wavefront sensor (MGWS) that can be used to perform both the zonal and modal wavefront sensing simultaneously or separately by using different bit-planes of a color image. Each of the bit-planes are displayed sequentially to generate a 2D array of +1 order spots that samples the incident wavefront from a higher number of locations to enhance the spatial resolution and M pairs of +ve and −ve biased order spots designed to measure M number of modes present in the incident wavefront by displaying Qp number of bit-panes, such that Qp = M. Thus, the proposed sensor can be programmed to function either as a zonal sensor, modal sensor or both, depending on the requirement. We present proof-of-concept simulation results that demonstrate the working of the proposed sensor and its capability to compensate for large number of aberration modes present in the wavefront more accurately. The accuracy provided by the proposed MGWS is on an average >60% in comparison to either of the sensors when used independently.

Methodology
We describe how different bit-planes of a color image are used to perform zonal and modal wavefront sensing. This is followed by a brief description on the design of the proposed MGWS.

Simultaneous zonal and modal sensing using color image
Zonal and modal sensing performed using various bit-planes of a color image are illustrated in Fig. 1. As one single bit-plane can represent a single binary grating pattern, it is possible to represent 24 separate binary grating patterns using a single color image [17]. The extreme left and right of Fig. 1 shows the principle of zonal and modal sensing scheme using 9 bit-planes of a color image, respectively. The image at the center of Fig. 1 illustrates the 24 bit-planes of a color image out of which the first set of 8 bit-planes (i.e., frames B 0 → B 7 ) represent blue color, second set of 8 bit-planes (i.e., frames G 0 → G 7 ) represent green color and the third set of 8 bit-planes (i.e., frames R 0 → R 7 ) represent red color. The extreme left of Fig. 1 illustrates the outline of N × N (initial grating array dimension, here N = 2) number of representative grating elements placed adjacent to each other with a single grating element having a diameter or center-to-center separation of t, in which the bigger circles indicate the grating sub-aperture and the tiny black filled circles indicate its geometrical center corresponding to the first bit plane (denoted as 1p, where 1 is the bit-plane index). The shifting of the center of the top-left grating element (along horizontal and vertical directions) is done using 8 bit-planes with the corresponding positions indicated by eight filled colored circles. The number of bit-planes displayed is denoted by Qp, such that Qp = 9 will refer to the display of 9 bit-planes. In the case of zonal sensing as illustrated in Fig. 1, it is assumed that Qp = 9 bit-planes (i.e., 1p → 9p) will make a sequential display of 9 binary grating arrays where each array is laterally shifted with respect to the other. During the lateral shift, it is assumed that any grating element that crosses the boundary described by the original grating array corresponding to the first bit-plane (1p), will not be considered (such that the grating element will behave to be inactive). Thus, using Qp = 9 bit-planes, a grating array of initial dimension 2×2 results in a cumulative zone dimension of 4×4. This results in estimating the wavefront from 4 2 number of slope measurements instead of 2 2 number of slope measurements. The cumulative zone dimension (N f × N f ) obtained as a function of initial grating array dimension of N × N and net number of bit-planes, Qp, can be written as The focal spot array for each laterally shifted grating patterns is recorded.
The extreme right of Fig. 1 illustrates the outline of a representative bigger hologram with a diameter of tN × tN where the summation is performed to add positive and negative bias amplitudes, b k , to measure the presence of k th aberration mode in the incident wavefront using a single bit-plane. Here, the hologram is stationary (no lateral shift) and each bit-plane displays a duplex hologram to result in a pair of +1 orders. In each bit-plane, a particular bias aberration mode is deliberately added and subtracted to result in a +ve and −ve biased orders. In the illustration, the display of Qp = 9 bit-planes will measure and compensate for 9 aberration modes simultaneously instead of one, as denoted by the aberration mode index, k → 1 : M. Thus, the use of Qp number of bit-planes will measure the presence of M aberration modes in the incident wavefront, such that M = Qp. The on-axis intensity variation for each of the updated bias aberration mode in the Fourier plane is recorded to compensate for the presence of M aberration modes. Hence, in the present work multiplexing of the binary grating pattern is done to realise both the zonal and modal sensing approaches simultaneously and the 24 bit-planes of a color image are exploited to display a sequence of laterally shifted binary diffraction grating array patterns, for the zonal sensing and a sequence of duplex holograms with different bias aberration modes, for the modal sensing.

Design of the proposed multiplexed grating-based wavefront sensor
A complex transmittance function of the multiplexed grating pattern is defined such that the proposed MGWS results in both zonal and modal spots to perform both the sensing approaches simultaneously [32]. Here, the zonal spots are referred to the 2D array of +1 order spots corresponding to zonal sensing, whereas the modal spots are referred to the pair of +1 order spots corresponding to the modal sensing, for convenience. The mathematical algorithm defining the transmittance function of the 2D multiplexed grating pattern M h (x, y) for a single bit-plane of initial grating array dimension N × N, to generate both zonal and modal spots can be written as here (g i 0x , g j 0y ) is given as, is the spatial frequency of the top left grating element (i.e., 1,1) and (∆g 0x , ∆g 0y ) are real numbers that apply a uniform increment between the adjacent grating elements along row index, i and along column index, j. A square array of ±n diffracted spots of dimension N × N is obtained in the focal plane, considering ∆g 0x = ∆g 0y and its formation can be explained by performing a Fourier series expansion of the transmittance function of the grating pattern [33,34]. For the zonal sensing, the grating elements are arranged in a regular 2D structure, similar to the lenslets array structure in the case of SHWS. The location of any of the ±n diffracted orders is a function of the spatial frequency of the respective grating element and the order number. A regular array of zonal spots corresponding to the n th diffraction order can be made to form for an unaberrated incident beam provided that the spatial frequency for each individual grating element corresponding to each bit-plane is properly configured. Among the various higher order spots, the +1 order spots (zonal spots) are considered to form the 2D array of focal spots although, diffracted spots of any order can be used for this purpose. It is assumed that the curvature of the incident wavefront applied holographically Φ a (x, y) is larger than the size of each grating element. As such, a slope relative to the plane of the grating element will be contributed by a portion of the incident wavefront. Thus, the holographically added phase profile will lead to shift in the position of the zonal spots in proportion to the amount of slope received by each grating element. A standard wavefront estimation algorithm [7] can be used to estimate the incident wavefront by measuring the horizontal and vertical shift (also known as horizontal and vertical slopes).
Next, the spatial frequencies of the duplex hologram are defined in such a way that the pair of +1 orders (modal spots) are placed spatially separated with respect to the zonal spots along vertical direction. It is of note that the modal spots can be placed in any arrangement provided that both the sets of zonal and modal spots remain spatially separated. The variables defining the spatial frequencies of the duplex hologram i.e., given by (m k1 0x , m k2 0x ) and (m l1 0y , m l2 0y ) have similar meaning as that of the variables defined in the 2D grating array. Thus, the spatial frequencies are defined such that m k1 0x ≠ m k2 0x , m l1 0y = m l2 0y and m l1 0y >g j 0y | j=N in order to arrange them vertically as well as spatially separated from the zonal spots. The spatial frequencies of the subsequent duplex hologram displayed using corresponding bit-planes will be configured to result in a similar pair of modal spots arranged vertically but with a lateral shift with respect to its preceding pair. The duplex hologram in each of the bit-plane is updated sequentially with an aberration mode ϕ k having a bias amplitude b k , to measure each of the k th mode at a time. Here, the bias amplitude applied for each mode is the same, i.e., b k (k → 1 : M) = b. The total number of biased modal spot pairs generated to measure M aberration modes are equal to the total number of bit-planes used. For the modal sensing, the duplex hologram in each bit-plane is defined such that its diameter is equal to N times of the diameter of smaller grating element used in the case of zonal sensing (i.e., tN). Thus, the size of each hologram is large enough in comparison to the curvature of the incident wavefront Φ a (x, y) such that it will distort the shape of the corresponding modal spots with respect to that of a plane incident wavefront. Further, the addition and subtraction of a particular bias aberration mode will either increase or decrease the effective amplitude of the incident wavefront depending on the aberration mode present such that there is a variation in the on-axis intensity distribution of the pair of modal spots. The measurement of the on-axis intensity variation for three different situations, namely, without any bias aberration and with +ve and −ve bias aberration is used to estimate the presence of a particular mode using a three-point quadratic optimization algorithm by defining the peak intensity as a quality metric parameter [35,36]. After evaluating the correction amplitude for a particular mode, the correction procedure moves to the next mode using the subsequent bit-plane. Thus, in total Qp(2M + 1) measurements are required to calculate the presence of M aberration modes using Qp number of bit-planes.
A diagrammatic representation of the basic operation of proposed MGWS is shown in Fig. 2(c). A collimated light beam incident on the 2D multiplexed binary grating pattern M h gets diffracted and is then focused by the lens L onto the focal plane where a camera C is placed. In the focal plane of the lens L, a regular 2D array of zonal spots and another pair of spatially separated modal spots will be generated. Thus, the display of Qp = 9 bit-planes will result in a 2D array of zonal spots, having a cumulative zone dimension of 10×10 (shown within the red solid box) and 9 pairs of biased modal spots (shown within the blue solid box) corresponding to the plane incident wavefront A 1 A 2 . For the purpose of illustration, the 2D binary grating array patterns and its corresponding zonal spots for the first 3 and the 9 th bit-planes (1p → 3p, 9p) with an initial grating array dimension of 4×4 is shown in Fig. 2(a), whereas the 2D binary duplex hologram and its corresponding modal spots with +ve and −ve bias amplitudes, for the same bit-plane numbers with four different biased aberration modes are illustrated in Fig. 2(b). Thus, the cumulative zonal and modal spots corresponding to the display of Qp = 9 bit-planes is shown in the extreme right of Fig. 2(c) which can be used to perform both the zonal and modal sensing simultaneously.

Results and discussion
Simulations were performed to demonstrate the working of the proposed MGWS in order to realise both the zonal and modal sensing schemes simultaneously. The 2D multiplexed binary diffraction grating pattern M h , using Eq. (1) was constructed by performing numerical simulations in MATLAB software (Matlab version R2015b). Each of the duplex hologram having dimension tN × tN was defined with a pixel resolution of 1024×1024 such that the dimension of each grating element of the 2D array is defined with a pixel resolution of 256×256 to result in an initial grating array dimension of 4×4. Fourier Transform operation was performed over the 2D multiplexed binary diffraction grating pattern, M h to generate an array of zonal spots having a cumulative zone dimension of N f × N f and 2Qp number of modal spots (such that half of it represents the positive bias and the other half represents the negative bias) corresponding to the display of Qp number of bit-planes. The Qp number of bit-planes containing a sequence of different 2D multiplexed binary diffraction grating pattern M h (as discussed in section 2.2 that results in different sets of zonal and modal spots) are combined to generate the color image. Both the zonal and modal spots were recorded for different bit-plane numbers, and also for different biased aberration modes in the case of modal spots. As mentioned above, holographic aberration is introduced into the incident wavefront using CGH technique with a user defined phase function Φ a (x, y) such that a wavefront with aberration is expressed as a linear combination of single indexed Zernike polynomials (Z k ) [37]. Thus, the applied phase profile can be written as Φ a (x, y) = Σc k Z k (x, y), where c k represents the root mean square (RMS) amplitudes of the k th mode in radians. Next, during the process of wavefront estimation using the zonal spots, the centroid (calculated using standard center of mass algorithm) shift measurements were performed to obtain the slope information. The centroid information was obtained by defining a detector sub-aperture equivalent to that of the full width at half maximum (FWHM) of a spot close to the center. Next, the slope information is used to estimate the applied phase profile, Φ a (x, y) by using standard modal wavefront estimation algorithm [7]. Similarly, during the process of wavefront estimation using the modal spots, the on-axis peak intensity information (in the Fourier plane) corresponding to each of the deliberately added and subtracted biased aberration modes, ϕ k (for the k th mode) were recorded. Thus, a biased RMS amplitude of b (here b = 0.7 radian is considered for each biased aberration modes), for an applied phase profile Φ a will result in a pair of biased modal spots, carrying a resultant phase profile of (Φ a + bϕ k ) and (Φ a − bϕ k ) to measure the k th aberration mode. A minimum of Qp(2M + 1) number of the peak intensity measurements were taken to measure M number of aberration modes present in Φ a by following a quadratic optimisation algorithm [20,36]. Hence, the slope and intensity information corresponding to zonal and modal spots, respectively, is available to perform the compensation of the applied phase profile in succession. The compensation of the applied phase profile is performed using the optical phase conjugation technique [38], such that a diffraction-limited point spread function (PSF) is obtained if the compensation is perfect. We present simulation results that demonstrate wavefront aberration compensation using the proposed MGWS where modal and zonal compensation is performed in succession for different bit-plane numbers, in the presence of a combination of different aberration modes. In the present simulation, we have chosen, Qp = 9 and 16 bit-planes as the square root of these numbers result in whole numbers that helps to employ a positive integral number of bit-planes for zonal and modal sensing conveniently. The performance of the MGWS is then compared with that of the zonal and modal compensation, when used independently. Figure 3 shows the first applied phase profile and the corresponding estimated wavefront using both the modal and zonal sensing approaches independently, and the proposed MGWS for Qp = 9 bit-planes display. The applied phase profile for a combination of different Zernike modes, Fig. 3(a) and the corresponding estimated wavefront using the modal and zonal sensing approaches are shown in Fig. 3(b) and Fig. 3(c), respectively. The bar diagram plot in Fig. 3(d) represents the coefficient of the Zernike mode measured in the case of modal sensing. Here, the number of Zernike modes considered were from Z 4 → Z 12 due to the fact that only Qp = 9 bit-planes were displayed. Next, the proposed MGWS was used which recorded both the zonal and modal spots simultaneously; however, the compensation was performed in succession such that the difference or residual wavefront after modal compensation was used as an applied phase profile for the subsequent zonal compensation. We preferred zonal compensation after modal, as performing it otherwise may lead to presence of a large number of residual modes, thereby increasing the modal cross-talk. Figure 3(e) represents the residual phase aberration after modal compensation and Fig. 3(f) represents the estimated wavefront using zonal sensing. It is of note that the independent zonal and modal sensing approaches use the same dimension of zonal and modal spots as that of the proposed MGWS to make a fair comparison. Figure 3(g) → Fig. 3(k) represents the PSF corresponding to the, reference phase profile (diffraction-limited PSF, for Φ a (x, y) = 0), applied phase profile (aberrated PSF, for Φ a (x, y) = Φ 1 a (x, y)), residual phase profile after only modal compensation, residual phase profile after only zonal compensation and residual phase profile after MGWS compensation (where zonal compensation is performed after modal compensation), respectively. The graph in Fig. 3(l) represents the line plot across the center of the PSF (as indicated by the white dotted line) corresponding to each of the figures shown from Fig. 3(g) → Fig. 3(k), respectively. A similar set of result is shown in Fig. 4 where the same applied phase profile Φ 1 a (x, y) is considered; however for an increasing number of bit-planes, i.e., Qp = 16. In this case, the number of Zernike modes considered were from Z 4 → Z 19 due to the fact that Qp = 16 bit-planes were displayed. To establish the robustness of the proposed MGWS, we present second set of results where a different combination of Zernike modes are used as an applied phase profile, Φ 2 a (x, y) = −0.6Z 5 + 0.8Z 6 − 0.5Z 9 + 0.4Z 14 + 0.5Z 15 − 0.6Z 17 for different bit-plane numbers. Thus, Fig. 5 shows similar results as that of Fig. 3 for Qp = 9 and Fig. 6 shows similar results as that of Fig. 4 for Qp = 16. The value of RMS errors calculated from the difference between applied and estimated phase profiles for different values of Qp and Φ a (x, y) are presented in Table 1.

Reference
Aberrated Corrected  From the above results (Fig. 3 → Fig. 6), it is evident that the performance of the proposed MGWS is significantly better in comparison to both the zonal and modal sensing approaches when used independently, for both the applied phase profiles. The poor performance of both the zonal and modal sensing approaches when operating independently is attributed to the fact that a particular sensor is applicable only for a particular type of aberration present in the incident wavefront. However, the performance of zonal sensing is relatively better in comparison to modal sensing approach when used independently as the modal cross-talk increases (in the case of modal sensing) due to the presence of large number of aberration modes in the applied phase profiles. It is observed that the performances of both the sensing approaches including the proposed MGWS increases with the increase in the number of bit-planes (i.e., Qp value). This is also clear from the PSF images shown in (g) → (k) and its corresponding line plots shown in (l), in each of the figures from Fig. 3 → Fig. 6. The shape of the PSF obtained after compensation using the proposed MGWS becomes comparable with that of the diffraction-limited PSF and also its intensity value increases (as shown by the line plots). The improvements mentioned above, is also clear from the RMS error values shown in Table 1. The wavefront estimation accuracy obtained using the proposed MGWS is on an average >60% in comparison to either of the sensing approaches when used independently. It is of note that the performance of all the sensing approaches for Φ 1 a (x, y) is relatively better in comparison to Φ 2 a (x, y) as the latter contains more number of Zernike modes in the incident wavefront. Nevertheless, using the proposed MGWS, we can always increase the number of bit-planes to improve its performance, unlike the conventional design where there is no use of bit-planes. We have further analysed the performance of each of the sensing approaches in the presence of white Gaussian noise having mean = 0 and standard deviation = 0.1 for Φ 1 a (x, y) and Qp = 16 bit-planes (results not included). It is observed that the performance of proposed MGWS is better in comparison to the modal and zonal sensing approaches used independently, although the overall performance of each of the sensing approaches decreases, in the presence of noise.
In order to quantify the improvement provided by the proposed MGWS, we present another set of results where a 2D array of beads are imaged by using the 2D PSFs obtained after aberration compensation with each of the sensing approaches, including the MGWS. The 2D beads were simulated by considering an array of 2D points at random locations having a pixel resolution of 500 × 500 and were confined within a region by defining a radius from the central co-ordinate of the image. The intensity of the beads was randomised by using a Gaussian distribution and then a Gaussian filter was used to define all the beads with the same diameter. Finally, we obtained images similar to that in an optical microscopy system, by performing convolution of the PSFs with that of the 2D bead object. Figure 7 shows the ground-truth bead object and its corresponding images obtained, using the PSFs obtained for Φ 1 a (x, y) and with Qp = 16 (i.e., as shown in Fig. 4). Figure 7(a) shows the ground-truth bead object and the images from Fig. 7(b) → Fig. 7(f) are shown using the PSFs obtained corresponding to the, reference phase profile (diffraction-limited PSF, for Φ a (x, y) = 0), applied phase profile (aberrated PSF, for Φ a (x, y) = Φ 1 a (x, y)), residual phase profile after only modal compensation, residual phase profile after only zonal compensation and residual phase profile after MGWS compensation, respectively. The graph in Fig. 7(g) represents the line plot across representative bead profiles (as indicated by the white dotted line within the red solid box as shown in (a)) corresponding to each of the figure shown from Fig. 7(a) → Fig. 7(f), respectively. We then calculate the correlation coefficient (R) of each of the images from Fig. 7(b) → Fig. 7(f) with that of the ground-truth object (i.e., Fig. 7(a)) to quantify the improvement and accordingly its values were obtained as, R = 0.9863, 0.9265, 0.9553, 0.9636 and 0.9815, respectively. Thus, from Fig. 7 and the correlation coefficient values, it is evident that the image obtained using the PSF corresponding to the proposed MGWS compensation resembles closely with that of the image obtained with diffraction-limited PSF. As the shape of the PSF is dependent on the aberrations present in the incident wavefront, a near diffraction-limited imaging using the proposed MGWS implies that the aberration compensation was close to perfection.
Thus, the proposed MGWS can successfully compensate the presence of large number of aberration modes in the incident wavefront when modal and zonal compensation are performed in succession. This is due to the fact that it can realise both the sensing approaches simultaneously  Fig. 6. False color images representing the second applied phase profile and the corresponding estimated wavefront for Qp = 16 bit-planes display are illustrated. The (a) applied phase profile, Φ 2 a (x, y) and the estimated wavefront using the (b) modal and (c) zonal sensing approaches when used independently are illustrated. The Zernike coefficients detected in the case of modal sensing is shown as bar diagram plot in (d). For the proposed MGWS, the residual phase aberration after modal compensation is shown in (e) and the corresponding estimated wavefront using zonal sensing is shown in (f). The PSF images (g) before addition of Φ 2 a (x, y) and (h) after addition of Φ 2 a (x, y) which is later compensated using the (i) independent modal sensing, (j) independent zonal sensing and (k) proposed MGWS sensing are shown. The line plot across the center of the PSF corresponding to each of the figures from (g) → (k) is shown in (l). The axis labels appearing in all the images from (a) → (f) have the unit of radian.

Position (pixel)
Intensity (a.u.) and also conveniently increase its bit-plane numbers to enhance its performance. There is a possibility of further improving the performance of the proposed MGWS by employing more number of bit-planes. In theory, it is possible to multiplex the hologram n times to generate n modal spots, in the case of modal sensing. However, this will also reduce its intensity by n times. Also, it is possible to increase the sampling frequency of the incident wavefront by defining smaller grating elements, in the case of zonal sensing. However, this will increase the size of the zonal spots and consequently decrease its dynamic range. Thus, the approaches followed in proposed MGWS are considered optimum in the sense that zonal sensing is performed with enhanced resolution without significantly compromising on the dynamic range of the sensor and modal sensing is performed to simultaneously measure a large number of aberration modes, without decreasing its intensity significantly. Moreover, performing zonal compensation after modal not only reduces the impact of modal cross-talk but also provides enhanced dynamic range for the zonal sensor to work effectively. It is of note that we have used standard zonal and modal compensation algorithms for the purpose of comparison. However, the performance of each of the sensing approaches can be improvised separately, such as, by using a different wavefront estimation algorithm in the case of zonal sensing, whereas, by defining a different quality metric parameter, in the case of modal sensing. The proposed MGWS can be implemented experimentally by using a spatial light modulator that is capable of displaying Qp number of bit-planes of a color image [17]. Thus, the proposed MGWS is expected to find applications in different adaptive optics systems used in microscopy, ophthalmology, etc., where accurate compensation of optical aberrations become more important than speed. It is of note that the programmable control of the proposed MGWS will also offer some flexibility in maintaining a real-time balance between the required speed and accuracy of optical aberrations compensation.

Conclusion
In conclusion, we proposed a programmable multiplexed grating-based wavefront sensor to compensate for a large number of aberration modes present in the incident wavefront more accurately. This is implemented by multiplexing the grating pattern, such that, both zonal and modal wavefront sensing approaches are realised simultaneously and also, different bit-planes of a color image are employed to perform both the zonal and modal wavefront sensing with enhanced spatial resolution and to simultaneously measure a large number of aberration modes, respectively. Simulation results included, demonstrate the feasibility of the proposed MGWS and its ability to compensate large number of aberration modes present significantly, in comparison to either of the sensing approaches used independently. We have demonstrated using numerical analysis, the working of the proposed MGWS by considering Qp = 9 and 16 number of bit-planes. However, the proposed sensor can be implemented by considering any initial grating array dimension and number of bit-planes. The increase in the number of bit-planes increases the spatial phase measurement points and number of modes measured, thereby decreasing the RMS error of wavefront estimation. Thus, an accurate aberration compensation is performed with the impact of reduced modal cross-talk and enhanced zonal dynamic range.