automated analysis of the transverse modes of a laser beam using a

33
LASER INTERFEROMETER GRAVITATIONAL WAVE OBSERVATORY - LIGO - CALIFORNIA INSTITUTE OF TECHNOLOGY MASSACHUSETTS INSTITUTE OF TECHNOLOGY Technical Note LIGO-T070266-00-I Date: 2007/10/29 Automated Analysis of the Transverse Modes of a Laser Beam Using a Non-Degenerate Fabry-Perot Cavity Joshua Weiner Mentors: Alan Weinstein and Rana Adhikari Summer Undergraduate Research Fellowship Final Report California Institute of Technology California Institute of Technology Massachusetts Institute of Technology LIGO Project, MS 18-34 LIGO Project, Room NW17-161 Pasadena, CA 91125 Cambridge, MA 02139 Phone (626) 395-2129 Phone (617) 253-4824 Fax (626) 304-9834 Fax (617) 253-7014 E-mail: [email protected] E-mail: [email protected] LIGO Hanford Observatory LIGO Livingston Observatory Route 10, Mile Marker 2 19100 LIGO Lane Richland, WA 99352 Livingston, LA 70754 Phone (509) 372-8106 Phone (225) 686-3100 Fax (509) 372-8137 Fax (225) 686-7189 E-mail: [email protected] E-mail: [email protected] http://www.ligo.caltech.edu/

Upload: others

Post on 03-Feb-2022

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LASER INTERFEROMETER GRAVITATIONAL WAVE OBSERVATORY- LIGO -

CALIFORNIA INSTITUTE OF TECHNOLOGYMASSACHUSETTS INSTITUTE OF TECHNOLOGY

Technical Note LIGO-T070266-00-I Date: 2007/10/29

Automated Analysis of the TransverseModes of a Laser Beam Using a

Non-Degenerate Fabry-Perot Cavity

Joshua WeinerMentors: Alan Weinstein and Rana Adhikari

Summer Undergraduate Research Fellowship Final ReportCalifornia Institute of Technology

California Institute of Technology Massachusetts Institute of TechnologyLIGO Project, MS 18-34 LIGO Project, Room NW17-161

Pasadena, CA 91125 Cambridge, MA 02139Phone (626) 395-2129 Phone (617) 253-4824

Fax (626) 304-9834 Fax (617) 253-7014E-mail: [email protected] E-mail: [email protected]

LIGO Hanford Observatory LIGO Livingston ObservatoryRoute 10, Mile Marker 2 19100 LIGO Lane

Richland, WA 99352 Livingston, LA 70754Phone (509) 372-8106 Phone (225) 686-3100

Fax (509) 372-8137 Fax (225) 686-7189E-mail: [email protected] E-mail: [email protected]

http://www.ligo.caltech.edu/

Page 2: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

Abstract

The LIGO interferometers can be sensitive to gravitational waves once all non-fundamental noise sources have been made negligible. One such non-fundamental noisesource is unwanted “junk” laser light at the gravitational wave readout port of theinterferometer. The next generation of interferometric gravitational wave detectorsbased on the current LIGO detectors, called Advanced LIGO, will include an opticalmode-cleaning cavity known as the Output Mode Cleaner (OMC) that filters out the“junk” light while transmitting the rest of the light to the gravitational wave readoutport. A similar OMC is already being tested at the 40 meter prototype interferometer.An automated mode-scanning process to analyze the content of the light exiting the 40meter lab’s OMC, which will be useful for tuning the OMC alignment and quantifyingreadout noise, was developed with the aid of digital image processing.

1 Background and Motivation

LIGO, the Laser Interferometer Gravitational-wave Observatory, is a set of detectors basedon Michelson interferometers meant to detect gravitational waves. To detect gravitationalwaves (GW’s), ripples in spacetime created by the acceleration of masses (especially astro-nomical objects such as binary neutron stars), LIGO must be able to detect a strain on theorder of 10−21 or smaller [1]. This may only be accomplished once all non-fundamental noisesources are made negligible.

The output mode cleaner optical cavity (OMC) is one piece of equipment which will be usedin future improvements to the LIGO detectors. Plans are currently underway to design anOMC which will be used in the next generation of interferometric GW detectors, known asAdvanced LIGO. The Output Mode Cleaner is a four-mirror “bowtie” Fabry-Perot cavitylocated at the AS port of the 40m interferometer. It receives light from the interferometer viathe output mode-matching telescope (OMMT). Figure 1 is a sketch of the OMC and OMMTlayout. The 40 meter interferometer contains numerous other resonant optical cavities,including a pre-mode cleaner (PMC) whose transmitted light was also studied in this project.

GW’s cause the resonant light in the lowest-order transverse electromagnetic mode (TEM)in the interferometer arms to exit to the asymmetric port. The OMC must reject the“junk” light that does not emanate from the interferometer arms, excluding the higher-ordertransverse electromagnetic modes (HOM’s) and other “junk” light resonant in the powerrecycling cavity but not the interferometer arms, as well as excluding the 33 MHz and 166MHz controls sidebands [3]. At the same time, the OMC must transmit the light which isuseful for detecting GW’s.

Since the content of the light on its way to the readout port of the interferometer can bestrictly controlled by the OMC, changing the length of the cavity to let through differentTEM’s allows analysis of the components that make up the beam–how much of the light is“junk” and how much of the light is useful for detecting gravitational waves. The ability

page 1

Page 3: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

Figure 1: The light exits from the interferometer arms’ vertex at the top and goes throughthe OMMT and then into the four-mirror OMC at the bottom.[2]

to obtain this information through automated mode scanning can make noise analysis andtuning of the OMC alignment much easier. The goal of this project is to create such anautomated method of mode scanning.

2 Mode-scanning System

In order to automate the process of mode scanning, an interface to access video data fromthe AS (asymmetric) port camera was created in addition to a set of Matlab and Linux shellscripts to change the length of the OMC by varying the voltage applied to the piezoelectrictransducer attached to one of its mirrors, analyze the individual images taken from the videodata, and save and display the acquired data.

2.1 Frame Grabber

An essential part of the video camera interface is the frame grabber. A frame grabber is anelectronic device which when attached to a computer facilitates digitization and saving ofincoming video signals. I installed Integral Technologies’ FlashBus Spectrim Lite PCI framegrabber in one of the lab’s computers which may be accessed remotely. Once an imagefrom an analog video source is in a digital form, it can be analyzed and manipulated insoftware. The analog video signals come from cameras mounted at specific locations aroundthe interferometer. Figure 2 is a schematic showing the method by which a video signal from

