PONTIFICIA UNIVERSIDAD CATO´LICA DEL PERU´ ESCUELA DE POSGRADO IMPLEMENTATION OF A SPECKLE-BASED SPECTROMETER TESIS PARA OPTAR EL GRADO DE MAGI´STER EN F´ISICA AUTOR DIEGO RENATO UGARTE LA TORRE ASESOR FRANCISCO ANTONIO DE ZELA MARTINEZ JURADO EDUARDO RUBEN MASSONI KAMIMOTO EDER RUBE´N SA´NCHEZ ALCA´NTARA LIMA - PERU´ 2016 Agradecimientos Agradezco la asesor´ıa brindada por el profesor Francisco De Zela, las horas de dis- cusio´n con el profesor Eduardo Massoni, la ayuda de Yonny Yugra durante la imple- mentacio´n y calibracio´n del me´todo y al financiamiento de CONCYTEC que hizo posible la realizacio´n de este trabajo. Resumen Existen diversos me´todos para medir la longitud de onda de la luz. Uno de estos me´todos esta´ basado en la relacio´n que existe entre la longitud de onda y los patrones de moteado. La implementacio´n de este me´todo consiste en hacer ingresar luz con un ancho espectral pequen˜o sobre un extremo de una fibra o´ptica multimodal, para generar patrones de moteado a la salida de la fibra o´ptica. Estos patrones de moteado se relacionan con las longitudes de onda que contiene la luz que ingresa a la fibra o´ptica. En el presente trabajo se propone una nueva implementacio´n que consiste en usar una pantalla de cristal l´ıquido (LCD) en vez de una fibra o´ptica, para obtener patrones de moteados ma´s estables frente a las vibraciones meca´nicas a las que esta´ expuesto el arreglo experimental. Los resultados indicaron que es posible implementar el me´todo usando LCDs. Estos dispositivos ofrecen una mayor resistencia al ruido meca´nico y mejoran la reproducibilidad de los patrones de moteado generados. Abstract There are different methods to measure light wavelength. One of these methods is based on the relationship between wavelengths and speckle patterns. The original imple- mentation of this method used a multimode optical fiber to generate speckle patterns. To test if this method still operates appropriately when it uses a different source of speckle patterns, this work proposes an implementation in which the multimode optical fiber is replaced by a liquid crystal display (LCD). Our results show that it is possible to implement the method with a LCD. The use of a LCD reduces the mechanical instability and improves the reproducibility of the generated speckle patterns. Contents List of Figures 1 Introduction 1 2 Speckle theory 3 2.1 Diffraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.1.1 Huygens-Fresnel principle . . . . . . . . . . . . . . . . . . . . 3 2.1.2 Diffraction from an aperture . . . . . . . . . . . . . . . . . . . 4 2.2 Speckle patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.3 Speckle statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3 Speckle-based spectroscopy 13 3.1 Wavelength measurement . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.2 Spectrum reconstruction . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.3 Measurement optimization . . . . . . . . . . . . . . . . . . . . . . . . 19 4 Results 21 4.1 Method implementation . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.2 Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.3 Spectral composition reconstruction . . . . . . . . . . . . . . . . . . . 26 5 Conclusions 29 6 Bibliography 31 A Statistics of speckle patterns 33 A.1 Random phasors statistics . . . . . . . . . . . . . . . . . . . . . . . . 33 A.2 Intensity and phase statistics . . . . . . . . . . . . . . . . . . . . . . . 38 List of Figures 1 Huygens-Fresnel principle . . . . . . . . . . . . . . . . . . . . . . . . 4 2 Aperture diffraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3 Plane wave diffraction . . . . . . . . . . . . . . . . . . . . . . . . . . 6 4 Square aperture diffraction pattern . . . . . . . . . . . . . . . . . . . 6 5 Speckle pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 6 Rough surface ilumination . . . . . . . . . . . . . . . . . . . . . . . . 8 7 Random phase range effect . . . . . . . . . . . . . . . . . . . . . . . . 9 8 Correlation function . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 9 Prism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 10 Wavelength dependent speckle patterns . . . . . . . . . . . . . . . . . 14 11 Wavelength measurement . . . . . . . . . . . . . . . . . . . . . . . . . 15 12 Speckle pattern spatial sampling . . . . . . . . . . . . . . . . . . . . . 17 13 LCD representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 14 Experimental setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 15 Speckle pattern comparison . . . . . . . . . . . . . . . . . . . . . . . 23 16 Speckle pattern intensity distribution . . . . . . . . . . . . . . . . . . 24 17 Calibration speckle patterns . . . . . . . . . . . . . . . . . . . . . . . 25 18 Sample speckle patterns . . . . . . . . . . . . . . . . . . . . . . . . . 26 19 Reconstructed spectra . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Chapter 1 Introduction Spectrometers have been useful tools in many areas of science, including medicine. Depending on the specific application different specs are sought in these equipments. Among different characteristics, the resolving power and the operational bandwidth have been of special interest. Besides, nowadays’ requirements look for smaller and more portable apparatus as well. Classically, diffraction gratings have been used in spectrometers as their main component. These gratings are dispersive elements that allow to map in a one-to-one correspondence wavelength information and one dimensional spatial variables [1]. Nowadays there are in the literature novel implementations that take advantage of the properties of different materials like nanocavities, photonic crystals and optical fibers [2]. One important feature of the optical fiber spectrometer is a high resolving power at a relative low implementation cost [1]. This spectrometer maps wavelength infor- mation in a quite different way as compared to diffraction gratings because optical fibers allow the generation of random intensity diffraction patterns called speckle patterns. Speckle patterns are highly dependent on light wavelength and this spec- trometer uses this feature to achieve a high performance. On the other hand, optical fiber spectrometers suffer from high mechanical in- stability. Efforts have been made to offset this disadvantage [3, 4], fixing the optical 1 fiber in order to reduce the vibrational noise. Even though, this solution limits its possible applications. In this work an alternative implementation of the optical fiber spectrometer is proposed. In order to reduce the mechanical instability, a liquid crystal display (LCD) is used. LCDs acts as spatial light modulators (SLM) and offer a greater control in the reproducibility of the generated speckle patterns as compared to op- tical fibers. The presentation of this work has been organized as follows. In chapter 2 a brief review of the diffraction theory is given before addressing the speckle phenomenon. Then, section 2.2 explains how the addition of a random phase term to the diffrac- tion equation of a square aperture describes the speckle patterns produced with the LCD and in section 2.3 some statistical properties that characterized speckle pat- terns are presented. The spectroscopy method based on speckle patterns is explained in chapter 3. Section 3.1 shows how the relation between speckle patterns and wavelength is used as the basis of the method. Section 3.2 describes the calibration process and section 3.3 contains a method to optimize the calculated spectrum. The method implemen- tation using a LCD is tested and the main results are presented in chapter 4. Finally, in chapter 5 some conclusion remarks are given. 2 Chapter 2 Speckle theory This chapter introduces the theory behind the speckle-based spectroscopy. In section 2.1, a qualitative description of light diffraction is presented. Then, the speckle phenomenon is explained in section 2.2 and finally in section 2.3 the main results of the speckle statistics are exposed as a way to characterize qualitatively speckle patterns produced from different light sources. 2.1 Diffraction 2.1.1 Huygens-Fresnel principle Diffraccion is a term used to describe different phenomena that occur when a propa- gating wave encounters an obstacle. This topic was addressed by several researchers such as Huygens, Young, Fresnel, Kirchhoff, Rayleigh and Sommerfeld [5]. One of the first attempts to explain wave propagation through a homogeneous isotropic medium was made by Christiaan Huygens. He made the following two assumptions: 1. Each point of a wavefront acts as a source of secondary wavelets. These wavelets spread out with the same velocity of the wavefront from which they were originated. 2. The new wavefront at any later time is the same as the tangencial surface of all the secondary wavelets at that time. 3 These assumptions permitted a better understanding of the propagation of plane and spherical waves. However, they still could not account for the propagation of light near edges or through small appertures. It was not until 1818, when Augustin- Jean Fresnel incorporated his interference principle to Huygens assumptions, that diffraction effects could also be explained [6]. Figure 1: Huygens-Fresnel principle states that every point of a wave- front is a point source of a secondary spherical wavelets. The tangent line to all these wavelets forms a new wavefront. The addition of Fresnel ideas to Huygens’ work led to the Huygens-Fresnel prin- ciple (Fig.1). This principle states that “every unobstructed point of a wavefront, at a given instant, serves as a source of spherical secondary wavelets (with the same frequency as that of the primary wave). The amplitude of the optical field at any point beyond is the superposition of all these wavelets (considering theis amplituides and relative phases)” [7]. 2.1.2 Diffraction from an aperture The Huygens-Fresnel principle can be applied to describe qualitatively the diffrac- tion produced by a wave when passing through a small aperture Fig.2. According to this principle, each infinitesimal element of the aperture is represented by a source point of spherical waves. 4 Figure 2: The field at a point P due to a infinitesimal area element dS of the aperture. Following Huygens-Fresnel principle, each point of the aperture acts as a source of spherical waves. For monochromatic light the field due to an infinitesimal area element at a point P away from the aperture is expressed as dE(rp) = A(r) |rp − r|e i(ωt−k|rp−r|+φ(r))dS (2.1) where r is the position of the infinitesimal element, rp is the position of point P, A(r) is the field intensity per unit area at point r, ω is the angular frequency, k is the wavenumber and φ is phase factor. The total field is obtained just integrating the above expression over all the aperture: E(rp) = ∫∫ S A(r) |rp − r|e i(ωt−k|rp−r|+φ(r))dS . (2.2) Finally, when a propagating plane wave is parallel to the aperture (Fig.3), it is possible to introduce some simplifications to the last expression. For a plane wave, the field intensity per unit area is constant over the plane, A(r) = Ao. Also, since 5 Figure 3: When a plane wave pass through an aperture, every source point over the aperture surface produce spherical wavelets with the same initial phase. the wave vector is perpendicular to the aperture plane, then all source points will be in phase with one another allowing to set φ = 0. The resulting equation is E(rp) = ∫∫ S Ao |rp − r|e i(ωt−k|rp−r|)dS . (2.3) Evaluating this equation permits to obtain the diffraction pattern generated from different aperture shapes. In Fig.4 it is shown the diffraction pattern produced by a square apperture in the Fraunhofer limit 1. Figure 4: A cross-like diffraction pattern produced by a square aperture. 1The Fraunhofer limit is reached when the relation AλD < 0.01 is fulfilled. Here A is the area of the aperture, λ is light wavelength and D is the distance between the aperture and the diffraction pattern [8]. 6 2.2 Speckle patterns Speckle patterns are random intensity distributions formed “when fairly coherent light is either reflected from a rough surface or propagates through a medium with random refractive index fluctuations” [9]. One characteristic of these patterns is to present lots of tiny spots corresponding to zones of maximum constructive and destructive interference [10] as it is shown in Fig.5. Figure 5: A speckle pattern simulated in MATLAB 2015b. In order to study the randomness and other features in the intensity distribution of a speckle pattern, it is necessary to first find an expression for E, because the light intensity is proportional to |E|2. Invoking the Huygens-Fresnel principle in both rough surfaces and the end of optical fibers allows the use of equation 2.2. However, solving it using experimental data becomes a very difficult task because it requires to know the quantity |rp − r| for all source points. For example, it would be necessary to know in detail the topology of a rough surface or the exact field intensity at the end of an optical fiber. One solution is to use simulation techniques. There are many methods available in the literature to simulate speckle patterns [8, 11, 12, 13]. The most well know example of speckle pattern formation comes from the ilumination of a rough surface with laser light (Fig.6). Let each point of the surface be a source of spherical waves following the Huygens-Fresnel principle. For a perfectly flat surface equation 2.3 could be used, but since there is roughness, each source point will be away from P an extra distance d that depends entirely on its position on the surface. 7 Figure 6: Laser light reflected from a rough surface. Here D is the distance between the highest and lowest point of the surface and θ is the angle formed between the line joining a source point and point P and a line perpendicular to the rough surface. The corrected expression that accounts for the roughness of the surface is then E(rp) = ∫∫ S Ao |rp − r|e i[ωt−k(|rp−r|+d(r))]dS = ∫∫ S Ao |rp − r|e i(ωt−k|rp−r|)eikd(r)dS = ∫∫ S Ao |rp − r|e i(ωt−k|rp−r|)eiφ(r)dS (2.4) where φ(r) = kd(r) = 2pi d(r) λ . Let D represent the distance between the highest and lowest point in the rough surface, and θmax be the maximum angle formed between the line joining a source point and point P and a line perpendicular to the surface. The phase φ(r) will be bounded by 0 ≤ φ(r) ≤ 2pi D λ cos θmax D ≤ λ cos θmax 0 ≤ φ(r) ≤ 2pi D > λ cos θmax (2.5) 8 If D is very small compared to the light wavelength used to iluminate the sur- face (D << λ), φ is almost 0 and there is no contribution from the additional path length d. On the other hand, when D is in the same order of magnitud of λ or even greater, φ ranges from 0 to 2pi and makes a significant contribution. The addition of a uniform distributed random phase term to equation 2.3 repro- duces a diffraction pattern that gradually resembles a speckle pattern as φ’s range increases. This means that any element that produces a diffraction pattern can also generate speckle patterns as long as it introduces a random phase term at each of the source points. For example, in Fig.7 it is shown how the diffraction pattern produced by a square aperture becomes a speckle pattern when the range of the introduced random phase φ is augmented. Figure 7: Diffraction patterns produced by a square aperture and dif- ferent random phase ranges. (a) In this case there is no contribution by the φ term and the well-known diffraction pattern is formed. (b)-(c) As the phase range increases, the difraccion pattern loses gradually its original shape. (d) When φ’s range is maximum (0 ≤ φ ≤ 2pi) the original pattern is completely lost and a speckle pattern is formed. 9 In order to appreciate how φ’s range contribute to the formation of a speckle pattern a correlation function is introduced: C(θ) = 〈I(0◦)I(θ)〉 〈I(0◦)〉〈I(θ)〉 (2.6) where I(θ) = I(0≤φ≤θ) (2.7) is the intensity produced when a random phase that ranges from 0 to θ is added. The value of the correlation function for all the possible ranges of φ is shown in Fig.8. As the range increases the correlation function quickly decreases and when the range is at half of its maximum the correlation is below 0.5. Figure 8: Normalized correlation function C(θ) of the diffraction pattern produced by a square aperture. As the upper limit θ of the random phase increases, the resulting pattern decorrelates quickly with the original diffraction pattern. 10 2.3 Speckle statistics Due to the random nature of speckle patterns, its properties are best studied using statistical techniques. These techniques are derived from the statistical tools used to study phasors because the intensity of a speckle patterns can be seen as a sum of a large number of complex waves. In the appendix it is demonstrated that the intensity distribution on a speckle pattern has the following form PI(I) = 1 〈I〉e − I〈I〉 (2.8) where 〈I〉 represents the mean intensity in the speckle pattern and it was assumed that the speckle pattern was produced with monochromatic light and that the ran- dom phase φ had its full range of 0 to 2pi. The moments of this distribution are 〈Iq〉 = 〈I〉qq ! . (2.9) Using this equation the second moment for the intensity is 〈I2〉 = 2〈I〉2 . (2.10) In terms of the first and second moments the variance can be calculated: σ2I = 〈I2〉 − 〈I〉2 (2.11) = 2〈I〉2 − 〈I〉2 = 〈I〉2 (2.12) and taking the square root the standard deviation results σI = 〈I〉 (2.13) To characterize in a quantitative way the presence of speckle in an intensity pattern, two important quantities are used: the contrast (C) and its inverse, the signal-to-noise ratio (S/N). These quantities are defined as 11 C = σI 〈I〉 S/N = 1 C = 〈I〉 σI . (2.14) Replacing in these definitions the mean intensity and the standard deviation for a speckle pattern, it is found that for fully developed speckle the constrast and the signal-to-noise ratio are equal to unity: C = 1 and S/N = 1 (2.15) 12 Chapter 3 Speckle-based spectroscopy This chapter presents the speckle-based spectroscopy method in which light’s wave- length is measured using speckle patterns. This method was first developed by Brandon Redding and Hui Cao in [1]. They implemented it using a multimode optical fiber achieving a low spectral resolution (∼ 10−2 nm). Section 3.1 explains the basis of the speckle-based spectroscopy method. Then, the calibration proce- dure is described in the section 3.2. Finally, section 3.3 presents the optimization algorithm used to improve the precision of the resolved spectra. 3.1 Wavelength measurement Throughout history different methods to measure light’s wavelength have been de- veloped. Among the first ones are those which relate the spatial dependence of light intensity with wavelength information. The classic example of these methods is the use of a prism to produce intensity patterns whose position on a screen depends on the wavelength of the light source (Fig.9). To ensure reliability of the method, it is required that the produced intensity patterns are in one-to-one correspondence with light wavelength. As long as this requirement is fulfilled, the intensity patterns can adopt any shape. This allows the use of speckle patterns. 13 Figure 9: Light’s wavelength measurement using a prism. Depending on the wavelength, an intensity pattern will be formed in a specific position on the screen. In chapter 2 the equation 2.4 described the field produced by a speckle pattern. There it was shown that the uniformly distributed random phase φ was a function of position r and it was assumed that the light source was monochromatic, i.e. λ = λ0. When λ is allowed to change, the random phase also becomes a function of wavelength φ(r,λ) and the speckle pattern now gradually changes as λ does (Fig.10). Figure 10: Speckle patterns simulated in MATLAB 2015b for different wavelength values. Since the random phase φ is also a function of λ, a different pattern is formed in each case. For a sufficiently large change in lambda (δλ), each speckle pattern will be dif- ferent from the others. The speckle-based spectroscopy takes advantage of this to 14 stablish the required one-to-one correspondence, in this case between wavelengths and speckle patterns. The quantity δλ defines the spectral resolution since it represents the minimum change in wavelength needed to produce a different speckle pattern. In [1] a spectral correlation function, C(∆λ), is defined in order to measure how distinguishable two speckle pattern are when they only differ in a small change in wavelength (∆λ): C(∆λ) = 〈I(λ)I(λ+∆λ)〉 〈I(λ)〉〈I(λ+∆λ)〉 − 1 . (3.1) Using this function δλ is defined as twice the value of ∆λ that makes the spectral correlation function be 50% of it maximum value: δλ = 2∆λ1/2 ; C(∆λ1/2) = C(0) 2 . (3.2) Finally, recording speckle patterns formed by different light’s wavelengths pro- duces a database of “fingerprints” which can be used to identify by comparison the wavelength of a unknown light source. In Fig.11 the method is summarized in three steps. Figure 11: The speckle-based spectroscopy method takes advantage of the fact that speckle patterns act as wavelength fingerprints. Step 1: The calibration database of speckle patterns is built. Step 2: A speckle pattern is formed with a light source of unknown wavelength. Step 3: By comparison with the database the unknown wavelength is identified. 15 3.2 Spectrum reconstruction When a spectrometer is implemented using the speckle-based spectroscopy method, it needs to be calibrated before usage. The construction of the speckle pattern database corresponds to this calibration step. In the present method, the database is represented by a transmission matrix T and its construction will be explained in this section. One way of representing the intensity of a speckle pattern produced by different wavelengths is based on the following equation: I(r) = ∫ T(r,λ)S(λ)dλ (3.3) where I(r) is the intensity at a position r in the speckle pattern, T(r,λ) is a transmis- sion function and S(λ) represents the spectral flux, i.e., the intensity contribution from each different wavelength [1]. To be able to use this equation experimentally, first it needs to be discretized. For that purpose two quantities are used: the spec- tral correlation width, δλ, and spatial correlation width, δl, which is defined as the average speckle size in a speckle pattern. If I(r) is sampled at positions r1, r2, . . . , rm (Fig.12) for different light sources whose wavelength are λ1, λ2, . . . , λn, then equa- tion 3.3 can be written as  Ir1 Ir2 ... Irm  =  t11 t12 . . . t1n t21 . . . t2n ... . . . ... tm1 tm2 . . . tmn   Sλ1 Sλ2 ... Sλn  (3.4) where the values of r differ from one another: rm = rm−1 + δl (3.5) and the values of λ similarly: λn = λn−1 + δλ (3.6) 16 Figure 12: Every speckle pattern is sampled at fixed postions, marked by “X” in the figure. Each sampling position is separated from one another by δl, which is equal to the mean speckle size. This assures that each sampling point is independent of each other. The transmission matrix T , which is the discretized version of the transmission function T(r,λ), is a m × n matrix that contains all the information necessary to operate the spectrometer. In this matix, each column represents the intensity con- tribution made by a specific monochromatic light of wavelength λ. To build this matrix the first step is to record different speckle patterns produced with monochromatic light of various wavelength. In the next step, the sampling points (r) are selected depending on the quality of the speckle. Finally, the intensity value at each position (Ir) is used to fill up the transmission matrix column by column. Once it is built, it can be used to reconstruct the spectral composition of an input speckle pattern. The spectral composition is represented by the spectral vector S and it is easily obtained from equation 3.4 as S = T−1I (3.7) where the matrix T−1 is the inverse, or more specifically, the left inverse of the transmission matrix. 17 There are two approaches to obatain the matrix T−1. The first one consists in making the number of rows and columns of T equal (m = n) and then to calculate the inverse in the usual way. This can be easily done by selecting an appropiate number of sampling points. The other one consists in calculating the left pseudoin- verse (T ′) of the transmission matrix, since in general the number of sampling points and the number of sampled wavelengths are not the same and the inverse does not always exist. From the two approaches described above the second one is prefered because the use of more sampling points improves the precision of the calculated spectral vector S, so from here on the term T−1 in equation 3.7 will represent the left pseudoinverse T ′. One issue when calculating the spectral composition is that despite the number of sampling points used, the matrix T ′ will not reproduce S correctly due to the presence of experimental noise. To improve its predictability a truncation method is proposed in [3]. This method consists in a singular value decomposition (SVD) of the original transmission matrix prior its inversion. SVD expresses T as the product of three matrices: Tm×n = Um×mDm×nV Tn×n (3.8) where U and V are two orthonormal matrices and D is a diagonal matrix whose elements are known as the “singular values”. Using the SVD it is possible to invert T with the following equation: T ′ = V D′UT . (3.9) Here, D′ is the psudoinverse of the diagonal matrixD and it is obtained by replacing its diagonal elements by their reciprocal. The small values in the diagonal are the most affected by experimental noise but they do not contribute significantly to the matrix T . However, they do contribute to D′ because the reciprocal of small diagonal values become big numbers. To avoid the noise amplification, a truncation step is taken before calculating D′. Only the values of D that are above a threshold are used to calculate the elements of D′. The new matrix, Dtrunc, is then used in 18 equation 3.9 to obtain an improved matrix T ′: T ′ = V D′truncUT . (3.10) Finally, although direct multiplication of the last T ′ and I would now recover S from an input signal, it is possible to improve the reconstructed spectrum when the emphasis is in the precision. This is achieved using a minimization algorithm [3] and will be explained in the next section. 3.3 Measurement optimization There are two ways in which a spectrometer operates depending on the application. When the priority is a fast detection process it is enough to use equation 3.10. On the other hand, when the priority is in the precision it is affordable to expend time in an optimization process. The problem of improving the precision of the spectral vector can be seen as a minimization problem in the following manner. After using T ′ on an input speckle pattern, the calculated spectral vector, here represented as S′, acts as an initial guess of the real S. To measure how good this first guess is, the following quantity is defined: E = ||I − TS||2 (3.11) where || · || represents the Euclidean matrix norm defined as the largest singular value (σmax) of a given matrix, ||A|| = σmax(A) . (3.12) As E approaches to zero, S′ becomes a better guess of S, so minimizing E becomes the same as improving the precision of the reconstructed spectral composition. The minimization of E is performed using a Monte Carlo Energy Minimization Algorithm. In the first step a new guess, S′′, is built by multiplying all the entries 19 of the initial guess S′ by random numbers that are uniformly distributed between 0.5 and 2.0. Then, the “energy difference” is calculated as follows: ∆E = ||I − TS′||2 − ||I − TS′′||2 (3.13) In the last step the probabily exp(−∆E/T ) is calculated and used to evaluate if the new guess is kept (S′ = S′′). Here T is the temperature of the fictitious system and it starts at an initial temperature T0. In each iteration step the temperature is reduced by ∆T until it reaches a final temperature Tf (T0 > Tf ). The algorithm stops when the calculated “energy” is bellow a threshold or when the temperature reaches Tf . The choice of optimum values for T0, ∆T , Tf , and the energy threshold varies with each transmission matrix, so they are selected by trial and error until the desired performance is achieved. After a few cycles of this algorithm the resulting spectral vector S′ reproduces with much better precision the spectral composition of the input speckle pattern in comparison with the S obtained by just using the inverted transmission matrix T ′. 20 Chapter 4 Results The basic setup of the speckle-based spectroscopy method is composed of three sections: a light source, a speckle pattern generator and a detection device. The characteristics of the light source, e.g., spectrum range and coeherence, depend entirely on the selected speckle pattern generator and the detection device. As for the speckle pattern generator, an optical fiber has been originally proposed [1, 3, 4]. In this chapter an alternative implementation using a liquid crystal display (SLM) is proposed. The speckle patterns generated are then compared with the ones obtained with an optical fiber and finally a transmission matrix T ′ is built using three light sources of different wavelength in order to test the new implementation. 4.1 Method implementation In chapter 2 it was shown that equation 2.4 reproduces the speckle pattern gener- ated by illuminating a rough surface. This system can be simulated with the use of a liquid crystal display (LCD) that acts as a SLM. One way of representing this device is as an aperture composed of an array of pixels (Fig.13). Each of these pixels interacts with light passing through it allowing a modulation in polarization and phase as a function of the gray level [14, 15]. Projecting on the LCD an image composed of pixels with random gray levels confer to passing light a different random phase term in each point of the screen. The gray level scale of 0 to 255 permits a modulation that depends on the input 21 light’s polarization. Since a bigger range in the allowed values of the random phase helps to the speckle formation (Ch.2 Fig.7), the full grayscale is used. Figure 13: The LCD is represented as an aperture composed of an array of pixels. Each pixel can project a color that ranges in the grayscale color from 0 to 255. Projecting a random configuration of gray levels simulates a rough surface. The implementation of the speckle-based spectroscopy method proposed in this work is represented in Fig.14. Laser light is used as the light source due to its coherence length. It is followed by a polarizer (P ) that helps to control the angle at which light beams arrive to the LCD’s screen. In order to take advantage of all the display projecting area, a lens (L1) is placed before the LCD. After light passes through the LCD, a speckle pattern is recorded in a CCD camera with the aid of a second lens (L2). In Fig.15 a speckle pattern recorded with our implementation is compared with a speckle pattern produced with the multimode optical fiber implementation. The LCD used in this work permitted a range of approximately 0 to pi/2 for the random phase when the pixels have random values in the full grayscale. On the other hand, for a multimode optical fiber, the range of the random phase is determined by the fiber length, easily reaching the full 0 to 2pi range. 22 Figure 14: Implementation of the speckle-based spectroscopy method using a LCD. Laser light first pass through a polarizer (P ), then the spot is enlarged with a lens (L1) to fully utilize the projecting area of the LCD. After the speckle pattern is formed, it is focused with a second lens (L2) in a CCD camera. Figure 15: Comparison of a speckle pattern produced with a LCD (left) and a speckle pattern produced with a multimode optical fiber (right). Since the range of the random phase is determined by the grayscale (0 to 255), the speckle pattern produced with the LCD maintains some characteristics of the diffraction pattern of a square aperture. On the other hand, the speckle pattern produced with an optical fiber has a random phase that ranges from 0 to 2pi. 23 4.2 Calibration To evaluate if the speckle pattern produced by the LCD behaves properly, the nor- malized experimental intensity distribution is plotted against the theoretical proba- bility distribution P(I) corresponding to a speckle pattern (Fig.16). The disagreet- ment found for lower intensities is a consequence of the camera sensibility. During the measurements, even when no light was projected on the CCD camera, small fluctuations still appeared, so pixels with very small intensity values were the more affected by noise. Nonetheless, the recorded pattern had a contrast of 0.92 and a signal-to-noise ratio of 1.09 indicating that there were truly speckle patterns. Figure 16: Intensity distribution of a speckle pattern generated with the LCD. The disagreement for small intensities is due to the sensibility of the CCD camera since pixels that should have had zero value fluctuated in the presence of a light. After proving that the diffraction patterns produced by the LCD almost behaves as full developed speckle patterns, the transmission matrix was built. For this purpose the available laser sources in our laboratory were used (Fig.17). Light of three different wavelengths produced speckle patterns that were recorded in images of 600x600 pixels. Due to the small spectral composition, only nine pixels were 24 selected as sampling points. These points were at coordinates (100,100), (100,300), (100,500), (300,100), and so on. Figure 17: Speckle patterns used to build the transmission matrix. The implementation was tested using only three different laser light sources available in our laboratory. Using the images in Fig.17 the following transmission matrix was obtained: T =  0.0784 0.0627 0.0235 0.0627 0.1137 0.0549 0.0275 0.0471 0.0471 0.2980 0.1647 0.0471 0.9333 0.9922 1.0000 0.0863 0.5922 0.0549 0.0824 0.0980 0.0510 0.0784 0.1529 0.1059 0.0980 0.0549 0.0235  Since T is not a square matrix, it was possible only to obtain its left pseudoin- verse. In this case, the truncation step was unnecessary, because all the entries in the diagonal matrix D were non-vanishing. The calculated pseudoinverse was (only two decimals shown): T ′ =  0.74 0.01 −0.25 3.47 −0.12 −0.87 0.39 −0.44 1.05 0.00 0.18 0.04 −0.23 −0.13 1.87 0.08 0.21 −0.08 −0.67 −0.14 0.25 −3.01 1.22 −1.06 −0.40 0.30 −0.89  25 4.3 Spectral composition reconstruction Once the left pseudoinverse matrix T ′ was available, the spectrometer was ready to reconstruct the spectral composition of input samples. This was tested using three speckle patterns produced with the same light sources used to built the transmission matrix (Fig.18). Figure 18: Speckle patterns recorded with the CCD camera. These patterns were used to test the T ′ matrix. The input samples were generated with monochromatic light, so the recon- structed spectral composition vectors were expected to be: Sblue =  1.0000 0.0000 0.0000  Sgreen =  0.0000 1.0000 0.0000  Sred =  0.0000 0.0000 1.0000  The speckle patterns were sampled at the same positions used in the calibration process and the following intensity vectors were obtained: Iblue =  0.0235 0.1098 0.0353 0.1373 1.0000 0.0471 0.0314 0.0471 0.0275  Igreen =  0.0039 0.0235 0.0235 0.3333 0.9882 0.1647 0.0314 0.0235 0.0431  Ired =  0.0510 0.2000 0.0863 0.2706 0.9961 0.1529 0.1176 0.0510 0.0235  26 After multiplying these vectors by T ′ the spectral composition S of each input was recovered. However, they did not reproduce the true spectral composition due to the deficit in the wavelength sampling and the vibrational noise of the optical elements: Sblue =  0.7127 0.0000 0.3461  Sgreen =  0.0000 0.1135 0.9399  Sred =  0.1454 0.1531 0.7532  To improve the precision of the recovered S vectors, the optimization process with the energy minimization algorithm was performed with 10 iterations and a temperature that varied from T0 = 10 to Tf = 1 with ∆T = 1. The optimized spectral composition vectors were: Sblue =  0.9483 0.0000 0.1165  Sgreen =  0.0000 0.7394 0.2686  Sred =  0.0384 0.0953 0.8664  After the optimization process, the precision of the reconstructed spectral com- position vectors was significantly improved. These results are summarized in Fig.19. 27 Figure 19: Reconstruction of the spectral composition of the sampled speckle patterns. The results before and after the optimization algorithm are shown in the left and right side respectively. In each case the white bar represents the expected value for the spectral composition. 28 Chapter 5 Conclusions The relation between speckle patterns and wavelength is exploited in the speckle- based spectroscopy. The speckle patterns can be produced in several ways, being the ilumination of a rough surface the most common technique. In this last case, the roughness of the surface confers to the light reflected an extra amount of optical path which translates into an extra phase term. In principle, the added phase could be calculated if the exact topology of the surface were known, however doing this would be really impractical. For this reason, the phase term is treated as a random variable uniformly distributed within a certain range determined by the experimen- tal conditions and is better described with statistical tools. The effect of adding random phase terms can be simulated using a LCD. This device acts as a SLM that produces a modulation in polarization and phase depend- ing on the graylevel of the projected image in the screen. When an image that has in each pixel a random level of gray is projected, the diffraction pattern produced by a square aperture becomes a speckle pattern. Before using the LCD in the implementation, it was necessary to confirm that the simulated speckle pattern behaved as a truly one by ploting its distribution. Despite the fact that small intensity values were affected by noise due to the CCD camera sensibility, the speckle patterns produced with an LCD resembled true speckle pat- terns.To calibrate the spectrometer three lasers of different wavelength were used and nine sampling points were selected in each speckle pattern. This produced a 29 9 × 3 transmission matrix from which it was possible to find its left pseudoinverse T ′. Then, to test the performance of T ′ three sample speckle patterns generated with monochromatic light of the same wavelength of the laser light used to calibrate the method. The recovered vectors S by simple matrix multiplication of T ′ and I did not reproduce the original spectral composition of each sample and they were optimized with the energy minimization algorithm. As stated by the authors who developed the speckle-based spectroscopy method [1], the major limitation is that speckle patterns do not only depend on the wave- length of the employed light, but also on the exact manner in which the random phases are introduced. To be able to use the T ′ matrix, it has to be assured that the input speckle patterns were produced in the same way that the speckle patterns for the calibration were. In the case of the original implementation was speckle patterns are produced with a multimode optical fiber it was necessary to make sure that the spatial disposition of the fiber remains the same during the calibration and usage of the spectrometer. In [4] this issue was addressed by fixing the optical fiber to ensure minimal vari- ations in the spatial disposition, but this solution limits its possible applications. In this work the optical fiber was replaced by a LCD. In this implementation the random phase now depends only on the image projected in the display, making it easier to reproduce the speckle patterns generated during the calibration process. However, its usage has only been tested in a simple manner. The advantage of using an optical fiber is the arbitrary precision that in theory could be achieved changing the length of the fiber. For the LCD implementation the precision has not yet been calculated because it required the use of a much greater number of wavelength samples that were not available during the development of this work. Obtaining the precision allowed by the LCD will be a necessary step before aplying this implementation. 30 Chapter 6 Bibliography [1] Redding B, Cao H. Using a multimode fiber as a high-resolution, low-loss spectrometer. Optics letters. 2012;37(16):3384–3386. [2] Wan NH, Meng F, Schro¨der T, Shiue RJ, Chen EH, Englund D. High-resolution optical spectroscopy using multimode interference in a compact tapered fibre. Nature communications. 2015;6. [3] Redding B, Popoff SM, Cao H. All-fiber spectrometer based on speckle pattern reconstruction. Optics express. 2013;21(5):6584–6600. [4] Redding B, Alam M, Seifert M, Cao H. High-resolution and broadband all-fiber spectrometers. Optica. 2014;1(3):175–180. [5] David JJ. Classical electrodynamics. Wiley Eastern Limited; 1998. [6] Kipnis N. History of the Principle of Interference of Light. vol. 5. Birkha¨user; 2012. [7] Hecht E, Zajac A. Optics. Addison-Wesley; 2001. [8] Gasco´n F, Salazar F. A simple method to simulate diffraction and speckle patterns with a PC. Optik-International Journal for Light and Electron Optics. 2006;117(2):49–57. [9] Dainty JC. Laser Speckle and Related Phenomena. Springer; 1976. [10] Goodman JW. Some fundamental properties of speckle*. JOSA. 1976;66(11):1145–1150. 31 [11] Duncan DD, Kirkpatrick SJ. Algorithms for simulation of speckle (laser and otherwise). In: Biomedical Optics (BiOS) 2008. International Society for Optics and Photonics; 2008. p. 685505–685505. [12] Duncan DD, Kirkpatrick SJ. The copula: a tool for simulating speckle dynam- ics. JOSA A. 2008;25(1):231–237. [13] Hamarova´ I, Horva´th P, Sˇmı´d P, Hrabovsky` M. Computer simulation of the speckle field propagation. In: 17th Slovak-Czech-Polish Optical Conference on Wave and Quantum Aspects of Contemporary Optics. International Society for Optics and Photonics; 2010. p. 77460M–77460M. [14] Moreno I, Velsquez P, Fernndez-Pousa CR, Snchez-Lpez MM, Mateos F. Jones matrix method for predicting and optimizing the optical modulation properties of a liquid-crystal display. Journal of Applied Physics. 2003;94(6). [15] Funamizu H, Uozumi J. Generation of fractal speckles by means of a spatial light modulator. Optics express. 2007;15(12):7415–7422. [16] Goodman JW. Speckle Phenomena in Optics: Theory and Applications. vol. 3; 2006. 32 Appendix A Statistics of speckle patterns Some statistical tools developed to study properties of speckle patterns are presented in this appendix. Here, the probability distribution for the intensity in a speckle pattern and the expressions for the contrast and the signal to noise ratio used in sec- tion 2.3 are deduced following step by step the treatment made by Joseph Goodman in [16]. A.1 Random phasors statistics First, let us consider the sum of N random phasors: A = Aejθ = 1√ N N∑ n=1 an = 1√ N N∑ n=1 ane jφn where A is the resultant phasor with magnitude A and phase θ and an is the nth component of the sum with magnitude an and phase φn. From this equation the real and imaginary parts of A can be expressed as: R = Re{A} = 1√ N N∑ n=1 an cosφn I = Im{A} = 1√ N N∑ n=1 an sinφn 33 Before calculating their statistical properties, two assumptions are made about the magnitude and phase of each of the n phasor components of the sum: • The magnitude of every phasor an is a random variable statistically inde- pendent of its corresponding phase φn. Furthermore, it is also statistically independent of the magnitude of other phasors am. • The phase φn of each phasor is uniformly distributed between −pi and pi. These assumptions permit to obtain easily the expected values for the real and imaginary part, E(R) = 〈R〉 = 〈 1√ N N∑ n=1 an cosφn〉 = 1√ N N∑ n=1 〈an〉〈cosφn〉 = 0 E(I) = 〈I〉 = 〈 1√ N N∑ n=1 an sinφn〉 = 1√ N N∑ n=1 〈an〉〈sinφn〉 = 0 where the following property for the expected value of two indenpendent random variables was used: E(XY ) = E(X)E(Y ) . Since the first moments are zero, the variances are equal to the second moments: σ2R = E(R 2) = 〈 1√ N N∑ n=1 an cosφn · 1√ N N∑ m=1 am cosφm〉 = 1 N N∑ n=1 N∑ m=1 〈anam cosφn cosφm〉 = 1 N N∑ n=1 N∑ m=1 〈anam〉〈cosφn cosφm〉 for n 6= m: 〈cosφn cosφm〉 = 〈cosφn〉〈cosφm〉 = 0 34 for n = m: 〈cosφn cosφm〉 = 〈cos2 φn〉 = 1 2pi ∫ pi −pi cos2 θdθ = 1 2pi ∫ pi −pi 1 2 (1 + cos 2θ)dθ = 1 2 then, σ2R = 1 N N∑ n=1 〈a2n〉 2 . In a similar way an expression for σ2I is obtained: σ2I = 1 N N∑ n=1 〈a2n〉 2 . The correlation of these two variables is: ΓR,I = E(RI) = 1 N N∑ n=1 N∑ m=1 〈anam〉〈cosφn sinφm〉 for n 6= m: 〈cosφn sinφm〉 = 〈cosφn〉〈sinφm〉 = 0 for n = m: 〈cosφn sinφm〉 = 〈cosφn sinφn〉 = 0 so ΓR,I = 0 showing that they are two uncorrelated random variables. 35 When the number of random phasors N tends to infinity, the central limit the- orem gives: p(x) = 1√ 2piσx e −(x−〈x〉√ 2σx ) and for two independent random variables, the joint probability density function is: P (x, y) = P (x) · P (y) . Since σ2R = σ 2 I = σ 2 for R and I, the joint probability is: PR,I(R, I) = PR(R) · PI(I) = 1 2piσ2 e−( R2+I2 2σ2 ) . The joint probability density function of A and φ is related to that of R and I through: PA,θ(A, θ) = PR,I(R, I)||J || where ||J || represents the Jacobian: ||J || = ∥∥∥∥∥∥ ∂R/∂A ∂R/∂θ ∂I/∂A ∂I/∂θ ∥∥∥∥∥∥ . Using the following relations for R, I, A and θ, A = √ R2 + I2 θ = tan−1 (I/R) R = A cos θ I = A sin θ the Jacobian gives: ||J || = ∥∥∥∥∥∥cos θ −A sin θsin θ A cos θ ∥∥∥∥∥∥ = A 36 Then, PA,θ(A, θ) = A 2piσ2 e− A2 2σ2 ; A ≥ 0 , −pi ≤ θ ≤ pi The next step is to find the marginal statistics of A and θ alone: PA(A) = ∫ pi −pi PA,θ(A, θ)dθ = ∫ pi −pi A 2piσ2 e− A2 2σ2 dθ = A σ2 e− A2 2σ2 This is known as the Rayleigh density distribution: PA(A) = A σ2 e− A2 2σ2 , A ≥ 0 Integrating in A gives: Pθ(θ) = ∫ +∞ 0 A 2piσ2 e− A2 2σ2 dA = − 1 2pi ∫ +∞ 0 − A σ2 e− A2 2σ2 dA = 1 2pi the marginal of θ: Pθ(θ) = 1 2pi ; −pi ≤ θ ≤ pi . It is seen that: PA,θ(A, θ) = PA(A) · Pθ(θ) which shows that A and θ are statistically independent. Finally, the moments of the amplitude are: 37 〈Aq〉 = ∫ +∞ 0 AqPA(A)dA = ∫ +∞ 0 Aq+1 σ2 e− A2 2σ2 dA . To solve this integral the gamma function is used. This function is defined as: Γ(z) = ∫ +∞ 0 tz−1e−tdt = 2 ∫ +∞ 0 t2z−1e−t 2 dt . Using the gamma function the expression for the amplitude moments is found to be 〈Aq〉 = 2q/2σqΓ(1 + q/2) . With this equation the moments of A are calulated. The first moment is: 〈A〉 = √ pi 2 σ〈A2〉 = 2σ2 and the second is: σ2A = (2− pi 2 )σ2 ≈ 0.43σ2 A.2 Intensity and phase statistics In this section the results for the probability density function and moments of the amplitude A are used to obtain the corresponding probability density function of the intensity I in a speckle pattern. Let v be a random variable that is related to a random variable u through a monotonic transformation v = f(u). Then, two probability density functions will be related through the following equation: Pv(v) = Pu(f −1(v))|du dv | . Replacing with v = I, u = A and I = f(A) = A2 this equation gives 38 PI(I) = 1 2 √ I PA( √ I) . In the case of large N it was found that the probability density function for the amplitude was PA(A) = A σ2 e− A2 2σ2 . Evaluating it with √ I allows to find the desired expression for the probability density function of I: PI(I) = 1 2σ2 e− I 2σ2 ; I ≥ 0 For this distribution the moments are expressed as: 〈Iq〉 = (2σ2)qq ! . The expected value of the intensity is: 〈I〉 = 2σ2, wich can be replaced in the equation for the moments and in the probability density function to give 〈Iq〉 = 〈I〉qq ! and PI(I) = 1 〈I〉e − I〈I〉 . 39