Laser beam wavelength determination algorithm using a digital micromirror device

Abstract. An approach for wavelength characterization whereby dynamic Fresnel zone plate (FZP) patterns are written to a digital micromirror device (DMD) and used to focus incoming light onto a camera is proposed. The incoming wavelength is then assessed by scanning the focal length. Rectangular basis Zernike modes are implemented to match the rectangular geometry of the DMD, we believe for the first time. A procedure is developed to correct for inherent aberrations of the optical system by adjusting the Zernike mode amplitudes, thus improving focal spot quality. The aberration corrected FZPs are used to assess the focusing conditions needed for four lasers of different visible wavelengths ranging from blue (405 nm) to near infrared (760 nm). The system is able to produce focused beams with a width of twice the diffraction limit and achieve a wavelength resolution of 3 nm. The operational wavelength of the system is ultimately limited by the spectral bandwidth of the detector.


Introduction
A digital micromirror device (DMD) is an array of individually addressable tilting micromirrors. The mirrors are typically 10 μm 2 , tilted at angles of AE12 deg, and designed to operate as a binary level spatial light modulator. These devices have been available for over two decades and have seen a huge variety of applications, 1 with the main applications being digital projection 2 and including spectroscopy, 3 switching, 4 single pixel remote sensing, 5 laser glare suppression, 6 and beam steering. 7 The main use of DMDs for projection displays requires the use of incoherent sources, such as light emitting diodes, to avoid diffraction artifacts. However, with coherent sources, the device can manipulate wavefronts through controlled diffraction, 8,9 and this diffractive control can be used to determine properties of the coherent source. As a result, a DMD can be used to discriminate between laser and non-laser radiation. Consequently, DMDs are potential components for use within laser warning receiver (LWR) technology alongside gratings, 10,11 interferometers, 12,13 and cameras. 14 Partanen et al. 15 used a DMD to create a Young's double slit experiment and measured the spatial coherence function (amplitude and phase) of the beam as well as the beam intensity with the help of a CMOS camera. Recent work in the field of laser detection has looked at methods for detecting source coherence, rather than source brightness. 16,17 In this context, it is desirable to measure as many properties of the incoming light source as possible to classify the laser system being used. Elsewhere, the DMD has been used to determine a laser wavelength 18 and pulse length. 19 Thus, in different configurations, the DMD is able to determine several relevant properties of a laser source. In this work, we develop the ability to determine a laser source wavelength.
Wavelength determination is most commonly carried out using a diffraction grating based spectrometer. The resolution of such a technique is determined by the physical scales of the grating and the physical distance between the grating and detector. With very large devices, such as astronomical spectrometers, a resolution on the order of 0.01 nm (Δλ∕λ ¼ 10 −5 ) is possible, but more conventional devices, such as shoe-box sized spectrometers, might reach resolutions of 10 −3 . The device's wavelength range is ultimately limited by the detection range of the detector (e.g., for silicon detectors it is in the region of 300 to 1100 nm). Michelson interferometers can also be used for wavelength measurement in which the resolution is inversely proportional to the path length difference traversed by a mirror. In both cases, wavelength is determined solely by some instrument physical scale.
There exist several methods for more exacting wavelength determination that rely on the comparison of the source under test with a reference wavelength. These methods can be grouped into three categories: interferometry, optical beating methods, and methods based on specific wavelength-sensitive material properties. 20 The interferometry-based systems use an optical path difference in the optical system, and the wavelength is extracted either from the fringe phase or from the fringe period-in comparison with a reference wavelength, 21,22 These systems can reach a wavelength resolution of 10 −8 . The second category, optical beating, measures the frequency difference between a reference signal and a laser under test. The system resolution can reach up to 10 −14 , 23 but such a good resolution comes at the expense of a very limited dynamic wavelength range. Both the source and reference lasers need to have good coherence. The last category uses specific material properties based either on optical fibers, 24 polarization-based identification, 25 or wavelength sensitive structures of photodetectors. 26 These systems reach a resolution of 10 −6 and a measuring range from 260 to 1595 nm.
Mohagheghian and Sabouri 18 used a DMD to determine the laser wavelength using a Fresnel zone plate (FZP) approach. An FZP is composed of transparent and opaque concentric rings with each ring radius corresponding to a phase polarity inversion for light diffracted to the focal point. 7 A diffractive focus is produced by ensuring that only one phase polarity is available, and therefore all components add constructively at the focal point. Mohagheghian and Sabouri 18 modify the ring radius (and thus the focal point) and look at the laser beam spot size resulting from the diffraction with a CCD camera. They report a relative uncertainty in the wavelength determination of 10 −5 . However, a strong astigmatism in the beam spot profile is observable, which affects the achievable accuracy. Distorting the FZP 7 is a method to reduce astigmatism using a restricted number of Zernike modes. In this paper, we extend this approach using a set of Zernike modes for additional wavefront correction. The combination of FZP with a DMD is natural as both are binary amplitude devices that rely on diffraction and have the potential for use as an LWR. An FZP is a focusing device that provides gain to distinguish the focus, but for which the focus depends on the wavelength and coherence properties, i.e., the FZP has significant chromatic aberration. Thus, by scanning the focal length of the FZP and examining the focal intensity, we can determine the optimum focal length for detection and, in so doing, determine the source wavelength. This device has the potential for detecting a wide range of wavelengths, not restricted to visible light. Moreover, the DMD being used as a diffractive element distinguishes laser and incoherent background light.
In this paper, a common channel setup for the DMD system is implemented with the use of an optical fiber delivering the light. The use of the optical fiber allows different lasers to have the same input channel and ensures consistent beam delivery to the DMD, which then would reduce the risk of additional aberrations when different wavelengths are compared. We introduce a process for aberration reduction by minimizing a focal spot size through successive evaluation of orthogonal Zernike mode amplitudes normalized over the rectangular surface of the DMD. Once minimized, the focal length of the FZP (Zernike mode focus) is scanned to determine the best focus position and, from that, the laser wavelength. Finally, four laser wavelengths are characterized and an assessment made regarding the accuracy with which an unknown laser wavelength could be measured. This device has the potential for detecting a wide range of wavelengths, not restricted to visible light. Moreover, the DMD being used as a diffractive element can distinguish laser and incoherent background light.
2 Background Theory 2.1 Implementation of the FZP on the DMD The experimental design involves a laser directed toward a DMD, with an FZP pattern being displayed. The aim of the laser detection system is to characterize laser wavelengths by measuring the size of the beam at a constant distance from the DMD while varying the first order focal length of the FZP lens. This wavelength characterization method is similar to Ref. 18. To redirect the incoming laser light, the diffractive properties of the DMD are used: transparent zones are composed of the "on" state mirrors and focus the light toward the "on" state direction at þ12 deg, whereas the opaque zones are composed of the "off" state mirrors and focus the light toward the "off" state direction at −12 deg. A conventional FZP is a set of concentric rings of constant area that reduce in thickness as they get further from the center, and the focal length of the FZP is given by (1) where r n is the radius of the n'th zone. Conventionally, we would consider the radius of the first zone in which controlling this radius changes the focal length. Wavefronts or surfaces can be represented by a set of orthogonal Zernike modes, which correspond to classical wavefront aberrations. The modes are constructed using the normalized radius (ρ) and the Azimuthal angle (θ). Typically, Zernike modes for a circular geometry are used as this usually corresponds to the beam geometry. However, in the case of the aperture geometry being non-circular, the orthogonal Zernike modes take on a modified form. As the DMD has a rectangular geometry, we make use of the rectangular Zernike modes, 27 and because this is an unusual approach, the mode equations are shown in Table 1.
In this work, we refer to the individual modes with a single index representation as given in the first column. Other works often refer to modes with a dual index representation, Z n m , where n is the radial frequency and m is the angular frequency, which are given in the second column for completeness. The parameter a is the ratio of the longest axis to the diagonal length of the rectangular aperture, which in the case of the DMD used in this work is a ¼ 0.8. The FZP pattern is entirely equivalent to the focus (sometimes called defocus) Zernike mode (Z 4 ). Here, FZP is used to show that the focus term is the predominant mode.
To write the FZP pattern on the DMD, the defocus term of the Zernike polynomials is used and is simplified to E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 2 ; 1 1 7 ; 2 9 3 where R 4 is the user controllable amplitude of the defocus, C is a scaling factor, and ρ is the normalized radial distance in the polar coordinate system. This equation can then define the different radii of the FZP lens in relation to the length of the DMD window. This function calculates the relative phase at each DMD mirror position and is converted to a binary amplitude by determining the polarity, i.e., if sinðZÞ > 0 then amplitude = 1, else = 0. Figure 1 shows an FZP pattern written on the DMD. The FZP is written using only the defocus (Z 4 ) term of the Zernike series; the rest of the Zernike terms are used to correct optical aberrations inherent in the system-some from the DMD and some from the optical system used to introduce light to the DMD. Finally, a camera is used to analyze the characteristics of the beam.
With a fixed DMD-to-camera distance, the focal length is constant, and to correctly focus different wavelengths, the number of zones present within the DMD size varies. The wavefront curvature is the same for all focused wavelengths, and the number of zones (n) is given by E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 3 ; 1 1 7 ; 1 0 1 Zandi, Benton, and Sugden: Laser beam wavelength determination algorithm using a digital. . .