page 2

Page 4: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

Figure 2: The video signals go from the cameras around the interferometer to the videoswitch, and then to the monitors in the control room. The frame grabber may monitor onlyone video signal at a time, but it can be changed using the software interface for the videoswitch.

an interferometer camera may be accessed by the frame grabber.

The software switches which control the pairing between cameras and the frame grabber canbe controlled in software, so some simple scripts were created to make this process easier.Also, the performance of the frame grabber for capturing low- to high-framerate video wasevaluated. Most of the software which was used to capture images in rapid succession withthe goal of saving digital videos of the video signals failed in all configurations except verylow framerates (≈ 3−5 frames/sec). This was likely due to poor performance of the softwaresupplied by the manufacturer to control the frame grabber under the Linux operating systemand not the video switch, since full-framerate video is displayed on the lab’s monitors andhigh-framerate video can be viewed under Linux using the frame grabber, but the frameratelimitation occurs only when trying to save images or videos. Additionally, the resolution andbit-depth of the images was limited by the frame grabber to 640 pixels wide by 480 pixelstall, with a bit depth of 24 bits per pixel (8 bits each in red, green, and blue) for color images,and 8 bits per pixel for grayscale images. The limitation on bit depth means that monitoringlow-power beams is difficult because the video signal may not be much higher than noise. Tomake up for this limitation, some of the cameras were changed to use their built-in automaticgain thereby presenting a more easily discernible signal to the frame grabber.

2.2 Mode Scanning

“Mode scanning” refers to the process of systematically changing the length of an opticalFabry-Perot cavity while allowing a beam to enter the cavity and measuring the power of thebeam transmitted through the cavity. Changing the path length for light inside an opticalcavity allows different HOM’s to resonate within and propagate through the cavity by usingthe differences in the Gouy phase of the TEM’s. The Gouy phase of a TEM is defined byη(z)(n+m+ 1) where η(z) = tan−1( zλ

πw20) [4], z is the distance along the line of propagation

from the place in the cavity where the beam has the smallest waist w0, λ is the wavelength ofthe light, and m and n represent the order of the Hermite-Gaussian (HG) mode. In addition

page 3

Page 5: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

to the phase advance of a plane wave propagating through a distance z (kz, where k = 2πλ

),a beam confined to and resonant in an optical cavity experiences a Gouy phase shift whichdepends on the transverse mode of the beam, which is evident from the mathematics of HGbeams (see 4.2). One simple interpretation of the parameters n and m is that they are thenumber of nodes, or dark fringes in the x and y directions, respectively, of the intensityprofile of a HG mode. If the total phase of a HG mode after a round-trip inside the cavity isequal to an even number times π, then the mode will resonate within the cavity since afterone round-trip through the cavity its beam profile will match up exactly with the enteringbeam. In the light exiting through the AS port at the 40m interferometer, the OMC isable to show TEM’s through order m + n = 4, as well as showing the presence of the 33MHz sidebands, which each have their own TEM’s for each order. Figure 3 illustrates theeffect of changing the length of the OMC cavity and shows the presence of the TEM’s andsidebands. Each spike in transmission corresponds to a different resonant transverse modeof the carrier or 33 MHz sidebands. The highest peaks are TEM00, and the order m + n ofthe modes increases by 1 for every carrier peak to the left of the TEM00 carrier peak. Someof the HOM transmission peaks exhibit a splitting of the degeneracy between n and m, dueto slight asymmetries in the mirrors between vertical and horizontal directions.

The automated mode scanning process relies on many different pieces of software whichare linked together though Matlab scripts. The scripts must communicate with the digitalcontrols systems for the OMC, the frame grabber, and interferometer data channels. Figure4 describes the sequence of steps of a mode scan. A scan like the one in 3 usually takesaround 3-5 minutes, but the time varies based on the step size specified by the user. Asmaller step size can make the scan take longer since more snapshots of the video screen willbe captured when the cavity is near resonance of an HOM. Depending on the step size, thenumber of images saved can vary between about 5 and 20.

When the cavity is near resonance and the PZT actuation enables locking on the mode, thechange is PZT voltage is about that of 1 or 2 steps. The script need not reset the voltageto its value before the lock; instead, it just proceeds since the transmission data and voltagedata are continuously recorded with high sample rates (16384 Hz), and are available fordownload through the 40m lab DAQ system.

2.3 Image Filtering

An important aspect of the mode scanning process is the automatic identification of TEM’s.In the past, this has been accomplished either by eye, observing the mode patterns of thetransmitted light on a monitor as the scan progresses, or by inference, when the analyst hasprior knowledge of the cavity and makes educated guesses as to which intensity peaks in alength scan correspond to certain HOM’s based on the relative sizes and locations of the peakson a time-versus-transmission or length-versus-transmission plot. Both of these methodsare inconvenient and may be prone to error as well as being time-consuming, especially ifmeasurements need to be repeated many times.

page 4

Page 6: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

−0.5 0 0.5 1 1.5 2 2.5

101

102

103

# FSR

Tran

smitt

ed P

ower

(ADC

Cou

nts)

OMC Mode Scan

Figure 3: An example of a mode scan for the Output Mode Cleaner (OMC). The horizontalaxis is the resonant frequency of the cavity, measured in free spectral ranges (FSR’s). Thevertical axis is proportional to the power of the transmitted light. 1 FSR ≈ 630 MHz,corresponding to a change in the round-trip path length of the cavity of one wavelength(1064 nm). The peaks show that TEM’s resonate inside the cavity.

Y e s

N o I s t r a n s m i s s i o n h i g h , i n d i c a t i n g a r e s o n a n t m o d e ?

I s s c a n f i n i s h e d ?

N o

Y e sU s e r i n i t i a t e s s c a n

R e t r i e v e , s a v e , a n d d i s p l a y d a t a

P r o c e s s i m a g e s t o i d e n t i f y T E M ’ s

L o c k t h e c a v i t y o n t h e m o d e

S a v e i m a g e u s i n g f r a m e g r a b b e r

U n l o c k t h e c a v i t y

S t e p P Z T v o l t a g e f r o m c u r r e n t v o l t a g e

Figure 4: A slightly simplified model of the mode scanning script logic. The script beginsat the left, when a user initiates a mode scan.

