High dynamic spectroscopy using a digital micromirror device and periodic shadowing

We present an optical solution called DMD-PS to boost the dynamic range of 2D imaging spectroscopic measurements up to 22 bits by incorporating a digital micromirror device (DMD) prior to detection in combination with the periodic shadowing (PS) approach. In contrast to high dynamic range (HDR), where the dynamic range is increased by recording several images at different exposure times, the current approach has the potential of improving the dynamic range from a single exposure and without saturation of the CCD sensor. In the procedure, the spectrum is imaged onto the DMD that selectively reduces the reflection from the intense spectral lines, allowing the signal from the weaker lines to be increased by a factor of 2 via longer exposure times, higher camera gains or increased laser power. This manipulation of the spectrum can either be based on a priori knowledge of the spectrum or by first performing a calibration measurement to sense the intensity distribution. The resulting benefits in detection sensitivity come, however, at the cost of strong generation of interfering stray light. To solve this issue the Periodic Shadowing technique, which is based on spatial light modulation, is also employed. In this proof-of-concept article we describe the full methodology of DMD-PS and demonstrate – using the calibration-based concept – an improvement in dynamic range by a factor of ~100 over conventional imaging spectroscopy. The dynamic range of the presented approach will directly benefit from future technological development of DMDs and camera sensors. © 2017 Optical Society of America OCIS codes: (300.6190) Spectrometers; (290.2648) Stray light; (110.1085) Adaptive imaging; (300.6380) Spectroscopy, modulation. References and links 1. X. Qian, X.-H. Peng, D. O. Ansari, Q. Yin-Goen, G. Z. Chen, D. M. Shin, L. Yang, A. N. Young, M. D. Wang, and S. Nie, “In vivo tumor targeting and spectroscopic detection with surface-enhanced Raman nanoparticle tags,” Nat. Biotechnol. 26(1), 83–90 (2007). 2. H. Karttunen, P. Kröger, H. Oja, M. Poutanan, and K. J. Donner, Fundamental Astronomy (Springer-Verlag, Berlin Heidelberg, ed. 5, 2007). 3. A. C. Eckbreth, Laser Diagnostics for Combustion Temperature and Species, 3 edition (Taylor & Francis, 1996). 4. C. N. Banwell, Fundamentals of Molecular Spectroscopy (McGraw-Hill, Maidenhead, ed. 4, 1994). 5. J. M. Hollas, Modern Spectroscopy (John Wiley & Sons, New York, ed. 4, 2004). 6. R. A. Viscarra Rossel, D. J. J. Walvoort, A. B. McBratney, L. J. Janik, and J. O. Skjemstad, “Visible, near infrared, mid infrared or combined diffuse reflectance spectroscopy for simultaneous assessment of various soil properties,” Geoderma 131(1-2), 59–75 (2006). 7. V. A. Fassel, J. M. Katzenberger, and R. K. Winge, “Effectiveness of interference filters for reduction of stray light effects in atomic emission spectrometry,” Appl. Spectrosc. 33(1), 1–5 (1979). 8. P. W. J. M. Boumans, “A century of spectral interferences in atomic emission spectroscopy Can we master them with modern apparatus and approaches?” J. Anal. Chem. 324, 397–425 (1986). 9. G. Larson, V. Fassel, R. Winge, and R. Kniseley, “Ultratrace analyses by optical emission spectroscopy: the stray light problem,” Appl. Spectrosc. 30(4), 384 (1976). 10. E. Kristensson, J. Bood, M. Aldén, E. Nordström, J. Zhu, S. Huldt, P. E. Bengtsson, H. Nilsson, E. Berrocal, and A. Ehn, “Stray light suppression in spectroscopy using periodic shadowing,” Opt. Express 22(7), 7711–7721 (2014). 11. E. Kristensson and A. Ehn, “Improved spectral sensitivity by combining periodic shadowing and high dynamic range imaging,” Spectrosc. Lett. 49(2), 91–95 (2016). Vol. 25, No. 1 | 9 Jan 2017 | OPTICS EXPRESS 212 #278327 http://dx.doi.org/10.1364/OE.25.000212 Journal © 2017 Received 7 Oct 2016; revised 22 Nov 2016; accepted 5 Dec 2016; published 4 Jan 2017 12. P. E. Debevec and J. Malik, “Recovering High Dynamic Range Radiance Maps from Photographs,” in Proceedings of the 24th Annual Conference on Computer Graphics and Interactive Techniques, T. Whitted, ed. (ACM Press/Addison-Wesley, 1997), pp. 369–378. 13. M. L. Meade, “Advances in lock-in amplifiers,” J. Phys. E Sci. Instrum. 15(4), 395–403 (1982). 14. D. Giassi, B. Liu, and M. B. Long, “Use of high dynamic range imaging for quantitative combustion diagnostics,” Appl. Opt. 54(14), 4580–4588 (2015). 15. L. Gao, J. Liang, C. Li, and L. V. Wang, “Single-shot compressed ultrafast photography at one hundred billion frames per second,” Nature 516(7529), 74–77 (2014). 16. F. Soldevila, E. Irles, V. Durán, P. Clemente, M. Fernández-Alonso, E. Tajahuerce, and J. Lancis, “Single-pixel polarimetric imaging spectrometer by compressive sensing,” Appl. Phys. B 113(4), 551–558 (2013). 17. G. Ritt and B. Eberle, “Automatic suppression of intense monochromatic light in electro-optical sensors,” Sensors (Basel) 12(12), 14113–14128 (2012). 18. K. J. Kearney and Z. Ninkov, “Characterization of a digital micromirror device for use as an optical mask in imaging and spectroscopy,” Proc. SPIE 3292, 81–92 (1998).