Table 1
Rectangular Zernike polynomials in polar coordinates, where "a" correspond to the conversion factor from circular surface to rectangular surface; Zernike term Balanced oblique astigmatism Balanced primary spherical where ΔW is the wavefront distortion, λ is the wavelength, and the defocus term is determined at the maximum radius. For an FZP, the radius of the nth zone is given by 28 E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 4 ; 1 1 7 ; 4 3 9 Expanding out the defocus term, we write E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 5 ; 1 1 7 ; 4 0 0 to give the expected defocus amplitude relating to the wavelength for rectangular Zernike modes.

Experimental Setup
To illuminate the DMD in a consistent manner, incident light is delivered from a collimated optical fiber. A common optical path for two lasers is achieved by combining with a beamsplitter before focusing into the optical fiber; however, only one laser is turned on at a time for a consistent analysis of the results. Figure 2 illustrates the setup of the single channel system. The camera-DMD distance is 46 cm. The single mode fiber used is a SM600 patch cable designed to operate in the range 633 to 780 nm. A 1024 × 768 resolution DMD from Vialux with a mirror width of 13.6 mm and a tilt angle of AE12 deg is used in this work. To allow the two reflected beams to be coplanar with the incident light coming at 0 deg, the DMD is rotated at 45 deg as shown in Fig. 1. A black and white CCD camera (Thorlabs DCU223M) with a 1024 × 768-pixel resolution and a 4.65 mm pixel width is used to observe the focused beam.
Four lasers with different wavelengths and characteristics were used to test the system: a blue diode laser (405 nm), a compact frequency doubled Nd:YAG laser (532 nm), a HeNe laser (633 nm), and a tunable diode laser (760 nm). The 405 nm laser has a multi-modal output with a mode spacing of around 0.1 nm and a temperature dependent output. At constant temperature, the spectral bandwidth is <0.5 nm on average. The laser at 532 nm has a similar broad bandwidth of around 0.5 nm. The HeNe laser at 633 nm has a bandwidth of 10 −3 nm, and the laser at 760 nm has a 10 −5 nm bandwidth. The rectangular Zernike polynomials are used in the algorithm to correct optical aberrations inherent in the system-arising from aberrations in the collimation setup and the intrinsic aberrations of the DMD-and to define the Zernike defocus amplitude.