page 5

Page 7: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

2.3.1 Projections

In order for the mode scanning software to identify transmission peaks, some quantitativerepresentation of the onscreen mode pattern image must be created. A method of quantifyingthe image which works well for the purposes of identifying Hermite-Gaussian TEM’s is thatof taking x and y projections of the luminance of the grayscale images. Since each imageis made up of discrete pixels which each have a certain intensity, it is convenient to treat adigital image as a matrix of real numbers. In other words, the x projection is a vector whoseelements are the sum of the elements of each column of a real matrix which represents theimage, and the y projection is the sum of the elements in each row of the matrix (see 4.4).This “flattening” of the image onto the x-axis or y-axis provides a vector representationof the image that allows for computer-automated identification of the number of intensitypeaks in the x and y directions. Since for HG modes the number of nodes is one less thanthe number of bright lobes, the n and m indices of a TEM can easily be found by subtractingone from the number of peaks found in the x and y directions after projections onto boththose axes are performed. Figure 5 shows the x and y projections of images from the OMC.

Figure 5: The x and y projections of TEM00 from the OMC in a bright Michelson con-figuration. The vertical axes are in arbitrary units of intensity, and the horizontal axesrepresent pixel position, with the origin at the top left of the image. The difference in yprojections after the low-pass filter is applied (see Section 2.3.2) is clear. The filtered imagelacks interference effects.

page 6

Page 8: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

Figure 6: Basis images which are represented by the 2D DFT [5]. The basis images on theleft have spatial frequencies in the horizontal and vertical directions, respectively. The basisimages on the right have spatial frequency components in both the horizontal and verticaldirections.

2.3.2 Discrete Fourier Transform

Although the projection technique in Section 2.3.1 allows for identification of modes whenthe intensity of the TEM is much higher than the image noise, in some cases when the cavityis not at the length to allow maximum transmission of a TEM and the TEM’s presencein the beam is not strong, only taking a simple intensity profile in each direction may notalways identify the mode correctly, as I have experienced with images of HOM’s from thePMC. There are a couple of common reasons why this occurs: the orientation of the HOM’son the video screen are not aligned to the x and y axes (there is rotation), or there isnoise and unwanted image effects (e.g. scanlines, or etalon effects from light resonant in thefinite-thickness glass plates covering the camera CCD sensors).

Two solutions that have worked well in initial tests include increasing the effective exposuretime of the image by capturing multiple images rapidly in succession and smoothing theimage data to reduce noise. Attempts to smooth the image projection data using Matlab’sbuilt-in moving average filters were unsuccessful since they did not adequately eliminatelarge-amplitude middle- or high-frequency noise. Filtering the image before projection bymanipulating the images in a spatial frequency domain gave more consistent positive results.Applying the two-dimensional discrete Fourier transform (2D DFT) of the image’s matrixrepresentation allows useful filtering without losing relevant information about the HOMcontained in the image by decomposing the source image into a set of basis images whichoscillate across the image. Figure 6 shows some examples of these basis images. See 7 and8 in 4.5 for a definition of the 2D DFT.

The 2D DFT allows images of TEM’s to be filtered in an aggressive way that will eliminatescanlines and other high spatial frequency noise (such as interference patterns on the CCDfrom dust or interference from etalon effects of camera filters and lenses) while leaving theimportant features of the image intact. The result is that identification of HOM’s is moreconsistent.

The filtering was accomplished by applying an ideal circular low-pass filter centered at theorigin of the u and v axes to the transformed data, eliminating spatial frequencies with√u2 + v2 > 5 and preserving the amplitude and phase of the remaining spatial frequency

page 7

Page 9: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

components. The value for the cutoff was chosen based on the HOM’s which appear duringmode scanning of the OMC, making sure not to eliminate any very low spatial frequencycomponents which are crucial for representing images of TEM’s with the Hermite-Gaussianprofile. Values of the cutoff lower than 5 were found to change the images enough so thatHOM’s could be misidentified, and values any higher than 5 produced images that showedevidence of some of the noise from the original image. An inverse transform was appliedto the resulting filtered spatial frequency matrix, resulting in an image without high spatialfrequency content. An example of this filtering, applied to the TEM02 image from the OMCappears in Figure 7, and applied to the TEM00 image from the OMC in Figure 5.

2.4 Remaining Issues

Images of TEM’s which are not oriented to the camera’s horizontal and vertical axes (asshown in Figure 7) can cause problems with detection, as a simple x or y projection mayshow an intensity profile which can be mistaken for a different HOM. Since the orientationof the cavity’s mirrors don’t change appreciably during normal operation, the orientation ofthe HOM’s exiting a certain cavity will remain the same. If the orientation of the HG modesrelative to the video screen is known, then a simple solution to this problem is to manuallyspecify the degree of rotation at runtime. The mode identification programs currently requireuser specification of mode rotation to work properly, but future work will include addingautomatic orientation of the TEM image to the scripts.

Another issue with the system is that if a cavity does not have a servo which is able tolock on modes weaker than TEM00, then motion of the mirrors in the cavity may preventthe cavity from staying at the right length for the TEM to resonate as images are capturedfrom the video signal. A simple peak-finding algorithm which would seek resonance peaksduring a mode scan was tested on the OMC and PMC, but the PMC length noise preventedsuitable images from being saved by driving the PMC away from resonance before the framegrabber could save clear images.

3 Summary of Results

A frame grabber for saving video signals from the cameras that monitor 40 meter interfer-ometer was installed, configured, and tested under a variety of rapid image capture configu-rations. A set of scripts to perform mode scanning while using the frame grabber to recordstill images from video signals was developed and tested. Part of this effort included imple-menting methods to clean up the images so that assessments could be made of the contentof the images, which can be applied to many of the video feeds at the 40 meter lab.

The frame grabber setup with software was able to correctly identify HOM’s given moststill images of HOM’s at resonance in the OMC, but some problems with identifying HOM’sduring a mode scan still remain. In particular, identifying very weakly transmitted HOM’s

page 8

Page 10: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

Figure 7: A comparison of the original TEM02 image with its 2D DFT and the filtered TEM02

image with its 2D DFT. The filtered image was produced by applying an ideal low-pass filterwith a strict criterion (distance no larger than 5 pixels from the origin) to the 2D DFT ofthe original image, then performing the inverse transform on the resulting matrix. Intensityscales are arbitrary and meant for qualitative comparison.

page 9

