Scale factor correction for Gaussian beam truncation in second moment beam radius measurements

Abstract. Charged-couple devices (CCD) and complementary metal oxide semiconductor (CMOS) image sensors, in conjunction with the second moment radius analysis method, are effective tools for determining the radius of a laser beam. However, the second moment method heavily weights sensor noise, which must be dealt with using a thresholding algorithm and a software aperture. While these noise reduction methods lower the random error due to noise, they simultaneously generate systematic error by truncating the Gaussian beam’s edges. A scale factor that is invariant to beam ellipticity and corrects for the truncation of the Gaussian beam due to thresholding and the software aperture has been derived. In particular, simulations showed an order of magnitude reduction in measured beam radius error when using the scale factor—irrespective of beam ellipticity—and further testing with real beam data demonstrated that radii corrected by the scale factor are independent of the noise reduction parameters. Thus, through use of the scale factor, the accuracy of beam radius measurements made with a CCD or CMOS sensor and the second moment are significantly improved.


Introduction
Charged-couple devices (CCD) and complementary metal oxide semiconductor (CMOS) image sensors have become standard beam radius measurement tools due to their ability to return a two-dimensional (2-D) beam intensity profile. The first-order moment (arithmetic centroid) has been used with CCD sensors to track the position of lasers, 1 Shack-Hartman wavefronts, 2 and stars. 3 From values such as second moment beam diameter, beam ellipticity, and beam orientation, more complex propagation related beam quality metrics such as M 2 may be determined. [4][5][6] We note that for a pure TEM 00 Gaussian beam, the second moment radius equals the 1∕e 2 (13.53%) radius determined by percentof-peak intensity. Although previous literature has dealt primarily with the CCD sensor, CMOS sensors are quickly replacing CCD sensors as they are more economical to produce and require less power. 7 The second moment beam radius measurement technique, in conjunction with the CCD or CMOS sensor, improves on simpler beam profiling devices, which return only a onedimensional (1-D) beam intensity profile through use of a scanning slit or knife edge. The beam radius on the scanning beam profilers is calculated by finding the radius at which the beam's 1-D intensity profile intersects a predetermined percentage (e.g., 13.53%) of the beam's peak intensity. 8 Although a similar method can be used with CCD or CMOS sensors, the second moment utilizes the full 2-D beam profile, providing a more accurate beam measurement technique. The radius of the monochromatic beam w σ ðzÞ is given by the second moment as 5 E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 1 ; 6 3 ; 1 1 7 w σ ðzÞ ¼ ffiffi ffi 2 p σ r ðzÞ.
σ r ðzÞ 2 is defined as 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 ; 3 2 6 ; 4 3 9 σ 2 r ðzÞ ¼ R R r 2 Iðr; zÞrdrdθ R R Iðr; zÞrdrdθ ; (2) where r is the radius extending from the center of the beam, z is the beam's axis of propagation, and Iðr; zÞ is the beam's time-averaged intensity distribution. This paper addresses only monochromatic beams, thus forgoing the use of the second moment polychromatic beam radius definition. 9 In the past, image sensors were avoided for beam measurement since high noise levels from background light photon noise, readout noise, background level, and sampling error 10 were problematic when coupled with the second moment measurement method, which is highly susceptible to error from noise. However, the last two decades have seen improvements to image sensor hardware and the development of noise reduction techniques, which enable image sensors to provide accurate beam radius measurements. The noise reduction techniques can be understood by considering the second moment integrals [see Eq. (2)], which heavily weight noise at high values of r. 11 If-for a theoretical sensor-the limits of σ 2 r ðzÞ extended toward infinity, then the second moment integral would be completely dominated by noisy pixels. 12 Even with finite dimensions, noise at high r values and outside the beam area can adversely affect the accuracy of small beam measurements. Two techniques are generally used to reduce noise. In the first method, pixels below a certain threshold value are removed from the second moment calculation (thresholding) in an attempt to retain only valid beam data. 13 However, noisy pixels falling above the threshold value can remain. Therefore, the second technique limits the region about the centroid over which the summation occurs (software aperture) to further reduce the second moment error due to noise. 14 The thresholding algorithm is applied to the image sensor data before using a software aperture or calculating the second moment. 13 Thresholding entails first sampling an unilluminated portion of the sensor (e.g., the four corners) to determine the mean μ and standard deviation σ n of the background noise. The mean and standard deviation are then used to calculate a threshold value against which each pixel's intensity value is compared. Pixels falling below the threshold value are considered unilluminated, whereas pixels above the threshold have the mean subtracted from their intensity value and are then used in the second moment calculation. A pixel I p ðx; yÞ is considered illuminated when 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 ; 6 3 ; 3 1 3 I p ðx; yÞ > μ þ nσ n ; (3) where 2 < n < 4 according to the ISO 11146 standard. 13 If n is set too low, noisy pixels are considered illuminated, but if n is set too high then valid beam data are lost (see Fig. 1). Therefore, there exists an optimum value of n for which noise is excluded from the beam measurement but at which the beam truncation is minimal. 10 Regardless of the value n, some portion of a noisy beam is truncated by the thresholding procedure. After thresholding, the software aperture can be applied to exclude extraneous noise from the second moment calculation yet retain valid beam data. The software aperture is centered on the beam and extends a finite distance from the centroid [see Fig. 2(b)]. While the software aperture removes noise, it also truncates the tails of the Gaussian beam (see Fig. 1), and a balance must be struck between eliminating extraneous noise and removing valid data. 15 Theoretical work and simulations have shown that the optimal software aperture size varies with both the value n used in thresholding 14 and the radius of the beam. 11 Although n is predetermined, the beam radius is generally not known before measurement, and an iterative algorithm must determine the optimal software aperture size for the measured beam. 5 An elliptically invariant scale factor that corrects for the truncation of a Gaussian beam by both thresholding and the software aperture is derived in this paper. Since a scale factor must be based on the expected beam, 15 we use the ubiquitous TEM 00 Gaussian, which has a time-averaged intensity profile Iðr; zÞ represented by where I 0 is the peak intensity of the beam, γ is defined as 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 ; 3 2 6 ; 2 2 7 and wðzÞ is the radius of the beam when the intensity is 1∕e 2 .