Correctional Procedure
A procedure to produce aberration corrected FZPs using Zernike modes has been implemented in LabView. Only the Zernike mode numbers Z 1 to Z 15 are used as the other modes did not show major changes in the beam shape or intensity. Modes Z 1 (piston), Z 2 (tip), and Z 3 (tilt) have no effect on the beam focus quality. The algorithm can be separated into two parts: the first part is to systematically find the settings for the Zernike polynomials that will get the focal point located on the camera, and the second part is to improve the shape of the beam. To assess quality of the beam, two beam parameters are measured: the spot width and the peak intensity. The steps of the algorithm are summarized below and further detailed in this section. Initially, the laser used is an HeNe laser at a wavelength λ ¼ 632.8 nm.
The procedural steps for correcting DMD aberrations are shown in Table 2, with more detail in the following sections.  Zandi, Benton, and Sugden: Laser beam wavelength determination algorithm using a digital. . .

Step 1: Scan Focus Amplitude
In this first step, the diffracted beam from the DMD is coarsely focused onto the camera sensor plane. Changing the amplitude of Zernike mode R 4 changes the amount of diffracted wavefront curvature; thus higher values focus closer to the DMD. Progressively changing the amplitude R 4 scans the focal position, and we seek to find the minimum spot size seen by the camera. The tilting mirrors produce a focus away from the optical axis, and this results in significant amounts of astigmatism. From the camera perspective, the widths of the astigmatic beam in the vertical and horizontal directions show opposite behavior before and after the focal point-the focus is a line that transitions between vertical and horizontal orientation. We look for the "circle of least confusion," which occurs between the astigmatic line foci and is the point at which the horizontal and vertical projected widths are equal. To make the width measurements, the camera is saturated (higher exposure time so that most of the pixels from the beam produce at a value of 255), and an intensity threshold is applied on the camera image to let only intensity pixels over a value of 245. In Fig. 3(a), an example of an oversaturated beam and the vertical and horizontal widths measured from the beam are shown.
The focal length (via the defocus amplitude) is now varied, and the change in the horizontal and vertical widths is recorded for each defocus amplitude setting. The results are shown in Fig. 3(b) with the pre-correction widths showing minima at different values due to the strong astigmatism in the system. An intersection between the vertical and horizontal projections can be seen, and this gives an estimation of the focus. For the HeNe laser, the focus on the camera is estimated to be for a defocus value of R 4 ¼ 23.00 AE 0.01. This uncertainty is taken as the minimal step-size of defocus for which a distinguishable change in the beam is seen.