Introduction
Spectral analysis of light is one of the most common analytical methods within the field of natural science with applications in biomedicine [1], astronomy [2], combustion [3], fundamental physics [4,5], agriculture [6], to name a few examples. In a typical spectrometer the light is dispersed into its spectrum using e.g. a diffraction grating and detected with a twodimensional (2D) sensor. Although robust, this design is sensitive to interferences caused by strong spectral components -both from those that are directly detected and from those that fall outside the field-of-view and lights up the otherwise completely dark interior. This undesired light is usually referred to as stray light [7][8][9][10] and stems primary from scattering upon optics and dust as well as reflections on the inner walls. The error -manifested as an intensity offset -caused by stray light is often not significant in comparison to the intensity of a relatively intense spectral line, yet it leads to experimental difficulties monitoring weaker ones accurately. An experimental solution to this long-standing problem, based on spatial lock-in detection, was recently presented by Kristensson et al. [10], opening up for new spectroscopic strategies that otherwise could not be implemented. The method, referred as Periodic Shadowing (PS), was further combined with High Dynamic Range (HDR) imaging to improve the dynamic range of the spectrometer as shown in [11]. HDR is mostly used for digital photography and is based on a simple premise; dim regions in an imaged scene can be better observed if bright regions are overexposed, and by merging several photos with different exposure times it is possible to create one with improved dynamic range [12]. Incorporating PS together with the HDR approach was essential to avoid direct errors caused by the stray light, whose magnitudes increase with exposure time. Despite such progress, the possibility of obtaining high dynamic range spectroscopic measurements on a single exposure was still not achieved.
We present here a novel technical solution called DMD-PS towards high dynamic range, stray light-free imaging spectroscopy with the potential of single-shot recordings. The concept utilizes adaptive optics -a Digital Micromirror Device (DMD) -in its design to boost the dynamics. This device consists of ~2 million micrometer-sized mirrors arranged in a 2D array, where each mirror can rapidly tilt between ± 12 degrees. Placing the DMD at the output -spectrum plane -of the spectrometer and then relaying the spectrum onto a camera in a conjugate plane allows for active control and manipulation of the spectral information. In this paper we describe this methodology and demonstrate its capacity for high dynamic range spectroscopy.