Scale Factor Derivation
The scale factor derived herein corrects for the truncation of the Gaussian beam by both thresholding and the software aperture. To derive the scale factor, three main steps are needed. First, the radius (threshold radius) at which the Gaussian beam is truncated by thresholding alone must be determined. This value is then used to calculate the software aperture radius-where the beam is truncated by both noise reduction techniques. Finally, the software aperture radius is   applied to the second moment integrals, which yields an analytic solution and allows the scale factor to be determined through algebraic manipulation.

Thresholding
Thresholding is performed on the sensor data before the software aperture is applied or the second moment is calculated. For ease of calculation, the standard deviation of the noise is rewritten as the peak beam intensity multiplied by a scalar k 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 ; 6 3 ; 6 4 8 σ n ¼ kI 0 : After the threshold comparison has been applied, the mean is subtracted from the illuminated pixels. The radius r t at which the Gaussian intensity distribution is truncated by thresholding can then be found by setting Iðr t ; zÞ equal to the threshold value nkI 0 E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 7 ; 6 3 ; 5 6 2 I 0 e −γr 2 t ¼ nkI 0 : Solving Eq. (7) for r t yields E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 8 ; 6 3 ; 5 1 9 r t ¼

Software Aperture
The software aperture is applied after thresholding to include valid beam data and exclude extraneous noise from the second moment calculations. Although previous work has focused on a square or rectangular software aperture, 12,13 a radially symmetric software aperture (for a radially symmetric beam) has the advantage of excluding extraneous noise found in the corners of a rectangle or square. We define the software aperture as a circular region centered on the beam, which includes a portion β of the sensors total power P T after thresholding. β is given as E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 9 ; 6 3 ; 3 4 0 β ¼ where P S is the power within the software aperture. To calculate P S and P T , the equation for power is used E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 1 0 ; 6 3 ; 2 7 5 P ¼ Nominally, the radius limit R would extend to infinity for P T ; however, thresholding truncates the beam before the software aperture's application, so the beam's remaining power is contained within the radius r t . Thus, for the total power, R ¼ r t . For the power in the software aperture, R ¼ r s , where r s is the radius of the software aperture. Now Eq. (9) can be rewritten E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 1 1 ; 6 3 ; 1 5 5 β ¼ with Eq. (8) replacing r t . Solving Eq. (11) for r s yields E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 1 2 ; 3 2 6 ; 7 5 2 where ν is defined as E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 1 3 ; 3 2 6 ; 6 9 9 ν ¼ βð1 − nkÞ: (13) Equation (12) gives the radius at which the Gaussian beam is truncated by both thresholding and the software aperture (see Fig. 1).