Page 11: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

(n+m ≥ 3) is prone to failure partly because the PZT actuation servo is designed for lockingthe OMC on the TEM00 mode. Also, it is possible that the OMC may not be able to lockfor HOM resonance if the step size is larger than the range of voltages for which an HOMis resonant; it would be very difficult to determine in general if the voltage step size is toolarge to identify all the HOM’s for any cavity. If either or both of these limitations areencountered, then it may not be possible to identify which TEM is resonant in the cavityat the time the minimum transmission threshold for capturing an image using the framegrabber is exceeded because the image saved from the video camera will have too faint of anHOM pattern in it to be detected.

4 Methods

This section contains brief explanations of the nonlinearity of the OMC’s PZT, the mathe-matics of lasers in Fabry-Perot cavities, the OMC four-mirror design, the definition of imageprojection and the 2D DFT, and the Matlab scripts used for the project as of September2007.

4.1 OMC PZT Nonlinearity

One property of piezoelectrics is their nonlinear length response with changes in appliedvoltage. The response of the PZT to voltage is hysteretic, so sweeping voltage back andforth produces length changes which may be difficult to model. A simple case which may beof use is modeling the change in length of the PZT with voltage going from high to low.

I performed an OMC mode scan from the high end (≈ 230 V) of the PZT voltage rangeto the low end (≈ 30 V). Since the frequency separation of the 33 MHz sidebands to thecarrier and the Gouy phases are known for every mode that resonates in the OMC, I wasable to find precise values for the frequency separation of each transmission peak. The Gouyphases of the TEM’s were determined by

ηmn = (m+ n+ 1) arctanLλ

πw20

(1)

and then multiplying ηmn by the FSR of the cavity. For TEM’s for which the 33MHzsidebands were discernible, the frequencies of the sidebands could be calculated by simplyadding ±33MHz to the carrier frequency. Once I was able to graph the frequency separationof the HOM’s versus the voltage applied to the PZT to achieve resonance of each HOM, I fitthe set of points to a third-order polynomial, as in Kawabe et al.[6], yielding a calibrationcurve which I used to space a mode scan linearly in the frequency axis (as in Figure 3). Figure8 shows the voltage-frequency relationship, normalized to the FSR (free spectral range) ofthe cavity (630 MHz)[2]. The curve is slightly concave-down and shows the decreased lengthchange of the PZT per volt at high applied voltages.

page 10

Page 12: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

The fitted function which describes the resonant frequency of the cavity as a function ofvoltage, with 95% confidence intervals on the coefficients, is

f(V ) = c3V3 + c2V

2 + c1V + c0 (2)

c3 = (−1.178± 0.187)× 10−7

c2 = (1.274± 0.682)× 10−5

c1 = (2.113± 0.075)× 10−2

c0 = (−1.199± 0.025)

An attempt was made to use the full width at half-maximum (FWHM) of the TEM00 carrierpeaks at different values of voltage to approximate values of dx

dVfor those voltages. The

shape of the data and the inconsistencies in Matlab’s least-squares fit routines, as well asthe reliance on thermal drift to make the TEM00 carrier peaks at different values of voltage,caused this approach to be difficult and less effective than using the resonant frequencies ofthe TEM’s as a reference.

Time did not allow for this calibration to be automated as a part of the mode-scanningsoftware, but it should be possible to automate this process when the TEM’s are correlatedwith locations in the transmission versus voltage data.

4.2 Hermite-Gaussian Modes

A laser beam in free space can be approximated as a collimated plane wave: A(r)eikz.However, a beam that is confined to and resonant in an optical (Fabry-Perot) cavity has anon-trivial transverse profile. The profile can be decomposed into basis functions which formeigenmodes of the resonant cavity. A good choice of basis is the family of Hermite-Gaussians.The basis of Hermite-Gaussian transverse laser modes can be derived by assuming solutionsto the paraxial wave equation:

∇2t u(s, z)− 2ik

∂u(s, z)

∂z= 0 (3)

where s represents transverse coordinates (x, y) or (r, θ), and ∇2t refers to the Laplacian for

the choice of coordinate system. When each coordinate is treated separately in this equation,the resulting eigenfunctions of the differential equations may be expressed in terms of Hermitepolynomials and Gaussian exponential terms:

page 11

Page 13: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

20 40 60 80 100 120 140 160 180 200 220−0.015

−0.01

−0.005

0

0.005

0.01

PZT Voltage

Resid

uals

(# F

SR)

Residual Plot

50 100 150 200 250

−0.5

0

0.5

1

1.5

2

2.5

3

OMC Resonant Frequency vs. PZT Voltage

PZT Voltage

# FS

R

Figure 8: This plot shows the response of the PZT in frequency space (normalized to FSR)to the applied voltage.

page 12

Page 14: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

ψnm =

√2

2(n+m)m!n!π

1

w(z)Hn

∣∣∣∣∣√

2x

w(z)

∣∣∣∣∣Hm

∣∣∣∣∣√

2y

w(z)

∣∣∣∣∣ exp

[−(x2 + y2)

w(z)2

](4)

exp

[−ik(x2 + y2)

2R(z)

]exp (ikz) exp

[i(n+m+ 1) arctan

∣∣∣∣ zλπw20

∣∣∣∣]

where Hn and Hm are the nth- and mth-order Hermite polynomials, respectively. A morethorough treatment can be found in Siegman’s Lasers [4].

These solutions show an extra phase shift for HOM’s, known as the Gouy phase. Physically,this added phase shift corresponds to a 90◦ phase shift as the beam propagates throughthe location of its waist, and causes a greater spacing between the wavefronts of the laserbeam when it is farther away from its waist. The Gouy phase shift is present in Fabry-Perotresonant cavities, including the PMC and OMC cavities in the 40m interferometer.

4.3 Four-mirror OMC Design

The four-mirror design was chosen to reduce the density of HOM resonances, to reduce thechance of one of them accidentally overlapping the TEM00 mode in frequency. TEM’s whichhave horizontal symmetry experience an extra phase shift of π when they reflect off of flatmirrors, so they have shifted resonance frequencies from modes of the same order but withvertical symmetry. For example, a TEM01 mode would resonate at a frequency half of oneFSR higher than a TEM10 mode. This fact is relevant to the mode scanning of three-mirrorcavities, where the wide spacing of resonant frequencies for TEM’s of the same order isimportant to consider so that the apparent extra transmission peaks are not mistaken forthe presence of more HOM’s. A schematic of the OMC may be found in Figure 1.