Periodic shadowing
Periodic Shadowing (PS), which was first demonstrated in 2014 [10], is a spectroscopic technique that can suppress stray light. The method is based on mounting a transmission grating at the entrance slit, effectively spatially modulating the light entering the spectrometer. As the photons propagate through the spectrometer some will be deflected due to e.g. scattering upon dust inside the spectrometer as well as imperfections in the optics. Together these photons form the undesired stray light component. In contrast to the stray light, photons that travel the correct path without being perturbed -signal photons -retain the modulation information and ends up at the detector plane having a spatial distribution set by the transmission grating. This different characteristic between stray light and signal photons opens up for an analytical tool known as lock-in detection [13]. Figure 1 shows an example of a 2D spectrum acquired with a transmission grating mounted in front of the spectrometer (left panel), in which the modulated pattern that is superimposed on the spectral lines is clearly visible. The right panel shows the Fourier transform of the spectrum, highlighting the fundamental spatial frequency of the superimposed modulation. The purpose of PS is to extract only the information that resides within this spatial frequency band. To explain the methodology we will first give a conceptual description that is followed by a more detailed mathematical derivation. Fig. 1. Intensity modulated 2D spectrum. The example shows a Zinc emission spectrum as seen by the detector (left panel) when a transmission Ronchi grating is placed in front of the spectrometer, creating a spatial modulation of the spectral lines along the vertical direction. The Fourier transform of the image on the right shows how the spectral information is transferred away from the 0th order spatial frequency.
Lock-in detection is primarily used for signals varying periodically in time but it works equally well for a signal having a spatially modulated component. To understand the method, it is useful think of the signal of interest in reciprocal space, i.e. its Fourier transform. Here a signal is presented as a function of spatial frequencies rather than as a function of space, where the contribution from low spatial frequencies (smooth variations) are found near the origin whereas high spatial frequencies (fine structures) reside farther out. A typical 2D Fourier transform of a spectrum has only one dominating peak (spatial frequency) -the DC component -which describes the overall average intensity of the data. However, when a sinusoidal periodic structure is superimposed on the spectral lines, as it is the case with PS, a second peak appear in the Fourier transform, wherein the information from the signal photons alone resides. Figure 2 illustrates how this information can be extracted using digital data processing. Figure 2(a) shows an intensity-modulated 2D spectrum from a Sodium emission lamp and Fig. 2(b) its column-by-column Fourier transform. The magnified region highlights the Fourier components from one spectral line, comprising of (i) the DC component and (ii) the two fundamental frequencies of the superimposed intensity modulation (appearing at ± ν). Multiplying each column in Fig. 2(a) by a reference signal (created computationally), having the same periodicity as that of the superimposed modulation effectively rearranges the Fourier domain so that (i) and (ii) switch places, as illustrated in Fig. 2(c). To avoid prior knowledge of the phase of the modulation, each column can be multiplied with two reference signals, having a relative phase shift of 90 degrees (see Eqs. (1)-(9)). Since the modulated component has been transformed into a DC component, a low-pass filter can be applied to extract the information it carries (Fig. 2(d)). The stray light appears primarily at low spatial frequencies, so the multiplication with the reference signal thus transfers it into higher spatial frequencies and it is therefore removed with the filter. The final part of the process then involves extracting the inverse Fourier transform of the filtered data, generating a spectrum with very little interference from the stray light component. To explain the spatial lock-in algorithm mathematically, consider a column vector in the modulated spectrum (I) at the wavelength λ that contains a spectral line: where g ν is the modulation frequency of the grating, y the spatial vector, A the amplitude of the modulated signal, B a non-modulated background and ( ) y λ φ the unknown spatial phase of the superimposed modulation. Note that the phase is not regarded to be constant with y. The purpose of the lock-in algorithm is to extract A -wherein the signal resides -and to discriminate against B that contains the stray light. This is achieved by first creating two reference signals, In Eq. (4) and Eq. (5) where the tilde assignment marks the applied frequency filtering. In the presented data, we have used the following low-pass filter function 8 .
Extracting A λ  can then finally be accomplished by calculating