Scale Factor
To find the radius of the beam, Eq. (2) is first rewritten with integration limits defined by the software aperture E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 1 4 ; 3 2 6 ; 5 8 6 Evaluating the integral in the numerator gives E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 1 5 ; 3 2 6 ; 5 2 9 whereas the integral in the denominator yields E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 1 6 ; 3 2 6 ; 4 6 3 Substituting Eqs. (15) and (16) into Eq. (14) and simplifying gives E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 1 7 ; 3 2 6 ; 4 0 2 Next, we solve Eq. (17) for σ r ðzÞ in terms of ν by substituting Eq. (12) for r s E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 1 8 ; 3 2 6 ; 3 3 5 Now, the second moment radius w σ ðzÞ is found by substituting Eq. (18) into Eq. (1) and replacing γ with Eq. (5) E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 1 9 ; 3 2 6 ; 2 6 8 Solving Eq. (19) for the actual beam radius wðzÞ in terms of w σ ðzÞ gives E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 2 0 ; 3 2 6 ; 2 0 0 where ψðνÞ is the scale factor defined by E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 2 1 ; 3 2 6 ; 1 5 8 Thus, the second moment radius-subject to systematic error from truncation-can be multiplied by the scale factor (see Fig. 3) to give the beam radius devoid of truncation error. The variables in ν are either predetermined or found using beam analysis software, thereby allowing the scale factor to be calculated for a measured beam. Although the scale factor accounts for both thresholding and the software aperture, it simplifies when only one noise reduction technique is used (either thresholding or the software aperture). If only thresholding is used, β ¼ 1 and ν ¼ 1 − nk, so the scale factor reduces to E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 2 2 ; 6 3 ; 4 9 8 ψðn; kÞ Conversely, when only the software aperture is applied, n ¼ 0 and ν ¼ β. Thus, the scale factor becomes If neither thresholding nor the software aperture is used, the limit as β goes to one and n goes to zero yields which is the expected result since the Gaussian beam is truncated by neither thresholding nor the software aperture. It can be shown (see Appendix A) that the scale factor is invariant to the ellipticity of the beam. However, to find analytical solutions to the second moment integrals, the scale factor derivation must be performed with a radially symmetric Gaussian intensity distribution and the polar second moment equations. Therefore, an elliptical intensity distribution in region S is rewritten as a radially symmetric distribution in the new region S 0 (see Fig. 2) through use of a linear transform. The scale factor derivation demonstrated above is then performed in region S 0 with the polar second moment equations. After transforming from region S 0 back to S, the scale factor has the same form as Eq. (21) and corrects the second moment calculated radii along both the x and y axes.

Testing
Both simulations and real beam data were used to test the scale factor. Whereas simulations provided a more in-depth analysis of the scale factor's effectiveness-by comparing the measured beam radii to the actual beam radii, determined a priori-the analysis of real beam data was needed to demonstrate the efficacy of the scale factor in real-world applications. However, since the radius of a real beam cannot be predetermined, the noise reduction parameters (n and β) were varied during measurement to show that radii corrected by the scale factor are invariant to n and β as derived.