Step 2: Scan Zernike Mode Amplitudes
Once the defocus is set, the Zernike modes Z 5 to Z 15 can be determined to correct the beam aberrations (note tip and tilt merely offset the beam and are not varied). To assess the image quality by maximizing the peak intensity of the focused spot, a short exposure time is used. It is important to ensure that no saturation occurs. Figure 4 shows the peak intensities and the related amplitudes for each of the Zernike modes. The peak intensity corresponds to the value after the Zernike mode correction is applied.
As expected, the vertical and horizontal astigmatism terms are the strongest, with the horizontal astigmatism being more important. This is to be expected as the DMD is off-axis in the horizontal plane. Most of the other modes have a smaller influence in the wavefront correction; they collectively contribute an 11% increase after the astigmatism is corrected.

Step 3: Revisit Astigmatism
The third step improves the determination of the correct values of R 5 and R 6 amplitudes (horizontal and vertical astigmatisms). In the previous step, R 5 and R 6 were found by looking at the maximum intensity. However, the peak intensity can be misleading as we must also ensure that the beam focus is a sensible shape-but it does locate the range of values for R 5 and R 6 that improve the focal length shape on the camera. To evaluate the astigmatism correction, we also seek to ensure that the shape of the focused spot is correct. A Gaussian fit is applied along the vertical and horizontal axes from the center of the beam [see Fig. 5(a) with a Gaussian applied on the vertical axis]. The standard deviations from these two Gaussian fits are then used to estimate the beam shape. When the widths are equal, the beam is circular.
For this step, the R 5 and R 6 amplitudes are first taken from the values of step 2. The R 5 amplitude is then varied with the R 6 amplitude being fixed, and the pair with the smallest  difference between the horizontal and vertical standard deviations is taken [see Fig. 5(b)]. Then, keeping the minimum R 5 amplitude, the R 6 amplitude is varied until the smallest difference between the standard deviations is found again [see Fig. 5(c)], which indicates a circular beam. For both graphs, the standard deviation in pixels is converted to the beam radius in microns. In this case, the value of R 6 has two possible pairs as they both have the same vertical and horizontal spot radius difference. To determine its best value, the highest beam intensity was taken into consideration. Thus, the most fitting pair is for R 5 ¼ 3.60 AE 0.01 and R 6 ¼ 1.00 AE 0.01.
The amplitudes of all of the Zernike modes are now defined to correct the astigmatism and to define the focal point on the camera. Images of the beam before and after correction are shown in Fig. 6. The result is a greater than 10 times improvement in the focus spot size after correction.