High dynamic range imaging using a digital micromirror device
A dynamic range higher than the capacity offered by a given camera system can be achieved using a concept based on multiple exposures [12,14]. In this concept, often referred to as High Dynamic Range (HDR), each exposure time is made different; one short to capture intense regions, one long wherein dimmer regions become visible and then one or several at intermediate times. The different recordings are then merged into a single one, having a superior dynamic range. Although the concept is mostly used for digital photography it has been applied for other applications and was recently demonstrated for spectroscopy [11]. However, HDR has several drawbacks. For example, the need for multiple exposures makes the approach inherently slow. In addition, saturation of the imaging sensor at long exposure times can lead to permanent damage of the CCD chip, especially in spectroscopic applications where the photon energy may be concentrated within a single row of pixels. Greatly exceeding the level of pixel saturation -needed to observe weak image features -can in such cases be practically impossible. Also, HDR relies on static or temporally averaged samples that produce a linear increase in signal strength with increased exposure time, which makes the approach unsuitable for studies of dynamic objects.
To solve these issues yet increasing the overall dynamic, one can incorporate a Digital Micromirror Device (DMD) in the spectrometer design. This device consist of a 2D array of ~2 × 10 6 switchable mirrors, each capable of reflecting light in either + 12 or −12 degrees with respect to the normal of the DMD. Both the tilt and the duty cycle (the percentage of time spent in these so-called "On" and "Off" states) of every mirror are controlled via the user. If a mirror stays 100% in its "On" state it will completely reflect all incident light, whereas a mirror will deflect all light if it spends 100% of its time in its "Off" state (see Fig.  3). Intermediate, grayscale values of the reflection are achieved by setting value of the duty cycle in-between these two extremes (8 bits with current technology). As an ensemble, the mirrors thus permit active wide-field light manipulation. We exploit the DMD technology to function as a second detector that, in principle, stores a coarse 8-bit version of the acquired spectrum. In conjunction with the 14-bit CCD camera used in our experiments, this leads to a theoretical 22 bits dynamic range of the entire system.
Compared to the traditional HDR concept, where the signal can only be safely raised above the level of pixel saturation marginally (~2 times according to the camera manufacturer), our DMD-based approach allows the overall signal to be increased, theoretically, by a factor of 256 above the level of pixel saturation without risking hardware damage. This feature will directly promote the ability of observing weak spectral features. DMDs have been exploited in the past for various imaging applications. Gao et al. used the DMD technology for compressed imaging in combination with a streak camera to achieve extreme video imaging rates [15]. Compressed imaging has also been used for single pixel imaging, to e.g. perform polarimetric imaging spectroscopy [16]. Ritt and Eberle constructed a DMD-based camera that minimizes dazzling caused by monochromatic interferences [17]. The DMD is also used in several fields to achieve HDR imaging by actively reducing intense regions in the image (e.g. intense stars in astronomy [18]), i.e. similar to our current aim. However, to the best of our knowledge, no reports address problems associated with elevated background levels that arise at longer exposure times (or with an increased laser power). When the overall signal level is increased by deflecting parts of the intense regions, the background level also becomes elevated, directly translating into both qualitative and quantitative errors. To solve this issue, we incorporate the PS technique to distinguish between light that traveled the correct path through the spectrometer and the stray light that has deviated from it. This approach allows us to increase the overall signal level without saturating the camera and, at the same time, remove the increased background component in the post-processing of the data.