Simulations
Simulated laser beams were generated to test the scale factor's effectiveness and invariance to ellipticity by comparing the generated radii wðzÞ to the measured radii w σ ðzÞ and determining the error in the measured radii. The beams were simulated on a 16-bit sensor of 512 × 512 pixels, with each pixel's length and width equal to p w ¼ 5.5 μm. Although most image sensors are 12 bit, error from analog-to-digital quantization can be ignored when using a 16-bit sensor. 14 The beams were generated with the beam's peak amplitude scaled to 0.9a m , where a m is the total analog-to-digital converter levels for a sensor (i.e., a m ¼ 2 16 for a 16-bit sensor).
Beam analysis software calculated the second moment radii of the generated beams and allowed thresholding and the software aperture to be turned on or off independently. Thresholding was applied with n (the scalar of the standard deviation of the noise) set to 4 (highest allowable value per the ISO 11146 standard). Generally, n is optimized to sufficiently threshold noise yet minimize beam truncation; however, the scale factor corrects error due to truncation, allowing high values of n-which remove more noise-to be used. The software aperture radius (or major and minor axes for an ellipse) was iterated by the software until E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 2 6 ; 3 2 6 ; 2 1 8 0.990P T ≤ P S ≤ 0.992P T ; (26) which corresponds to an aperture radius roughly 1.5 times the beam radius. When both thresholding and the software aperture were turned on, the software aperture radius was calculated after thresholding had been applied. Due to the layout of the image sensor's pixels as a rectangular grid, the second moment equations in Cartesian coordinate form, rather than polar coordinate form, were used. Since, for the beams generated, the angle between the measurement axes and the beam axes was zero, the second moment equations for the beam radii simplified to 16 with Δx and Δy each equal to p w . Equations (27) and (28) were each multiplied by the scale factor (calculated via the beam analysis software for each beam) to give the corrected beam radius. The analysis software's calculated radii (with and without the scale factor) were compared to the generated beam's actual radii to determine the percent error. We postulated that the calculated radii corrected by the scale factor would return a smaller percent error than the uncorrected radii and that the scale factor would correct the radii values irrespective of the beam's ellipticity. Three sets of radially symmetric beams were generated and analyzed with different noise reduction settings to characterize the effectiveness of the scale factor. Whereas the first set of beams used only thresholding and the second set of beams applied only the software aperture, the third set of beams employed both thresholding and the software aperture together. Gaussian noise with a mean of μ ¼ 0.0174a m and a standard deviation of σ n ¼ 0.0036a m was added to the first and third set of beams to simulate noise on the image sensor. The values for μ and σ n were chosen to reflect the noise levels seen when measuring real beam data. Since, the second set of beams was analyzed without thresholding, the scale factor reduced to Eq. (23) and had no dependence on noise; therefore, for these beams, no noise was added.
The error of the corrected radii was over an order of magnitude lower than the error of the uncorrected radii across all three sets of calculated beam radii. The error for the first set of calculated beam radii exhibited exponentially decaying behavior and became asymptotic at a radius of 30p w [see Fig. 4(a)] with an average error of 3.46% and 0.07% for the uncorrected and corrected beams, respectively. The smaller beams had fewer illuminated pixels, and the noise left after the thresholding process dominated the second moment calculation, which led to high errors. For the second set of beams, the error was approximately constant with an average of 2.41% for the uncorrected radii and 0.20% for the corrected radii [see Fig. 4(b)]. The third set of beams showed exponential decay, which reached an asymptote around 30p w with an average uncorrected error of 5.24% and a corrected error of 0.05% [see Fig. 4(c)]. Although the large error for the smaller beams was similar to the first set of beams (thresholding only), the software aperture removed outlying noisy pixels, which significantly reduced the error compared to thresholding alone.
Whereas the first and second tests demonstrated that the scale factor independently corrects for beam truncation due to either thresholding or the software aperture, the third test showed it can correct for them simultaneously. Indeed, thresholding and the software aperture were needed in conjunction since thresholding alone was unable to return accurate beam measurements for the small beams. Although the uncorrected error was significantly higher when both thresholding and the software aperture were used (due to the combination of systematic errors), the corrected error was of similar magnitude as the corrected error when only thresholding or the software aperture were employed.
Finally, a set of elliptical beams was generated with Gaussian noise (μ ¼ 0.0174a m and σ n ¼ 0.0036a m ) to determine whether the scale factor is, as derived, invariant to the ellipticity of the TEM 00 Gaussian beam (see Fig. 5). The generated beams had ellipticities (ϵ) ranging from 0.08 to 1.00, and their second moment radii were calculated after both thresholding and the software aperture had been applied. The error for the corrected radii was approximately constant as the beam ellipticities changed (see Fig. 5), and the scale factor reduced the error from an average of 5.23% (uncorrected) to 0.06% (corrected). Although slight variations were seen in the corrected error, these were due to the random Gaussian noise in the beams rather than changes in ellipticity. The significant reduction in beam radius error coupled with the consistency of the corrected error, with respect to the changes in ellipticity, demonstrated that the scale factor corrects for the truncation of a Gaussian beam irrespective of ellipticity.