4.4 Projection

The projections described in 2.3.1 are performed according to the operation

~Xi =H∑j=1

I(i,j) (5)

~Yj =L∑i=1

I(i,j) (6)

i = 1, 2, . . . , L

j = 1, 2, . . . , H

page 13

Page 15: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

where L is the number of pixels in the x direction, H the number of pixels in the y direction,and I(x,y) is the intensity value of the pixel at location (x, y) in the image.

4.5 Two-dimensional Discrete Fourier Transform

The 2D DFT is defined by [5]

F (u, v) =1

NM

N−1∑x=0

M−1∑y=0

f(x, y) exp(−2πi(xu/N + yv/M)) (7)

and the inverse 2D DFT is given by

f(x, y) =N−1∑x=0

M−1∑y=0

F (u, v) exp(2πi(xu/N + yv/M)) (8)

where y and x are the row and column indices of an M -by-N pixel image, respectively, u andv refer to the spatial frequency of the basis functions in the x and y directions, measured incycles/total image width or height.

In practice, these transforms can be performed by using Matlab’s fft2 and ifft2 functions.

4.6 Matlab Scripts

% Output mode cleaner scanning script

% Author: Joshua Weiner

% Date: 8/1/07

% Modified: 8/27/07

% Description: Will scan the length of the OMC linearly with a step size

% specified by the user, recording transmission values and

% PZT voltage measurements.

% Arguments: step_size - the size of the steps to take, in ADC counts

function [] = omc_modes(step_size)

% start mDV and change to this script’s directory

cd /cvs/cds/caltech/apps/mDV

setup(’C’);

cd /cvs/cds/caltech/users/jweiner

% declare channel names

LOOP_BREAK_CHANNEL = ’C1:OMC-LSC_GAIN_SW1’;

% TODO: Make alignment and dithering automatic before script runs scan?

PZT_CONTROL_CHANNEL = ’C1:OMC-LSC_OUTPUT_OFFSET’;

page 14

Page 16: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

TRANS_CHANNEL_DAQ = ’C1:OMC-TRANSMITTED_1_1024’;

TRANS_CHANNEL_EPICS = ’C1:OMC-TRANS_PD1_OUTPUT’;

PZT_CHANNEL_DAQ = ’C1:OMC-LSC_PZT_DVMON_DC_1024’;

PZT_CHANNEL_EPICS = ’C1:OMC-LSC_PZT_DRIVEMON_DC_OUT16’;

% define step sizes for peak-finding loops

FINE_STEP = ’1’;

COARSE_STEP = ’10’;

% width and height of framegrabber images

IMG_WIDTH = 640;

IMG_HEIGHT = 480;

% number of degrees to rotate the image before trying to identify modes

% dark lines should be parallel to the sides and top and bottom of the screen

ROTATION_DEG = 45;

% number of images to take each time a mode is resonating

INTEGRATE = 3;

% unlock the OMC before the scan

command_str = [’ezcaswitch C1:OMC-LSC_GAIN INPUT OFF’];

ezcacmd(command_str, 0);

% Limits of scan: too low will make it too long but not harm the PZT

INITIAL_VALUE = -4000;

FINAL_VALUE = 13000;

% start the scan at the initial value

command_str = [’ezcawrite -- ’ PZT_CONTROL_CHANNEL ’ ’ num2str(INITIAL_VALUE)];

str = ezcacmd(command_str, 0);

% throw errors if bad values given

if step_size > 1000

error(’OMCModes:stepTooLarge’,’Step size was too large, try making the step size under 1000’);

end

% find the current value of the PZT ramp channel

% if an error the first time, read the value again

command_str = [’tdsread ’ PZT_CONTROL_CHANNEL];

str = ezcacmd(command_str, 0);

page 15

Page 17: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

curr_offset = str2num(str);

% TODO: change this value to capture images at the right time for the OMC

% this threshold is for PD1 only

IMG_THRESHOLD = 10;

% TODO: check if this actually makes the script run faster

% pipe the output from the ezcastep to /dev/null so it is supressed, this may

% speed things up

step_command_str = [’ezcastep "’, PZT_CONTROL_CHANNEL, ’" "+’, num2str(step_size), ’"’];

% initialize current transmission to a very low value so that a peak

% is not found where there is no peak

curr_transmission = -10;

% counts the total number of resonances seen during the scan

num_images = 0;

% variable to count the number of iterations of the while loop, for the EPICS

% variable indexes

counter = 0;

% TODO: figure out how big to make these vectors at the start, at least

% leave some room for growing vectors without too much time expense

num_steps = ceil((FINAL_VALUE - curr_offset) / step_size);

% save the values during the scan, useful for debug purposes if get_data

% doesn’t work

trans_epics = zeros(num_steps, 1);

voltage_epics = zeros(num_steps, 1);

% array for describing the images taken:

% first column is images, second is the ADC voltage at which it occurred

image_info = {};

% flag to say whether an image has just been saved, so that the same TEM is

% not locked on and has pictures taken of it over and over

is_img = 0;

% intialize a blank image which will store the integration before it is

% written to disk

curr_img = zeros(IMG_HEIGHT, IMG_WIDTH, ’uint8’);

bg_img = rgb2gray(imread(’bg.ppm’));

page 16

Page 18: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

% save the start time

start_time = gps;

% while the scan has not finished

while curr_offset < FINAL_VALUE

str = ezcacmd([’tdsread ’ TRANS_CHANNEL_EPICS], 0);

curr_transmission = str2num(str);

str = ezcacmd([’tdsread ’ PZT_CHANNEL_EPICS], 0);

curr_pzt_voltage = str2num(str);

if curr_transmission >= IMG_THRESHOLD && is_img == 0

% enable servo here to lock on nearest mode

command_str = [’ezcaswitch C1:OMC-LSC_GAIN INPUT ON’];

ezcacmd(command_str, 1);

% by now, a peak has been centered upon so capture an image

display(’Capturing images...’);

num_images = num_images + 1;

is_img = 1;

gps_time = gps;

% the images will be indexed by the gps time at which they were taken

% since images must be taken at least a second apart (frame grabbing

% takes time)

name = num2str(gps_time);

% "integrate" the image by taking lots of pictures

% in this case, 5

curr_img = zeros(IMG_HEIGHT, IMG_WIDTH, ’uint8’);