Experimental setup
A Czerny Turner spectrometer with a focal length of 750 mm was modified to incorporate both the PS technique and the DMD, see Fig. 4. By placing a transmission Ronchi grating at the entrance slit, all light entering the spectrometer becomes spatially modulated -the basis for the PS method. At the exit of the spectrometer, where the detector usually is located, the DMD is positioned so that the spectral lines are focused onto its surface. The "On" state light is then detected by an EM-CCD camera (Andor Luca, 1002 × 1004 pixels) positioned inside the spectrometer while the "Off" state light is terminated. By uploading a grayscale image onto the DMD the spectrum can thus be manipulated in a controlled fashion; intense spectral lines can be reduced on a pixel level by deflecting them to the termination whereas other regions in the spectrum are fully reflected to the detector. The temporal resolution of the DMD, and thus of our system, is set by the frequency by which the mirrors can toggle between the two states (~20 kHz for currently available technology). The methodology can, however, be implemented for 'instantaneous' signals by utilizing a binary raster (static) pattern rather than a grayscale pattern, to potentially allow for e.g. pulsed laser applications.
Manipulation of the spectrum requires some prior knowledge regarding the relative strengths of the spectral lines. This can be achieved in one of two ways; either by a 'sophisticated guess' based on an expected line strength distribution for example (single-shot HDR) or by first recording a non-modified version of the spectrum that then serves as input for the DMD in a sequential acquisition. In contrast to imaging applications, where intense regions may be hard to predict, spectral lines appear at well-defined positions, thus greatly reducing the uncertainty of such 'guesses'. Although, the pattern projected onto the DMD does not necessarily have to trace the exact shape of the spectrum, the device could also act as a local neutral density filter that, more coarsely, reduces certain spectral regions that are known to contain intense spectral lines -an approach that could be especially suitable for laser-based measurements where it is known that the laser line will be spectrally dominant. Fig. 4. The optical design of the spectrometer. Light is collected with a lens and the object is imaged onto the entrance slit, where a Ronchi transmission grating is positioned to modulate the incoming light. Two 2" concave mirrors are used to collimate the light and image the spectrally separated light onto the DMD. The "On" state light is then collected with an EM-CCD camera (Andor, Luca). Prior to the measurements, a grid target is uploaded to the DMD, to enable pixel-to-pixel overlap between the DMD and the camera.
For the measurements presented in this paper, the second -"calibration based" -approach is employed and is based on the following procedure: • A spectrum is first recorded when all DMD mirrors are in their 'On' state ( Fig. 5(a)).
• The acquired spectrum is inverted and transformed into an 8-bit image that is sent to the DMD (Fig. 5(b)), thus manipulating the spectral line intensities (Fig. 5(c)). No pixels are given the value 0, as that would block the light completely (unless desired).
• A second (modified) PS spectrum is recorded, having a longer exposure time or increased laser power (Fig. 5(d)). The modified spectrum is then analyzed using the PS algorithm (Fig. 5(e)) and softwarecompensated for the differences in reflectivity caused by the DMD, thereby boosting its dynamic range (Fig. 5(f)). Note that, in contrast to traditional HDR, even if the sample would undergo temporal variations during the time in-between the two acquisitions, this will not necessarily lead to errors in the final data as the DMD and detector, in principle, operate as two independent detectors. Fig. 5. The data acquisition procedure to record HDR spectra. (a) A conventional 2D spectrum, acquired with all DMD mirrors in their "On" state. (b) The acquired data is then inverted and sent to the DMD, thus reducing the intensity of strong spectral lines. (c) An example of a 'modified' spectrum, where the relative strength between the spectral lines are more uniform. (d) An intensity-modulated spectrum, acquired with a longer exposure time to allow weaker spectral features to be detected without saturating the detector. (e) The acquired spectrum is then analyzed using the PS algorithm and (f) finally the user-induced manipulation is softwarecompensated for by multiplying the PS spectrum with the DMD image. Note that the intensities are on a logarithmic scale. Figure 6 shows a comparison between three emission spectra from Zinc, Sodium and Argon. Since our DMD-PS methodology is, in the current study, based on increasing the signal using a longer exposure time, the comparison with conventional data is not straightforward. A spectrum acquired with a longer exposure time cannot be directly compared with one acquired with a shorter integration time. Therefore, to enable a fair comparison between our spectra and conventional 2D spectroscopy, the conventional spectrum was acquired with an increased number of accumulations (N) so that the total integration time (N × t) was equal to that used in the DMD-PS approach. For example, if the exposure time for the conventional case was 0.01 seconds and corresponding value for DMD-PS was 2 seconds, N was set to 200. We refer to this approach as "Conv t " in Fig. 6, while the notations "Conv" and "PS" are used for measurements recorded with the same short exposure time. Note that all conventional spectra have been background corrected for via a blank recording. In the data analysis all spectra are normalized to span between zero and unity as well as being averaged along the spatial axis to better see the improvement in spectral contrast. Figure 6a compares Conv, PS and DMD-PS, while Figs. 6(b)-6(d) focus on comparing Conv t and DMD-PS. The comparison in Fig. 6(a) shows that even though the transmission grating removes ~50% of the incoming light, an improvement in terms signal-to-background (S/B) by a factor of ~20 is gained with PS. Our DMD-PS methodology further boosts the dynamic range by two orders of magnitude. Figures 6(b)-6(d) compare Conv t and DMD-PS, where a greater number of accumulations were used in the former case to compensate for the difference in exposure time. Note that increasing the exposure time is not an option here for the conventional case as this would lead to detector saturation. Figures 6(e)-6(f) show two graphs of the ratio between Conv t and DMD-PS, where it is shown that the contribution from stray light increases near strong spectral lines and that our approach can improve the dynamic range by more than two orders of magnitude. These results demonstrate that the presented methodology has the ability to both remove stray light and, at the same time, improve the spectral contrast. These are two important measurement factors for spectroscopy as they bring out and highlight spectral content and, consequently, facilitate in both line identification as well as line strength determination. Figure 7 also illustrates the improvement in the baseline made possible by the DMD-PS approach. The example shows two spectra of a Sodium spectrum, acquired using either Conv t or DMD-PS. A spectrally vacant region is selected from which the histogram is extracted, presented in Figs. 7(c) and 7(d), respectively. These data reveal an improvement in the baseline by two orders of magnitude, which is in agreement with the data shown in Fig. 6. Differences in the baseline between our methodology and conventional 2D spectroscopy can also be investigated by extracting signal-to-noise ratios (S/N) and signal-to-background ratios (S/B). This analysis is performed for all spectra from Fig. 6 and the results of the analysis are presented in Table 1. To extract the two quantities, a spectrally vacant region is first selected in a similar manner as in Fig. 7, from which either the standard deviation (noise) or the mean value (background) is calculated. The ratios between these quantities and the strongest peak of intensity are then computed (these values are also sometimes referred to as Peak S/N and Peak S/B), resulting in the values presented in Table 1. These values indicate the dynamic range achieved experimentally. This statistical analysis indicates similar improvements in measurement fidelity as those given in Figs. 6 and 7.