Wavelength as a Function of Defocus
Finally, the behavior of the beam after correction of the optical aberrations is investigated by measuring the focused beam spot size as a function of the defocus amplitude. Figure 7 shows the RMS spot width, defined as 1 2 ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi Wx 2 þ Wy 2 p with W x and W y being the horizontal and vertical spot widths that are derived from the horizontal standard deviation σ x and the vertical  standard deviation σ y (W x∕y ¼ 2σ x∕y pc with pc ¼ 4.65 μm, the size of the camera pixel). The "best" focus is taken to be the smallest spot size, which is at the bottom of the parabola.
The focal point is determined to be at a defocus value of R 4 ¼ 23.05 AE 0.01 at a wavelength λ ¼ 632.8 nm. Figure 7 shows a parabola, symmetrical around the focal point, which indicates a correction of the astigmatism if compared with the previous beam evolution (see Fig. 3).
From Fig. 7, the beam waist radius is determined to be 44 AE 0.1 μm. This uncertainty is calculated based on different measurements: the vertical and horizontal beam waists and their respective inaccuracy as well as the camera pixel size. The theoretical beam waist radius, well known from Gaussian beam optics, is given by E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 6 ; 1 1 4 ; 6 1 5 The focal length, f, is the DMD to camera distance (54 AE 0.2 cm), and r edge is the smallest radial dimension to the edge of the DMD. The experimental beam waist radius is 2.1 times bigger than the diffraction limited beam waist for a wavelength of 632.8 nm. To examine the consistency of these results, the experiment is reproduced at different DMD-to-camera distances of 30 AE 0.2 cm and 76 AE 0.2 cm. This resulted in 2.5 and 2.7 times the diffraction limited beam waist, respectively. The results are consistent over the different focal lengths. However, based on our calculation, compared with the 2018 paper, 18 which measured six times the diffraction limited beam waist for a focal length of 25 cm, these results show that we reproduced and improved the experiment by correcting some of the optical aberrations.

Beam Size and Defocus Amplitude Comparison at Multiple Wavelengths
A graph showing the average measured beam radius as a function of the defocus amplitude for four laser wavelengths is shown in Fig. 8. These measurements were all made with a DMD-tocamera distance of 46 cm. Each of the four wavelengths is clearly distinguished. The blue laser spot size is notably larger than the other wavelengths-73 μm compared with 34 μm at 632 nm. This occurs for two reasons: first, the blue laser has a poor spectral bandwidth with a strong temperature dependency, and as such, this results in a broadening of the focus spot size. Second, the single mode fiber used for light delivery are multimode at 405 nm, which may also broaden the focal spot size. This also accounts for the larger uncertainty measurements at each defocus amplitude for the blue laser compared with the other lasers.
A second order polynomial fit is applied to the data for each wavelength plot of Fig. 8. From this, the amplitude representing the minimum spot size is determined. A comparison of experimental and theoretical values of the beam waist, as well as the corresponding defocus value, is given in Table 2.

Evolution of Beam Waist with Wavelength
The evolution of the beam waist as a function of the wavelength can be analyzed based on Table 3. If we compare the diffraction limited beam waist with the experimental beam waist, the 633 and 760 nm lasers are unsurprisingly smaller; their experimental beam waist is around twice their diffraction limited beam waist. The 532 and 405 nm lasers are three and six times their diffraction size, respectively. The larger spot size is a consequence of the relatively wide spectral bandwidths of each laser. The DMD behaves like a diffraction grating, thus there is a lateral shift of the focal spot on the camera sensor for a change in wavelength. The source spectral bandwidth results in a lateral shift that is far more significant than the transverse focal shift. This lateral shift is given by Δx ¼ mΔλf∕d, where m is the grating order, Δλ is the spectral bandwidth, f is the focal length, and d is the mirror spacing. 29 Given that the narrow bandwidth sources present a spot that is approximately twice the diffraction limit, we can apply the same estimation to the broader spectral sources and estimate the source spectral bandwidth. The 405 nm source bandwidth is estimated at 0.2 nm, and the 532 nm source is estimated at 0.1 nm.