for imindex = 1:INTEGRATE

fn = [name, ’-’, num2str(imindex), ’.ppm’];

% take an image here

% use ssh into the m25 machine and run capimgf to save the image on m25, then

% output it to the terminal but redirect the output to save it in a local file, also

% label it according to the time it was taken (rounded to the nearest

% second, these times should be unique)

%% TODO: install framegrabber on different machine or make this image

page 17

Page 19: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

%% capturing easier/simpler than sshing

%% TODO: make the image capture directly to matlab instead of writing

%% to disk to save them

command_str = [’ssh jweiner@m25 "~/bin/capimgf1 temp.ppm; cat temp.ppm" > ’ fn];

unix(command_str);

curr_img = curr_img + rgb2gray(imread(fn));

end

curr_img = (curr_img - bg_img*INTEGRATE) / INTEGRATE;

filename = [name ’.ppm’];

imwrite(curr_img, filename, ’PPM’);

% store the filename and current pzt voltage, so the image can be loaded

% later, correlated with a time, or

image_info{num_images, 1} = filename;

image_info{num_images, 2} = curr_pzt_voltage;

%% DEBUG

fprintf(’%s\n’, filename);

display(’Done’);

% if an image has already been taken and no mode is on screen then get

% ready to take another image

elseif curr_transmission < IMG_THRESHOLD && is_img == 1

is_img = 0;

end

% make sure that the servo is unlocked

command_str = [’ezcaswitch C1:OMC-LSC_GAIN INPUT OFF’];

ezcacmd(command_str, 0);

%fprintf(’Servo is unlocked\n’);

% step PZT voltage here

unix(step_command_str);

% keep track of how far the scan has gone

str = ezcacmd([’tdsread ’ PZT_CONTROL_CHANNEL], 0);

curr_offset = str2num(str);

page 18

Page 20: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

end

% save the end time to find out how long the scan took

end_time = gps;

run_time = end_time - start_time;

%%% DOWNLOAD DATA FROM DAQ %%%

% get data from transmitted photodiode to display time series

transmission = get_data(TRANS_CHANNEL_DAQ, ’raw’, start_time, run_time);

% get lots of data from PZT voltage channel

voltage = get_data(PZT_CHANNEL_DAQ, ’raw’, start_time, run_time);

% DEBUG

% trans_epics_full = get_data(TRANS_CHANNEL_EPICS, ’raw’, start_time, run_time);

trans_data = transmission.data;

% Use the below lines if the data is of too high a sample rate (Matlab

% cannot handle 32768 Hz channels for several seconds), or try using

% downsample_lots found in the mDV extras/ directory

% downsample_rate = 256;

% trans_data = downsample(transmission.data, downsample_rate);

% voltage_data = downsample(voltage.data, downsample_rate);

% DEBUG

% voltage_epics_full = get_data(PZT_CHANNEL_EPICS, ’raw’, start_time, run_time);

trim_time = downsample_rate * [1:length(trans_data)];

% save the scan for looking at later

fprintf(’%s’, ’Saving data...’);

% the downsampled time and transmission data

curr_time = num2str(gps);

save([’omc_scan_data-’ curr_time ’.mat’], ’transmission’, ’trim_time’, ’voltage’, ’start_time’, ’run_time’);

% DEBUG

% the DAQ full data from the EPICS channels

% save([’omc_scan_epics_full-’ curr_time ’.mat’], ’voltage_epics_full’,’trans_epics_full’);

fprintf(’%s\n’, ’done’);

fprintf(’%s’, ’Finding peaks in transmission data...’);

page 19

Page 21: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

% look in a reasonable window around the maxima for the >= 1024 Hz data

% TODO: set this value automatically based on some qualities of the data

sensitivity = round(transmission.rate / 4);

% find the peaks in the transmission data by looking at trimmed data

% TODO: set this value automatically based on some qualities of the data,

% since right now it is just chosen arbitrarily

DATA_THRESHOLD = 10;

% The below line was an attempt at excluding obviously non-peak points from

% being checked, but it doesn’t always speed up the peak-finding

%DATA_THRESHOLD = max(trans_epics) - (max(trans_epics) - min(trans_epics))*2/3;

peak_range = [1 length(trans_data) DATA_THRESHOLD Inf];

trans_peaks = fpeak([1:length(trans_data)], trans_data, sensitivity, peak_range)

% Find the TEM n,m indices of the transmission peaks

% First, read each image into Matlab in a vector which stores information

% about when during the scan it was captured (voltage).

% Then, get the [n,m] values from each of the images using the modenumfft.m

% script.

% TODO: distinguish between HG and LG modes if LG modes present and strong

% TODO: convert the PZT voltage -> length change using data about PZT response

mode_indices = zeros(size(image_info, 1), 2);

% DEBUG

% display(size(image_info));

% display(size(trans_peaks_epics));

for j = 1:size(image_info, 1);

% let the row index of a peak in the trans_peaks matrix be the same as the

% index of the image in the image matrix

% now find the n,m values

%% DEBUG

image_info{j, 1}

[m, n] = modenumfft(image_info{j, 1}, ROTATION_DEG);

mode_indices(j, 1) = m;

mode_indices(j, 2) = n;

% associate the image with its mode peak:

% look through the voltage values for each of the peaks, and if it is

% within a reasonable distance of the ADC voltage recorded for the image,

% then set the image info to be displayed at that voltage/transmission point

page 20

Page 22: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

% this is meant to prevent "phantom" modes from being found, where the

% image is weak or not present because there is no transmission

for k = 1:size(trans_peaks, 1)

peak_index = trans_peaks(k, 1);

peak_voltage = voltage_data(peak_index, 1);

if abs(peak_voltage - image_info{j, 2}) <= 200

image_info{j, 2} = peak_index;

end

end

end

% plot the transmission versus the voltage

% convert to approx. volts from ADC counts

% 10 V / 32768 Counts, also a 50:1 divider between V and ADC in the OMC PZT driver

voltage_data_plot = voltage.data.* -10 * 50 / 32768;

figure

hold on

semilogy(voltage_data_plot, trans_data, ’b’);

% plot all the peaks in transmission found using the peak-finding script

for j = 1:size(trans_peaks, 1)

x = voltage_data_plot(trans_peaks(j, 1));

y = trans_peaks(j, 2);

semilogy(x, y, ’go’);

end

title(’PZT vs. Transmission’,’FontSize’, 18);