Real Beam Data
Since the radius of a real laser beam is determined only through measurement and not known a priori, the measured radius cannot be compared to the exact radius as with the simulated beams. However, noting that the scale factor corrects for the second moment measurement's dependence on the noise reduction parameters n and β [see Eq. (20)], we postulated that systematically varying the noise parameters would result in a varied uncorrected radius and a constant corrected radius. Furthermore, the invariance of the corrected radius to n and β reflected the physical description of a real laser beam-the radius of which does not change based on software parameters-and allowed the scale factor to be tested on real beam data with a predicted result.
Two tests were implemented using a single mode TEM 00 Gaussian beam with a wavelength of 675 nm and a beam radius of ∼145 μm measured on a 12-bit image sensor of 512 × 512 pixels (pixel height and width 5.5 μm) with the beam analysis software described in the simulation section. Whereas the first test used only thresholding with n varied from 3.5 to 4 (for n > 3.5 the effect of the scale factor is unobscured by noise), the second test used both thresholding and the software aperture with n held constant at n ¼ 4 and β evenly incremented from 0.985 to 0.995. The measured radii (both uncorrected and corrected) were divided by their initial Fig. 5 The radius percent error as a function of the beam ellipticity with both thresholding and the software aperture applied. Both the uncorrected error (triangle, average percent error 5.23%) and the corrected error (diamond, average percent error 0.06%) were approximately constant with varying beam ellipticity. The beams were generated and measured ten times at each point to give the average and standard deviation (error bars). Finally, the error from beam radius measured along the x axis and the error from the beam radius measured along the y axis were averaged to give a single error value. Fig. 4 (a) The radius percent error as a function of the beam radius with only thresholding applied. Both the uncorrected error (triangle) and the corrected error (diamond) showed decaying exponential behavior, but quickly became asymptotic around 30p w with average errors of 3.46% and 0.07%, respectively. (b) The radius percent error as a function of the beam radius using only the software aperture. The uncorrected error (triangle, average error 2.41%) and the corrected error (diamond, average error 0.20%) were approximately constant for the various beam radii. (c) The radius percent error as a function of the beam radius with both thresholding and the software aperture applied. The error decayed exponentially, reaching the asymptote around 30p w , but with an error significantly lower than in (a). Although the uncorrected error (triangle, average error 5.24%) for the asymptotic region was higher than in (a) and (b), the corrected error (diamond, average error 0.05%) was of similar magnitude. For (a)-(c), the error from beam radius measured along the x axis and the error from the beam radius measured along the y axis were averaged to give a single error value. In (a) and (c), the beams were generated and measured 10 times at each point to give the average and standard deviation (error bars). The beams in (b) were only measured once since they contained no noise. radius values to show deviations from the initial values (Fig. 6).
In both tests, the uncorrected radii decreased as the truncation of the beam increased (larger n and smaller β); however, the corrected radii remained approximately constant, demonstrating that the radii corrected by the scale factor are invariant to changes in n and β as predicted. Furthermore, the tests-which were performed on real beam data-showed that the scale factor effectively corrects the second moment radius measurements in real-world application.