Wavelength Characterization and Resolution
The evolution of the defocus amplitude at the best focus as a function of wavelength is shown in Fig. 9. The expected R 4 values as calculated using Eq. (5) are also shown. This shows good agreement for the longer wavelengths but not for the 405 nm laser. This may be due to the optical fiber not being single mode for this wavelength, with higher order fiber modes having higher divergence and requiring additional defocus amplitude.
A second order polynomial is used to fit the set of measured R 4 data. This characterization implies that, for an unknown wavelength, once the defocus amplitude for minimum spot size is found from the defocus scan, the input wavelength can be determined. From this graph, the  Fig. 9 Defocus value as a function of wavelength.
system wavelength resolution can be extracted. The confidence interval of the defocus value is estimated from the confidence interval of the beam waist, which itself is measured on LabView from the variation of the standard deviation associated with the horizontal and vertical Gaussian fits. Based on the confidence interval of the defocus value, the confidence interval for each wavelength can be estimated. These accuracy measurements are given in Table 4. Overall, the relative wavelength resolution is found to be at around 5 × 10 −3 , which is comparable to most of the wavelength determination systems. Indeed, previous laser detection systems based on diffraction gratings have shown absolute resolution of 10 nm, 11 whereas here we show a resolution of 3 nm.
We must, however, comment on the results of Ref. 18 attained using the DMD with an FZP pattern. They claim a relative resolution of 10 −5 with an HeNe laser. They are in fact presenting their measurement of precision of a known wavelength, based on the repetition of measurements and the standard deviation associated with them. In the context of laser detection, the most useful information is the accuracy with which an unknown wavelength could be determined, which in our work is determined from the precision of the minima of the polynomial fits for all wavelengths.

Conclusion
The FZP, being binary in nature, is perfectly matched with the DMD-a binary amplitude spatial light modulator capable of rapidly adjusting the zone plate focal length. In this work, we have shown how to improve the focusing quality of the zone plate device using Zernike modes of a rectangular basis. We presented a procedure for progressive improvement of focal spot quality, overcoming some inherent aberrations such as astigmatism and higher order modes. An algorithm in three stages was developed to correct the optical aberrations created by the DMD based laser detection system. Fifteen Zernike polynomials normalized on a rectangular surface were used not only to create the FZP pattern but also to correct those aberrations. A significant improvement in focal spot quality was observed beyond that achievable with an FZP alone, and focal spots on the order of twice the diffraction limit were measured.
This procedure was then used to find the defocus amplitude value that produces the best focus for four different visible wavelengths. The best system relative resolution was for an HeNe laser at 4.7 × 10 −3 , better than most laser detection systems based on diffraction gratings. These wavelengths can be used to produce a calibration curve for the system. This can then be used to estimate the accuracy with which an unknown wavelength could be determined through a process of scanning the zone plate focus amplitude. It is estimated that a relative wavelength resolution of 5 × 10 −3 is achievable.
The approach of controlling the diffracted wavefront and correcting the inherent and system aberrations is generic and can be applied to any system utilizing a DMD, with the aim of improving the quality of the outgoing wavefront. Once a suitable set of Zernike modes has been established, it can be used as a device profile upon which additional functions or operations can be applied-such as adding focal power, as was performed here.
When considering the performance, the context of using the DMD for laser detection must be considered. The DMD is a versatile device capable of measuring several optical characteristics of laser radiation, and we are demonstrating one potential way in which the source wavelength can be measured with such a system. A DMD-based laser detection system could operate with multiple functionalities, enabling it to identify relevant properties such as wavelength, spectral width, coherence length, angle of arrival, and pulse width. This versatility from a single optical device makes the DMD an attractive and useful tool.