xlabel(’PZT Voltage’,’FontSize’, 18);

ylabel(’Transmitted Power (ADC)’,’FontSize’, 18);

% DEBUG

% image_info

% label the voltage v. transmission peaks with the mode number

for j = 1:size(image_info, 1)

%% TODO: make sure that each image was actually captured at a transmisison

%% peak. this is what the "if isinteger" is.

% if isinteger(image_info{j, 2})

page 21

Page 23: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

% x on the plot = the voltage value at the index of the peak

x = voltage_data(image_info{j, 2});

% y on the plot = the transmission value at the index of the peak

y = trans_data(image_info{j, 2});

tem_string = [’TEM: m = ’, num2str(mode_indices(j, 1)), ’ n = ’, ...

num2str(mode_indices(j, 2)) ];

fprintf(’%s\n’, tem_string);

%% TODO: find out how to display text which is on the same semilog scale

%% text(x, y, tem_string);

% end

end

hold off

% ezca2num: Will take the standard output of an ezca program call and

% returns the numeric value of the channel.

% args: ezca_output - a string containing the output of the ezca program

% returns: curr_value - the numeric value in float(?) format

% NOTE: This function does not have to be used when tdsread is used instead

% of ezcaread

function [curr_value] = ezca2num(ezca_output)

index = findstr(ezca_output,’=’);

ezca_output = substring(ezca_output,index + 1);

curr_value = str2num(ezca_output);

% ezcacmd: Executes the given command-line command without fail

% args: command - a string containing the terminal command

% print_msg - 1 to print output of command-line call, 0 for quiet

% returns: output - the standard output of the program

function [output] = ezcacmd(command, print_msg)

status = NaN;

while status ~= 0

[status,output] = unix(command);

end

if print_msg == 1

fprintf(’%s’, output);

end

page 22

Page 24: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

% modenumfft.m - reads an image file and shows and intensity profile,

% returning the number of nodes in the y and x directions after rotation and

% low-pass filtering using the imglpf.m script

% the function will also show the image and the rotated image if the flag

% is set

% Author: Joshua Weiner

% Date modified: 8/27/07

% arguments: img_filename (string containing image filename),

% rotation_deg (degrees to rotate CCW)

function [m,n] = modenumfft(varargin);

% Flag to show the images

SHOW_IMAGES = 0;

% Flag to show the plots

SHOW_PLOTS = 0;

[img_filename, rotated_deg] = parse_inputs(varargin{:});

% read in the image, convert it to intensity map, rotate clockwise if

% specified in arguments

img = imread(img_filename);

if rotated_deg ~= 0

img_rotated = imrotate(img, -rotated_deg);

else

img_rotated = img;

end

% if the input is RGB then get intensity

% otherwise, the intensity image is the image itself

if size(img, 3) == 3

img_i = rgb2gray(img_rotated);

else

img_i = img_rotated;

end

img_width = size(img_i, 2);

img_height = size(img_i, 1);

img_f = imglpf(img_i, 5);

MAX_INTENSITY = max(img_width, img_height) * 255;

% project the x and y axes of the image into vectors by summing the columns

% into a vector (collapse down onto x axis) and summing the rows into a

page 23

Page 25: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

% vector (collapsing onto the y axis)

jj = 1;

x_proj = sum(img_f(:, 1:jj:img_width));

%x_proj = smooth(x_proj(:));

% watch for the transpose here, otherwise it ends up the same as the

% x projection

y_proj = sum(img_f(1:jj:img_height, :)’);

%y_proj = smooth(y_proj(:));

x_len = length(x_proj);

y_len = length(y_proj);

% sensitivity is the number of adjacent points to block out

% since there probably won’t be more than 7 or 8 nodes (m or n = 7,8) then

% setting the sensitivity to be this high should be okay; the find peak

% range will not overlap with the other peaks

% make sure the sensitivity is an integer, otherwise the fpeak function will

% throw errors

x_sensitivity = round(x_len / 25);

x_range = max(x_proj) - min(x_proj);

x_min_intensity_bound = max(x_proj) - 3/4*x_range;

% find the peaks in the x projection

x_peak_bounds = [1 x_len x_min_intensity_bound MAX_INTENSITY]; % x_min x_max y_min y_max

x_peak_points = fpeak([1:x_len], x_proj, x_sensitivity, x_peak_bounds);

y_sensitivity = round(y_len / 25);

y_range = max(y_proj) - min(y_proj);

y_min_intensity_bound = max(y_proj) - 3/4*y_range;

% find the peaks in the y projection

y_peak_bounds = [1 y_len y_min_intensity_bound MAX_INTENSITY]; % x_min x_max y_min y_max

y_peak_points = fpeak([1:y_len], y_proj, y_sensitivity, y_peak_bounds);

if SHOW_PLOTS == 1

figure

plot(x_proj);

hold on

page 24

Page 26: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

plot(x_peak_points(:, 1), x_peak_points(:, 2), ’ro’);

title(’x projection’);

xlabel(’x position’);

ylabel(’summed intensity’);

hold off

figure

plot(y_proj);

hold on

plot(y_peak_points(:, 1), y_peak_points(:, 2), ’go’);

title(’y projection’);

xlabel(’y position’);

ylabel(’summed intensity’);

hold off

end

% return these values, the number of nodes

m = length(y_peak_points) - 1;

n = length(x_peak_points) - 1;

% DEBUG

% tell the user which mode it is

% display([’TEM ’ m ’ ’ n]);

projection = y_proj;

if SHOW_IMAGES == 1

figure

ranamap = mkclrmap(1024);

surf(abs(img_f))

%axis([0 640 0 480]);

view(0, -90);

colormap(ranamap);

shading interp

colorbar

%imshow(img_f);

title(’original image’);

% show the rotated image if it was rotated a nonzero number of degrees

if rotated_deg ~= 0

figure

imshow(img);

title(’rotated image’);

end

end

page 25

Page 27: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

% parse_inputs: reads the variable number of arguments and assigns values

% depending upon the number of arguments and their values

function [img_filename, rotation_deg] = parse_inputs(varargin)

% check if there is at least 1 input but no more than 3

iptchecknargin(1, 2, nargin, mfilename);

switch nargin

case 1

img_filename = varargin{1};

rotation_deg = 0;

case 2

img_filename = varargin{1};

rotation_deg = varargin{2};

end % end switch

page 26

Page 28: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

% imglpf.m - Image Low-pass Filtering Script