Conclusion
An image sensor (CCD or CMOS) in conjunction with the second moment radius analysis method can accurately measure the radius of a laser beam; however, the second moment method heavily weights noise and noise reduction techniques such as thresholding and a software aperture must be used before calculating the second moment beam radius. Even as these techniques reduce the random error due to noise, they simultaneously generate systematic error by truncating the tails of the Gaussian beam. A scale factor, invariant to the ellipticity of the beam, was derived to correct the second moment beam radius in response to this systematic error.
Both simulations and real beam data were used to test the scale factor. Simulated laser beams tested the effectiveness of the scale factor and its elliptical invariance by comparing the measured beam radii-corrected and uncorrected-to the generated beams' actual radii. The measured beam radii were calculated with three different noise reduction settings: only thresholding, only the software aperture, and both thresholding and the software aperture. With all three methods, the scale factor reduced the error of the measured radii by over an order of magnitude; thus, as predicted, the scale factor significantly improved the accuracy of the second moment beam radius measurements. Next, a set of elliptical beams was generated and the radii were measured with both thresholding and the software aperture applied. The corrected error of the beam radii was approximately constant as the ellipticity changed, proving that the scale factor is, as derived, invariant to beam ellipticity. Finally, the scale factor was tested with real beam data by systematically varying the values used in the noise reduction techniques. The observed behavior-the corrected radii remained constant, while the uncorrected radii changed-matched both the derived and physical predictions, thus demonstrating the scale factor's effectiveness in real-world applications.
Further simulations could be done to test the scale factor when either the noise levels are varied or the size of the simulated sensor is changed (e.g., 256, 1024, or 2048 pixels across). Additional theoretical work could be done to derive a scale factor that is valid for higher-order modes (i.e., Hermite-Gaussian beams and Laguerre-Gaussian beams).

Appendix A: Scale Factor Invariance for Elliptical Gaussian Beams
The scale factor is invariant to the ellipticity of the beam as can be shown by transforming an elliptical beam in region S to a radially symmetric beam in region S 0 and performing the scale factor derivation there. The time-averaged intensity Iðx; y; zÞ of an elliptical Gaussian beam is given in a Cartesian coordinate system S as Fig. 6 (a) Radius as a function of n divided by the initial radius r 0 for both the uncorrected (triangles) and corrected radii (diamonds) with only thresholding applied. As n was incremented, the uncorrected beam radius decreased and the corrected beam radius remained approximately constant. (b) Radius as a function of β divided by the initial radius r 0 for both the uncorrected (triangles) and corrected radii (diamonds). Thresholding and the software aperture were both used, but n was held constant at n ¼ 4. The uncorrected beam radii increased as the value of β increased (larger software aperture), whereas the corrected radii remained approximately constant. For both (a) and (b), the error from beam radius measured along the x axis and the error from the beam radius measured along the y axis were averaged to give a single error value. Additionally, the beam was measured 10 times at each point to give the average and standard deviation (error bars).
Optical Engineering 043110-7 April 2017 • Vol. 56 (4) Hofer, Dragone, and MacGregor: Scale factor correction for Gaussian beam truncation in second moment beam. . .  where I 0 is the peak intensity, w x ðzÞ is the radius of the beam along the x axis, and w y ðzÞ is the radius of the beam along the y axis. A new region S 0 with coordinates x 0 and y 0 is formed from S with a transform where j ∂ðx;yÞ ∂ðx 0 ;y 0 Þ j is the Jacobian determinant given by