Table 1. Comparison of signal-to-noise (S/N) and signal-to-background (S/B) between
Conv t and DMD-PS. The S/N and S/B values are estimated by normalizing each spectra to unity and then extracting either the standard deviation or mean value, respectively, in a spectrally vacant region (see also Fig. 7). Zn  7700  1800  191700  80900  Ar  11900  2000  78600  33200  Cd  5700  1360 121000 46500

Conclusions
In summary, a spectrometer design that enables both the suppression of stray light and improvements in the dynamic range has been presented and demonstrated. The concept incorporates Periodic Shadowing to address the stray light problem and a programmable digital micromirror device to boost the dynamic range. By selectively reducing the brightness of the intense spectral lines, the overall signal level can be elevated, for example via a longer exposure time (the approach employed in this study) or by increasing the power of the source of excitation (e.g. a laser). The acquired spectrum is then software-compensated for the introduced modification. In effect, the DMD acts as a second detector that stores a coarse 8bit version of the spectrum while the normal detector records the finer details of it. Although the measurements presented in this paper were based on two acquisitions -one to sense the spectral features and one modified -the approach has the unique potential for single-shot HDR imaging spectroscopy, especially when the wavelength of intense spectral features can be foreseen. The DMD could also function as spectrally local neutral density filter that reduces (or fully blocks if needed) an entire spectral region that is known to contain intense spectral lines. Technological development of the dynamic range offered by DMDs and detectors will also directly benefit the presented approach. Finally, it is believed that DMD-PS could greatly facilitate in challenging spectroscopic measurements, such as laser-induced Raman scattering detection, where the intense elastically scattered light generates both an elevated level of stray light and a reduced dynamic range.

Funding
The