% Author: Joshua Weiner

% Date modified: 8/27/07

% arguments: im, an image in Matlab

% cutoff, the frequency cutoff to use for the filter

% returns: im_f, the filtered image

function [im_f] = imglpf(im, cutoff)

% fft2 only works when an image is converted to a double

im_fft = fft2(im2double(im));

% shifting the fft centers it around the midpoint of the matrix

im_fft_shift = fftshift(im_fft);

% since the fft is centered, find the center points

xc = round(size(im, 2) / 2);

yc = round(size(im, 1) / 2);

% TODO: add in different kinds of filters (Gaussian, Butterworth, band-pass,

% high-pass, etc).

for jj = 1:size(im_fft_shift, 1)

for kk = 1:size(im_fft_shift, 2)

if sqrt((jj - yc)^2 + (kk - xc)^2) > cutoff

im_fft_shift(jj, kk) = 0;

end

end

end

im_f = abs(ifft2(ifftshift(im_fft_shift)));

page 27

Page 29: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

% fpeak returns x,y pairs of minima or maxima in the data set represented

% as two columns (peak(:,1) is x and peak(:,2) is y; peak(i,:) is the ith

% [x,y] pair. A region of interest may be specified, as well as the

% sensitivity of the function to finding peaks

% Author: Geng Jun

% USTB,Beijing,China

% E-mail: [email protected]

% Write for Dr. Ma Zheng

% Create: 2003,12,9 17:28

% Modified by:Joshua Weiner

% Caltech, Pasadena, CA

% Email: [email protected]

% Modified: 11 July 2007

% Arguments: s is the sensitivity of the function, or half the width of the

% range to check points against to determine if they are peaks.

% Higher s means fewer detected peaks.

%

% Range is the region in which to look for peaks in the format:

% [x_min x_max y_min y_max]

%-------------------------------------------------

function peak = fpeak(x, y, s, Range)

MAX = 1;

MIN = 2;

NONE = 0;

% Check if correct number of command-line arguments is given

% 3 args for no range, 4 including range

iptchecknargin(4, 4, nargin, mfilename);

% if the number of x and y values is not the same, signal error

[rx,cx] = size(x);

[ry,cy] = size(y);

if rx == 1

x = x’;

rx = length(x);

end

if ry == 1;

y = y’;

page 28

Page 30: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

ry = length(y);

end

if rx ~= ry

error(’Number of x and y elements must be the same.’);

return

end

num_peaks = 1; % index for number of peaks

Data = sortrows([x, y]);

points_checked = 0;

points_in_range = 0;

peak = zeros(1, 2);

% loop through all data points

for ii = 1:rx

if mod(ii, 10000) == 0

sprintf(’%s’, [num2str(ii) ’ points checked’])

sprintf(’%s’, [num2str(points_in_range) ’ points in range’])

end

% only check for peak if the point falls within range

if ii >= Range(1) && ii <= Range(2) && Data(ii, 2) >= Range(3) && Data(ii, 2) <= ...

Range(4)

points_in_range = points_in_range + 1;

[point, type] = getPeak(Data, ii, s); % test if the point is a peak, if

% so, get its [x,y] pair

if type == MAX % if the candidate point is a peak

peak(num_peaks, :) = point; % store the x,y pair in the next

% index of peak array

num_peaks = num_peaks + 1; % increase the index

end

end

end

% if the range has been specified in the arguments, filter the found peaks

% based on the range

%if nargin == 4

% only include points within the x range

% peak = peak(find(peak(:,1) >= Range(1) & peak(:,1) <= Range(2)),:);

% only include points within the y range

page 29

Page 31: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

% peak = peak(find(peak(:,2) >= Range(3) & peak(:,2) <= Range(4)),:);

%end

%-------------------------------------------

function [p, t] = getPeak(Data, k, s)

MAX = 1;

MIN = 2;

NONE = 0;

y = Data(:, 2); % the column of y values

% English: Select points by sensitivity

% If the difference between the index and sensitivity (peak range) is less

% than 1, then set the bound to be the lowest index of the data set (in

% this case 1). Otherwise, set the index to be s points away from the

% current point

top = k - s;

if top <= 0

top = 1;

end

% If the upper sensitivity limit is more than the number of data points,

% set it to be the maximum data point. Otherwise, set the upper limit to be

% s points away from the current point (in the opposite direction from top)

bottom = k + s;

if bottom > length(y)

bottom = length(y);

end

% Add solution as an input arguments,then you can write your own solution.

% Solution 1 All datas in the range of senstitivity must be <= or >= peak

% value

% If tP=1, it’s top peak

% If bP=1, it’s bottom peak

% if all the points to the right of the point are less than or equal to the

% point and all the points to the right of the point are less than the

% point (to account for adjacent equal y values), then register it as a

% local maximum

tP = (sum(y(top:k) >= y(k)) + sum(y(k:bottom) > y(k)) == 1);

% if all the points in the range are greater than the given point except

page 30

Page 32: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

% for the point itself, set the bP flag to be 1

bP = (sum(y(top:k) <= y(k)) + sum(y(k:bottom) < y(k)) == 1);

% the following line is commented out and replaced by "if tP == 1" because

% we only want local maxima

% if tP==1 | bP==1

if tP == 1

p = Data(k, :); % return the x,y pair corresponding to the point

t = MAX;

elseif bP == 1

p = Data(k, :);

t = MIN;

else

p = [NaN, NaN]; % return NaN pair for no peak found

t = NONE;

end

page 31

Page 33: Automated Analysis of the Transverse Modes of a Laser Beam Using a

LIGO-T070266-00-I

References

[1] Alan J. Weinstein. Lecture: Graviational Waves and LIGO. Caltech, 2006.

[2] Marcus Ng. Design of an Output Mode Cleaner to Enable DC Readout in the LIGO40-Meter Interferometer. SURF Papers, 2005.

[3] Robert Ward. Mini-lecture at the 40-meter interferometer, 2007.

[4] A. E. Siegman. Lasers. University Science Books, Mill Valley, CA, 1986.

[5] Dave Marshall. The Discrete Fourier Transform (DFT).http://www.cs.cf.ac.uk/Dave/Multimedia/node228.html, 2001.

[6] Keita Kawabe, Luca Matone, and Joseph Betzwieser. Excess Noise Mechanism in LIGOOutput Mode Cleaner. LIGO-T040158-00-D, 2004.

page 32