A CHARACTERIZATION OF THE NOISE SPECTRAL DENSITY OF A

advertisement
A CHARACTERIZATION OF THE NOISE SPECTRAL
DENSITY OF A LOW NOISE CURRENT DRIVER AND PID CONTROLLER
by
Daylin Troxel
A senior thesis submitted to the faculty of
Brigham Young University
in partial fulfillment of the requirements for the degree of
Bachelor of Science
Department of Physics and Astronomy
Brigham Young University
August 2010
c 2010 Daylin Troxel
Copyright All Rights Reserved
BRIGHAM YOUNG UNIVERSITY
DEPARTMENT APPROVAL
of a senior thesis submitted by
Daylin Troxel
This thesis has been reviewed by the research advisor, research coordinator,
and department chair and has been found to be satisfactory.
Date
Dallin Durfee, Advisor
Date
Eric Hintz, Research Coordinator
Date
Ross L. Spencer, Chair
ABSTRACT
A CHARACTERIZATION OF THE NOISE SPECTRAL
DENSITY OF A LOW NOISE CURRENT DRIVER AND PID CONTROLLER
Daylin Troxel
Department of Physics and Astronomy
Bachelor of Science
Our lab designed special low-noise electronics in order to stabilize lasers for
use in our atom and ion interferometers. The current driver was based on
the Hall-Libbrecht design but included updated components, extra filters, and
digital control. My work focused on characterizing the noise spectrum of our
electronics. In this thesis I give an overview of noise measurements in general
and present the procedure I used to measure the noise and the results of the
measurement for the current driver and PID controller. I also characterize the
measurement noise floor and the PID controller bandwidth.
ACKNOWLEDGMENTS
I would like to acknowledge Dr. Dallin Durfee and Chris Erickson for their
help on this project and Brigham Young University for providing funding.
Contents
Table of Contents
vii
List of Figures
ix
1 Background
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Spectral Densities . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
1
2
2
2 Experimental Setup
2.1 Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5
5
3 Results and Analysis
3.1 Current Driver Results . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 PID Characterization . . . . . . . . . . . . . . . . . . . . . . . . . . .
11
11
13
4 Conclusion
19
A Appendix A: Matlab Code
A.1 Main File, FinalSDPlot.m . . . . . . . . . . . . . . . . . . . . . . . .
A.2 File for interpreting multimeter data, sddata.m . . . . . . . . . . . .
A.3 File for interpreting Oscilloscope data, sdscope . . . . . . . . . . . . .
21
21
27
30
Bibliography
33
vii
List of Figures
2.1
Improvement over Old SD Measurement . . . . . . . . . . . . . . . .
3.1
3.2
3.3
3.4
3.5
3.6
Results of the Spectral Density Measurement
PID Spectral Density Measurement . . . . .
PID Proportional Bode Plot . . . . . . . . .
PID Integral Bode Plot . . . . . . . . . . . .
PID Differential Bode Plot . . . . . . . . . .
PID Prop., Int., and Diff. Bode Plot . . . .
ix
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
6
12
14
15
16
17
18
Chapter 1
Background
1.1
Introduction
We need to drive narrow transitions in calcium and strontium in the atom and ion
interferometers in our lab. To do so, we designed special low-noise electronics to
stabilize our lasers. With the current driver, we took the standard Hall-Libbrecht
design and made several modifications. Among the changes, we updated components,
added filters, and replaced the potentiometer that sets the current with digital control.
In order to describe how much noise is present in our new electronics, we want to
determine the noise spectral density, the noise per unit bandwidth. There is noise
inherent in multimeters and electronics used in taking the measurement, so to make
sure the noise of our measurement devices is below the noise we are trying to measure,
we also want to measure the noise spectrum of the electronic equipment we used and
establish a measurement noise floor.
1
2
Chapter 1 Background
1.2
Spectral Densities
It is meaningless to talk about the noise present at exactly one frequency, since there is
zero power in any particular frequency. Instead, power is spread out over a frequency
range and the figure of merit is the power spectral density (PSD), the power per unit
bandwidth in a signal (with units of Watts per Hertz). The power in a frequency
range is found by simply integrating the PSD over that range. Units of frequency in
the denominator disappear after the integration, leaving units of power.
However, power is proportional to amplitude squared and we really want to know
the amplitude of the noise, not its square, for practical purposes. So a more useful
quantity here is the linear spectral density (LSD), which is the square root of the
PSD. Thus, the LSD for a current noise measurement will have units of Amps per
root Hz, and the amount of current noise in a certain frequency range is found by
integrating the LSD along the square root of the frequency interval to give us Amps
of current in that range.
1.3
Calculations
The signal describing the noise is measured as described in the experimental setup
section. We then have two one-dimensional arrays: one of time values and a corresponding array of amplitude values. We would like to transform this data into
corresponding arrays of frequency and spectral density.
We can represent the current or voltage amplitude y(t) mathematically as a Fourier
series
y(t) =
∞
X
n=−∞
cn eint
1.3 Calculations
3
where
1ZT
cn =
y(t)e−int dt
T 0
for a continuous function. So, we want to calculate the cn coefficients, which tell us
the magnitude of the different frequencies that compose our signal. Since our current
function is real, cn = c−n and we might as well use
y(t) = c0 +
∞
X
2cn eint
n=1
and multiply our cn coefficients by two, which lets us only consider positive frequencies. When applied to a discrete set of data, the equation for the coefficients becomes
−1
1 NX
nk
cn =
yk exp − 2πi
,n = 0...N − 1
N k=0
N
!
where yk are the array elements of y. We now have a formula for the coefficients cn ,
the magnitudes of which represent the relative amplitudes in our signal of different
frequency components. The frequencies that correspond to the amplitudes in the
array are:
0,
where fs =
N
Ttotal
(N/2)fs
fs 2fs 3fs
,
,
,...,
N N N
N
is the sampling frequency. So, the frequency array can also be
written as
0,
1
,
2
,
3
Ttotal Ttotal Ttotal
,...,
N/2
Ttotal
where Ttotal is the total time interval over which our data was taken. Note that the
maximum frequency,
N/2
Ttotal
= 12 fs corresponds to the Nyquist frequency, the maximum
frequency that can theoretically be resolved using the sampling rate fs .
Computer FFT algorithms tend to calculate slight variations of cn . For example,
MATLAB’s fft( ) function leaves off the factor 1/N , and the results you get will
depend on the number of samples taken, something the spectral density should be
independent of. So, when using MATLAB, you need to divide the fft result by N.
4
Chapter 1 Background
The amplitude of the noise is proportional to the magnitude of the cn coefficients,
which will be complex. Since we are only dealing with positive frequencies, we attach
the factor of two, so the power spectral density is the square of twice the magnitude
of cn divided by the frequency spacing, (which is
1
),
Ttotal
giving the power per Hz. The
linear spectral density is the square root of this expression:
LSDn =
q
P SDn =
v
u
u
t
√
|2cn |2
2|f f t(yn )| Ttotal
=
, n = 1, 2, . . . , N/2
1/Ttotal
N
which has corresponding frequencies
fn =
n
Ttotal
We now have our final frequency and spectral density arrays.
Chapter 2
Experimental Setup
2.1
Setup
Originally, another member of our group measured the spectral density of the current
driver by driving current through a laser diode with a small resistor to ground placed
at the end of the diode. The LSD was calculated using a multimeter and oscilloscope
to measure the voltage as a function of time across the resistor. The setup and
spectral density are shown in the left hand side of figure 2.1.
In this measurement, however, the noise of the current driver constitutes a very
small fluctuation in a relatively large current signal, which limits our ability to carefully resolve the current noise. As can be seen in the plot, the noise of the current
driver was at the noise floor for most of the frequencies, so we essentially only ended
up measuring the noise floor twice. To solve this problem, we used a revised setup
with two current drivers, shown in the right side of figure 2.1. One current driver
was set to produce +50 mA while the other was set to produce -50 mA. Almost all of
the current flows from one driver to the other through two laser diodes. The currents
of the two sources will always differ, however, because of random noise and because
5
6
Chapter 2 Experimental Setup
Original Noise Measurement
R
New Noise Measurement
(+)
Current
Driver
Laser
Diode
(-)
Laser
Diode
R
Laser
Diode
Current
Driver
Figure 2.1 Comparison of original and improved measurements with the
current driver. The new measurement brings the spectral density down several orders of magnitude.
the actual current each driver puts out may differ by a small amount, so a resistor
to ground was placed between the two current drivers. If the two drivers are not set
to the same current, a constant dc current will flow through the resistor. This dc
offset will not affect the (ac) frequencies in the spectral density. This setup effectively
removes the large signal that was masking the noise in our previous measurement. To
measure the noise, we measure the voltage across the resistor over time. The resistor
was large (1 megaohm) to create a large voltage signal.
In this setup there are two sources of noise instead of one. Multiple noise sources
add in quadrature. The total noise spectrum Ntotal from two noise sources in series,
N1 and N2 , is
2
Ntotal
= N12 + N22
If the two sources of noise are identical, then Ntotal =
√
2N1 . If one source of noise
2.1 Setup
7
is much larger than the other, the larger value will tend to dominate because of the
squares and the total noise will be very close to the noise of the larger source. So,
√
we know that either both drivers produce 1/ 2 of the total noise or that one driver
produces nearly all the noise and the other is even better. I assume that both drivers
√
produce equal amounts of noise and divide out a factor of 2 from our measured
spectral density, making the final spectral density array for the current driver:
√
|f f t(yn )| 2Ttotal
LSDn =
, n = 1, 2, . . . , N/2
N
(2.1)
In order to display the noise spectral density over a large frequency range spanning
several orders of magnitude (from 10−3 Hz to 105 Hz), we displayed our data in a
logarithmic plot. This introduces a subtle plotting problem, since our data was taken
at linearly spaced regular intervals. The spectral density will also have linearly spaced
points, but plotted on a log plot, the points are more densely grouped on the right
side of the plot. This not only looks bad, it provides little detail on the left side at
lower frequencies. To get around this, one can bin, or average together, points from
the plot into exponentially spaced bins. However, as can be seen in equation ??,
spanning a large frequency range requires a very large number of points—data taken
at a high sampling frequency for a long period of time. Our solution was to break the
plot into 10 regions, only displaying the upper section of each plot, where the points
are densely grouped. This lets us sample only as long and with as high a sampling
frequency as we need for each range. We can then linearly bin the plot segments to
get the density of points even for each segment throughout the entire plotting range.
One of the major problems encountered when taking the noise spectrum measurement was aliasing. When we broke the frequency range into multiple segments,
aliasing caused the segments to not line up very well at the borders. To solve this,
a variable low-pass filter was inserted to filter the signal before it went to the oscil-
8
Chapter 2 Experimental Setup
loscope and an additional 20 MHz low-pass filter on the scope was utilized as well
to eliminate high-frequency noise picked up in BNC cables. In order to significantly
reduce aliasing, the highest frequency resolved by the O-scope (i.e. half the sampling
frequency) was set to 10 times the 3dB point of the variable filter. This makes the
sampling frequency 20 times the 3dB point of the filter. The combination of filter and
a sufficiently high sampling rate insured no high frequency noise was aliased to lower
frequencies. Then, to avoid plotting data affected by filter cut-off, the information
above 1/10 of the 3dB point was ignored, leaving us with an accurate segment of the
spectral density we can plot. The only exception to these numbers was the multimeter line segment (from 10−3 Hz to 1 Hz). The highest frequency it could sample at
was 50 Hz, which means there will be a little filter cutoff and a little aliasing, but
fortunately those two effects fight against each other and the spectral density still
lined up nicely at the boundary between multimeter and oscilloscope. When all 10
segments were pieced together, the other boundaries lined up nicely as well. The final
results are shown in figure 2.1.
The following table summarizes the sampling and filter frequencies I used to plot
the SD in each range:
I took the bulk of my data with the Lecroy Waverunner LT 354 Oscilloscope and
used the Fluke 8505A digital multimeter to measure the lowest frequencies. The
variable filters were part of the SR560 Low-Noise Preamplifier and rolled off at 12dB
per octave. The SR560 preamplifier was set to unity gain. The current drivers and
PID controller were placed in aluminum boxes to shield out noise from the room.
The laser diodes and resistor to ground were placed in a separate aluminum box as
well. BNC cables connected the components together and carried the signal to the
voltmeter.
2.1 Setup
9
Freq. Range
Sample Freq.
Filter
1×10−3 Hz to 1 Hz (multimeter)
50 Hz
3 Hz
1 Hz to 10 Hz
2 kHz
100 Hz filter
10 Hz to 30 Hz
10 kHz
300 Hz filter
30 Hz to 100 Hz
20 kHz
1 kHz filter
100 Hz to 300 Hz
100 kHz
3 kHz
300 Hz to 1 kHz
200 kHz
10 kHz
1 kHz to 3 kHz
1 MHz
30 kHz
3 kHz to 10 kHz
2 MHz
100 kHz
10 kHz to 30 kHz
10 MHz
300 kHz
30 kHz to 100 kHz
20 MHz
1 MHz
10
Chapter 2 Experimental Setup
Chapter 3
Results and Analysis
3.1
Current Driver Results
The spectral density for the current driver is reproduced in figure 3.1.
The noise floor presumably has discontinuities because the measurement was taken
with different settings on the oscilloscope and each setting has a different noise level.
With the improved measurement setup, the noise floor for this measurement was
lower than the noise of the current driver almost everywhere, so the noise of the
driver was successfully characterized. There are several prominent peaks in the noise
spectrum, one at 60 Hz and one near a few tenths of a megahertz. We can find the
amount of current around 60 Hz, for example, by integrating the area of the peak at
√
√ √
60 Hz. This is approximately 1×10−9 A/ Hz × 5 Hz = 2 nA.
The Johnson-Nyquist noise (the noise due to random thermal motion of atoms)
√
√
of a 1 M Ω resistor at room temperature is 4kB T R/R = 1.3 × 10−13 A/ Hz. The
noise of the current driver is only slightly above this at high frequencies.
Our improved measurement technique brought the observed spectral density down
by two orders of magnitude across the entire frequency range and more in some places,
11
12
Chapter 3 Results and Analysis
−7
10
Spectral Density [Amps/Hz1/2]
−8
10
−9
10
−10
10
−11
10
−12
10
−3
10
−2
10
−1
10
0
10
1
2
10
10
Frequency [Hz]
3
10
4
10
5
10
Figure 3.1 The noise spectrum of the current driver. The black curve represents the noise spectral density. The lower gray line shows the measurement
noise floor.
3.2 PID Characterization
13
a great improvement in resolution.
To be certain that scope capacitance or other effects aren’t artificially filtering out
high frequency noise, a future measurement should be performed analyzing the gain
of the filter-scope setup with a constant amplitude signal of varying frequency.
3.2
PID Characterization
Our lab also designed a PID controller for laser locking. I performed an identical
noise measurement on the PID controller with results shown in figure 3.2.
In addition to noise, I characterized the bandwidth of the proportional, integral,
and differential sections of the PID lock circuit. The op-amps responsible for the gain
of the proportional, integral, and differential sections have different roll off frequencies.
When a PID controller responds to a high frequency input signal, a phase shift may
be introduced in the output if the electronics cannot respond fast enough. If the
PID output gets 180 degrees out of phase, it begins amplifying high frequency error
instead of correcting it. Therefore, the PID circuit should be designed so the gain
for each section rolls off below unity gain when the phase is shifted by 180 degrees.
Bode plots of gain and phase shift for the P, I, and D sections and the overall PID
controller are shown below. In all cases, the gain rolled off below unity at about 180
degrees phase shift.
14
Chapter 3 Results and Analysis
−2
10
Spectral Density [Volts/Hz1/2]
−3
10
−4
10
−5
10
−6
10
−7
10
−2
10
0
2
10
10
4
10
Frequency [Hz]
Figure 3.2 The noise spectrum of the PID controller. The top curve represents the spectral density of the controller. The lower gray line shows the
measurement noise floor.
3.2 PID Characterization
Figure 3.3 Roll off and phase shift of Proportional circuitry in the PID
lock circuit.
15
16
Chapter 3 Results and Analysis
Figure 3.4 Integral section roll off and phase shift of the PID lock circuit.
This measurement was done with a 10 MΩ resistor in place to limit the gain of
the integral op-amp. The phase shift for the integral settles in at 90 degrees,
where it should be, until the frequency gets too high. The impedance of a
capacitor goes as 1/ω, so the gain of the integrator appears linear on a log
plot.
3.2 PID Characterization
Figure 3.5 Differential roll off and phase shift.
17
18
Chapter 3 Results and Analysis
Figure 3.6 Combined PID roll off and phase shift.
Chapter 4
Conclusion
Measuring the noise spectral density of the current driver using a positive and negative
supply allowed for a much more accurate measurement by dramatically reducing
the signal-to-noise ratio. In contrast with the measurement performed with a single
current driver where a small resistor must be used, our revised setup allows for a
larger resistor, giving a much larger voltage and better resolution of the noise spectral
density. The noise and bandwidth measurements performed on the current driver and
PID controller provide important information on the stability and accuracy of future
measurements performed with our atom and ion interferometers.
19
20
Chapter 4 Conclusion
Appendix A
Appendix A: Matlab Code
A.1
Main File, FinalSDPlot.m
..
1 clear ; close all ;
2
3 bi n2 =100;
4 bi n3 =500;
5 R=1e6 / 2 ;
6 [ x1 , y1 ]= s d s c o p e ( ’
Scope500HzSample 100HzFilter 200s 20MHzBWL . txt ’ , R, bin2 )
;
7 [ x2 , y2 ]= s d s c o p e ( ’ Scope1kHzSample 300HzFilter 100s 20MHzBWL
. txt ’ , R, bin 2 ) ;
8 [ x3 , y3 ]= s d s c o p e ( ’ Scope10kHzSample 1kHzFilter 10s 20MHzBWL .
txt ’ , R, bin2 ) ;
21
22
Chapter A Appendix A: Matlab Code
9 [ x4 , y4 ]= s d s c o p e ( ’ Scope20kHzSample 3kHzFilter 5s 20MHzBWL .
txt ’ , R, bin2 ) ;
10 [ x5 , y5 ]= s d s c o p e ( ’ Scope100kHzSample 10kHzFilter 1s 20MHzBWL
. txt ’ , R, bin 2 ) ;
11 [ x6 , y6 ]= s d s c o p e ( ’ Scope100kHzSample 30kHzFilter 1s 20MHzBWL
. txt ’ , R, bin 2 ) ;
12 [ x7 , y7 ]= s d s c o p e ( ’
Scope500kHzSample 100kHzFilter 200ms 20MHzBWL . txt ’ , R,
b i n2 ) ;
13 [ x8 , y8 ]= s d s c o p e ( ’
Scope1MHzSample 300kHzFilter 100ms 20MHzBWL . txt ’ , R, bin2
);
14 [ x9 , y9 ]= s d s c o p e ( ’ Scope10MHzSample 1MHzFilter 10ms 20MHzBWL
. txt ’ , R, bin 2 ) ;
15 [ x10 , y10 ]= sddata ( ’ ACDCVSlow10Hz24Hrs . csv ’ ,R∗ 2 , bin3 ) ;
16
17 R2=1e6 /2/ s q r t ( 2 ) ;
18 [ fx1 , f y 1 ]= s d s c o p e ( ’
FLOOR Scope500HzSample 100HzFilter 200s 20MHzBWL . txt ’ ,
R2 , bin2 ) ;
19 [ fx2 , f y 2 ]= s d s c o p e ( ’
FLOOR Scope1kHzSample 300HzFilter 100s 20MHzBWL . txt ’ , R2
, bin2 ) ;
20 [ fx3 , f y 3 ]= s d s c o p e ( ’
FLOOR Scope10kHzSample 1kHzFilter 10s 20MHzBWL . txt ’ , R2 ,
b i n2 ) ;
A.1 Main File, FinalSDPlot.m
23
21 [ fx4 , f y 4 ]= s d s c o p e ( ’
FLOOR Scope20kHzSample 3kHzFilter 5s 20MHzBWL . txt ’ , R2 ,
bin2 ) ;
22 [ fx5 , f y 5 ]= s d s c o p e ( ’
FLOOR Scope100kHzSample 10kHzFilter 1s 20MHzBWL . txt ’ , R2
, bin2 ) ;
23 [ fx6 , f y 6 ]= s d s c o p e ( ’
FLOOR Scope100kHzSample 30kHzFilter 1s 20MHzBWL . txt ’ , R2
, bin2 ) ;
24 [ fx7 , f y 7 ]= s d s c o p e ( ’
FLOOR Scope500kHzSample 100kHzFilter 200ms 20MHzBWL . txt
’ , R2 , bin2 ) ;
25 [ fx8 , f y 8 ]= s d s c o p e ( ’
FLOOR Scope1MHzSample 300kHzFilter 100ms 20MHzBWL . txt ’ ,
R2 , bin2 ) ;
26 [ fx9 , f y 9 ]= s d s c o p e ( ’
FLOOR Scope10MHzSample 1MHzFilter 10ms 20MHzBWL . txt ’ , R2
, bin2 ) ;
27 [ fx10 , f y 1 0 ]= sddata ( ’
FLOOR Fluke23HzSample 10HzFilter F1 3hrs . csv ’ , R2∗ 2 , bin3
);
28
29 b0=1e −3;
30 b1 =1;
31 b2 =10;
32 b3 =30;
24
Chapter A Appendix A: Matlab Code
33 b4=1e2 ;
34 b5=3e2 ;
35 b6=1e3 ;
36 b7=3e3 ;
37 b8=10e3 ;
38 b9=30e3 ;
39 b10=1e6 ;
40
41
42
c o l 2 =’k ’ ;
43
l o g l o g ( f x 1 ( c e i l ( ( b1 ) ∗ l e n g t h ( f x 1 ) / f x 1 ( end ) ) : f l o o r ( ( b2 ) ∗
l e n g t h ( f x 1 ) / f x 1 ( end ) ) ) , . . .
44
f y 1 ( c e i l ( ( b1 ) ∗ l e n g t h ( f x 1 ) / f x 1 ( end ) ) : f l o o r ( ( b2 ) ∗ l e n g t h
( f x 1 ) / f x 1 ( end ) ) ) , c o l 2 , . . .
45
f x 2 ( c e i l ( ( b2 ) ∗ l e n g t h ( f x 2 ) / f x 2 ( end ) ) : f l o o r ( ( b3 ) ∗ l e n g t h
( f x 2 ) / f x 2 ( end ) ) ) , . . .
46
f y 2 ( c e i l ( ( b2 ) ∗ l e n g t h ( f x 2 ) / f x 2 ( end ) ) : f l o o r ( ( b3 ) ∗ l e n g t h
( f x 2 ) / f x 2 ( end ) ) ) , c o l 2 , . . .
47
f x 3 ( c e i l ( ( b3 ) ∗ l e n g t h ( f x 3 ) / f x 3 ( end ) ) : f l o o r ( ( b4 ) ∗ l e n g t h
( f x 3 ) / f x 3 ( end ) ) ) , . . .
48
f y 3 ( c e i l ( ( b3 ) ∗ l e n g t h ( f x 3 ) / f x 3 ( end ) ) : f l o o r ( ( b4 ) ∗ l e n g t h
( f x 3 ) / f x 3 ( end ) ) ) , c o l 2 , . . .
49
f x 4 ( c e i l ( ( b4 ) ∗ l e n g t h ( f x 4 ) / f x 4 ( end ) ) : f l o o r ( ( b5 ) ∗ l e n g t h
( f x 4 ) / f x 4 ( end ) ) ) , . . .
50
f y 4 ( c e i l ( ( b4 ) ∗ l e n g t h ( f x 4 ) / f x 4 ( end ) ) : f l o o r ( ( b5 ) ∗ l e n g t h
( f x 4 ) / f x 4 ( end ) ) ) , c o l 2 , . . .
A.1 Main File, FinalSDPlot.m
51
25
f x 5 ( c e i l ( ( b5 ) ∗ l e n g t h ( f x 5 ) / f x 5 ( end ) ) : f l o o r ( ( b6 ) ∗ l e n g t h
( f x 5 ) / f x 5 ( end ) ) ) , . . .
52
f y 5 ( c e i l ( ( b5 ) ∗ l e n g t h ( f x 5 ) / f x 5 ( end ) ) : f l o o r ( ( b6 ) ∗ l e n g t h
( f x 5 ) / f x 5 ( end ) ) ) , c o l 2 , . . .
53
f x 6 ( c e i l ( ( b6 ) ∗ l e n g t h ( f x 6 ) / f x 6 ( end ) ) : f l o o r ( ( b7 ) ∗ l e n g t h
( f x 6 ) / f x 6 ( end ) ) ) , . . .
54
f y 6 ( c e i l ( ( b6 ) ∗ l e n g t h ( f x 6 ) / f x 6 ( end ) ) : f l o o r ( ( b7 ) ∗ l e n g t h
( f x 6 ) / f x 6 ( end ) ) ) , c o l 2 , . . .
55
f x 7 ( c e i l ( ( b7 ) ∗ l e n g t h ( f x 7 ) / f x 7 ( end ) ) : f l o o r ( ( b8 ) ∗ l e n g t h
( f x 7 ) / f x 7 ( end ) ) ) , . . .
56
f y 7 ( c e i l ( ( b7 ) ∗ l e n g t h ( f x 7 ) / f x 7 ( end ) ) : f l o o r ( ( b8 ) ∗ l e n g t h
( f x 7 ) / f x 7 ( end ) ) ) , c o l 2 , . . .
57
f x 8 ( c e i l ( ( b8 ) ∗ l e n g t h ( f x 8 ) / f x 8 ( end ) ) : f l o o r ( ( b9 ) ∗ l e n g t h
( f x 8 ) / f x 8 ( end ) ) ) , . . .
58
f y 8 ( c e i l ( ( b8 ) ∗ l e n g t h ( f x 8 ) / f x 8 ( end ) ) : f l o o r ( ( b9 ) ∗ l e n g t h
( f x 8 ) / f x 8 ( end ) ) ) , c o l 2 , . . .
59
f x 9 ( c e i l ( ( b9 ) ∗ l e n g t h ( f x 9 ) / f x 9 ( end ) ) : f l o o r ( ( b10 ) ∗
l e n g t h ( f x 9 ) / f x 9 ( end ) ) ) , . . .
60
f y 9 ( c e i l ( ( b9 ) ∗ l e n g t h ( f x 9 ) / f x 9 ( end ) ) : f l o o r ( ( b10 ) ∗
l e n g t h ( f x 9 ) / f x 9 ( end ) ) ) , c o l 2
61
,...
f x 1 0 ( c e i l ( ( b0 ) ∗ l e n g t h ( f x 1 0 ) / f x 1 0 ( end ) ) : f l o o r ( ( b1 ) ∗
l e n g t h ( f x 1 0 ) / f x 1 0 ( end ) ) ) , . . .
62
f y 1 0 ( c e i l ( ( b0 ) ∗ l e n g t h ( f x 1 0 ) / f x 1 0 ( end ) ) : f l o o r ( ( b1 ) ∗
l e n g t h ( f x 1 0 ) / f x 1 0 ( end ) ) ) , c o l 2 , ’ l i n e w i d t h ’ , 2 )
63 ho ld on
26
64
Chapter A Appendix A: Matlab Code
l o g l o g ( x1 ( c e i l ( ( b1 ) ∗ l e n g t h ( x1 ) / x1 ( end ) ) : f l o o r ( ( b2 ) ∗
l e n g t h ( x1 ) / x1 ( end ) ) ) , . . .
65
y1 ( c e i l ( ( b1 ) ∗ l e n g t h ( x1 ) / x1 ( end ) ) : f l o o r ( ( b2 ) ∗ l e n g t h ( x1
) / x1 ( end ) ) ) , ’ k ’ , . . .
66
x2 ( c e i l ( ( b2 ) ∗ l e n g t h ( x2 ) / x2 ( end ) ) : f l o o r ( ( b3 ) ∗ l e n g t h ( x2
) / x2 ( end ) ) ) , . . .
67
y2 ( c e i l ( ( b2 ) ∗ l e n g t h ( x2 ) / x2 ( end ) ) : f l o o r ( ( b3 ) ∗ l e n g t h ( x2
) / x2 ( end ) ) ) , ’ k ’ , . . .
68
x3 ( c e i l ( ( b3 ) ∗ l e n g t h ( x3 ) / x3 ( end ) ) : f l o o r ( ( b4 ) ∗ l e n g t h ( x3
) / x3 ( end ) ) ) , . . .
69
y3 ( c e i l ( ( b3 ) ∗ l e n g t h ( x3 ) / x3 ( end ) ) : f l o o r ( ( b4 ) ∗ l e n g t h ( x3
) / x3 ( end ) ) ) , ’ k ’ , . . .
70
x4 ( c e i l ( ( b4 ) ∗ l e n g t h ( x4 ) / x4 ( end ) ) : f l o o r ( ( b5 ) ∗ l e n g t h ( x4
) / x4 ( end ) ) ) , . . .
71
y4 ( c e i l ( ( b4 ) ∗ l e n g t h ( x4 ) / x4 ( end ) ) : f l o o r ( ( b5 ) ∗ l e n g t h ( x4
) / x4 ( end ) ) ) , ’ k ’ , . . .
72
x5 ( c e i l ( ( b5 ) ∗ l e n g t h ( x5 ) / x5 ( end ) ) : f l o o r ( ( b6 ) ∗ l e n g t h ( x5
) / x5 ( end ) ) ) , . . .
73
y5 ( c e i l ( ( b5 ) ∗ l e n g t h ( x5 ) / x5 ( end ) ) : f l o o r ( ( b6 ) ∗ l e n g t h ( x5
) / x5 ( end ) ) ) , ’ k ’ , . . .
74
x6 ( c e i l ( ( b6 ) ∗ l e n g t h ( x6 ) / x6 ( end ) ) : f l o o r ( ( b7 ) ∗ l e n g t h ( x6
) / x6 ( end ) ) ) , . . .
75
y6 ( c e i l ( ( b6 ) ∗ l e n g t h ( x6 ) / x6 ( end ) ) : f l o o r ( ( b7 ) ∗ l e n g t h ( x6
) / x6 ( end ) ) ) , ’ k ’ , . . .
76
x7 ( c e i l ( ( b7 ) ∗ l e n g t h ( x7 ) / x7 ( end ) ) : f l o o r ( ( b8 ) ∗ l e n g t h ( x7
) / x7 ( end ) ) ) , . . .
A.2 File for interpreting multimeter data, sddata.m
77
27
y7 ( c e i l ( ( b7 ) ∗ l e n g t h ( x7 ) / x7 ( end ) ) : f l o o r ( ( b8 ) ∗ l e n g t h ( x7
) / x7 ( end ) ) ) , ’ k ’ , . . .
78
x8 ( c e i l ( ( b8 ) ∗ l e n g t h ( x8 ) / x8 ( end ) ) : f l o o r ( ( b9 ) ∗ l e n g t h ( x8
) / x8 ( end ) ) ) , . . .
79
y8 ( c e i l ( ( b8 ) ∗ l e n g t h ( x8 ) / x8 ( end ) ) : f l o o r ( ( b9 ) ∗ l e n g t h ( x8
) / x8 ( end ) ) ) , ’ k ’ , . . .
80
x9 ( c e i l ( ( b9 ) ∗ l e n g t h ( x9 ) / x9 ( end ) ) : f l o o r ( ( b10 ) ∗ l e n g t h (
x9 ) / x9 ( end ) ) ) , . . .
81
y9 ( c e i l ( ( b9 ) ∗ l e n g t h ( x9 ) / x9 ( end ) ) : f l o o r ( ( b10 ) ∗ l e n g t h (
x9 ) / x9 ( end ) ) ) , ’ k ’ , . . .
82
x10 ( c e i l ( ( b0 ) ∗ l e n g t h ( x10 ) / x10 ( end ) ) : f l o o r ( ( b1 ) ∗ l e n g t h
( x10 ) / x10 ( end ) ) ) , . . .
83
y10 ( c e i l ( ( b0 ) ∗ l e n g t h ( x10 ) / x10 ( end ) ) : f l o o r ( ( b1 ) ∗ l e n g t h
( x10 ) / x10 ( end ) ) ) , ’ k ’ , ’ l i n e w i d t h ’ , 1 )
84
85 a x i s ( [ 1 e−3 k∗1 e6 2e −13 2e −7]) ;
86 y l a b e l ( ’ S p e c t r a l D e n s i t y [ Amps/Hz ˆ 1 ˆ / ˆ 2 ] ’ ) ;
87 x l a b e l ( ’ Frequency [ Hz ] ’ ) ;
A.2
File for interpreting multimeter data, sddata.m
..
1 %C a l c u l a t e s t he S p e c t r a l D e n s i t y from two c u r r e n t d r i v e r s
connected in
2 %s e r i e s with a . 9 9 5 M Ohm r e s i s t o r t o ground between them .
( D i v i d e s by
28
Chapter A Appendix A: Matlab Code
3 %r e s i s t a n c e t o g e t c u r r e n t and r o o t two t o g e t e r r o r f o r
one d r i v e r . )
4 % Assumes data comes i n m i l l i s e c o n d s and v o l t s columns
5 %Bins e v e r y binnum p o i n t s t o g e t h e r
6 %Returns [ f r e q u e n c y , S p e c t r a l D e n s i t y ]
7
8 f u n c t i o n [ binEdges2 , binMean]= sddata ( f i l e n a m e , R, binnum )
9 data=l o a d ( f i l e n a m e ) ;
10 t=data ( : , 1 ) ;
11 f=data ( : , 2 ) ;
12
13 t r=t . / ( 1 e3 ) ; %change time from m i l l i s e c o n d s t o s e c o n d s
14 f r=f . / (R∗ s q r t ( 2 ) ) ; %d i v i d e t he v o l t a g e by a megaohm t o g e t
t he c u r r e n t
15
%then d i v i d e by s q r t ( 2 ) t o g e t th e
error
16 N=l e n g t h ( t r ) ;
17 t r 2=t r ( 1 ) : ( t r (N)−t r ( 1 ) ) . /N: t r (N) ; %Evenly spaced t i m e s
18 f r 2=i n t e r p 1 ( t r , f r , t r 2 ) ;
%I n t e r p o l a t e d e v e n l y
spaced data
19
20 t r 2=t r 2 ( 1 : 2 ˆ f l o o r ( l o g 2 ( l e n g t h ( t r 2 ) ) ) ) ;
21 f r 2=f r 2 ( 1 : 2 ˆ f l o o r ( l o g 2 ( l e n g t h ( t r 2 ) ) ) ) ;
22
23 N=l e n g t h ( t r 2 ) ; %g e t t h e number o f p o i n t s
24 k=0:N−1;
%c r e a t e a v e c t o r from 0 t o N−1
A.2 File for interpreting multimeter data, sddata.m
25 T=t r 2 (N)−t r 2 ( 1 ) ;
26 f r e q=k/T;
29
%g e t th e f r e q u e n c y i n t e r v a l
%c r e a t e t h e f r e q u e n c y range
27
28
29
30 X=2.∗ abs ( f f t ( f r 2 ) ) / (N∗ s q r t ( ( f r e q (N)−f r e q ( 1 ) ) . /N) ) ; %
n o r m a l i z e th e data , m u l t i p l y by 2 t o g e t amplitude from
cn , d i v i d e by
31 %s q r t d e l t a f t o g e t s p e c t r a l d e n s i t y
32
33 %o n l y want t h e f i r s t h a l f o f th e FFT, s i n c e i t i s
redundant
34 c u t O f f = c e i l (N/2 ) ;
35
36 %t a k e o n l y th e f i r s t h a l f o f t he spectrum ( i g n o r e s f i r s t
v a l u e=dc o f f s e t )
37 X = X( 2 : c u t O f f ) ;
38 f r e q = f r e q ( 2 : c u t O f f ) ;
39
40 w=f r e q ; s p e c t=X;
41
42 %BINNING THE NOISE DATA LINEARLY
43 topEdge = w( l e n g t h (w) ) ; % d e f i n e l i m i t s
44 botEdge = w( 1 ) ; % d e f i n e l i m i t s
45 numBins = f l o o r ( l e n g t h (w) /binnum ) ; % d e f i n e number o f b i n s
46
30
Chapter A Appendix A: Matlab Code
47 binEdges = l i n s p a c e ( botEdge , topEdge , numBins+1) ;
48
49 d s t e p = f l o o r ( l e n g t h ( s p e c t ) /numBins ) ;
50 IndexNum = 1 : d s t e p : l e n g t h ( s p e c t ) ;
51
52
f o r i = 1 : numBins
53
binMean ( i )= mean ( s p e c t ( IndexNum ( i ) : IndexNum ( i )+dstep
−1) ) ;
54
end
55
56 binEdges2=binEdges ( 1 : l e n g t h ( binEdges ) −1) ;
A.3
File for interpreting Oscilloscope data, sdscope
..
1 %C a l c u l a t e s t he S p e c t r a l D e n s i t y from two c u r r e n t d r i v e r s
connected in
2 %s e r i e s with a . 9 9 5 M Ohm r e s i s t o r t o ground between them .
( D i v i d e s by
3 %r e s i s t a n c e t o g e t c u r r e n t and r o o t two t o g e t e r r o r f o r
one d r i v e r . )
4 % Assumes data comes i n m i l l i s e c o n d s and v o l t s columns
5 %Bins e v e r y binnum p o i n t s t o g e t h e r
6 %Returns [ f r e q u e n c y , S p e c t r a l D e n s i t y ]
7
8 %f u n c t i o n [ binEdges2 , binMean]= sddata ( f i l e n a m e , binnum )
A.3 File for interpreting Oscilloscope data, sdscope
31
9 f u n c t i o n [ binEdges2 , binMean]= s d s c o p e ( f i l e n a m e , R, binnum )
10 data=l o a d ( f i l e n a m e ) ;
11 t=data ( : , 1 ) ;
12 f=data ( : , 2 ) ;
13
14 t r=t ; %change time from m i l l i s e c o n d s t o s e c o n d s
15 f r=f . / (R∗ s q r t ( 2 ) ) ; %d i v i d e th e v o l t a g e by R e s i s t a n c e t o
g e t th e c u r r e n t
16
%and by s q r t ( 2 ) f o r two d r i v e r s
17
18 t r 2=t r ( 1 : 2 ˆ f l o o r ( l o g 2 ( l e n g t h ( t r ) ) ) ) ; %Scope Data i s
a l r e a d y e v e n l y spaced
19 f r 2=f r ( 1 : 2 ˆ f l o o r ( l o g 2 ( l e n g t h ( t r ) ) ) ) ;
20
21 N=l e n g t h ( t r 2 ) ; %g e t t h e number o f p o i n t s
22 k=0:N−1;
%c r e a t e a v e c t o r from 0 t o N−1
23 T=t r 2 (N)−t r 2 ( 1 ) ;
24 f r e q=k/T;
%g e t th e f r e q u e n c y i n t e r v a l
%c r e a t e t h e f r e q u e n c y range
25
26 X=2.∗ abs ( f f t ( f r 2 ) ) / (N∗ s q r t ( ( f r e q (N)−f r e q ( 1 ) ) . /N) ) ; %
n o r m a l i z e th e data , m u l t i p l y by 2 t o g e t amplitude from
cn , d i v i d e by
27 %s q r t d e l t a f t o g e t s p e c t r a l d e n s i t y
28
29 %o n l y want t h e f i r s t h a l f o f th e FFT, s i n c e i t i s
redundant
32
Chapter A Appendix A: Matlab Code
30 c u t O f f = c e i l (N/2 ) ;
31
32 %t a k e o n l y th e f i r s t h a l f o f t he spectrum ( i g n o r e s f i r s t
v a l u e=dc o f f s e t )
33 X = X( 2 : c u t O f f ) ;
34 f r e q = f r e q ( 2 : c u t O f f ) ;
35
36 w=f r e q ; s p e c t=X;
37
38 %BINNING THE NOISE DATA LINEARLY
39 topEdge = w( l e n g t h (w) ) ; % d e f i n e l i m i t s
40 botEdge = w( 1 ) ; % d e f i n e l i m i t s
41 numBins = f l o o r ( l e n g t h (w) /binnum ) ; % d e f i n e number o f b i n s
42
43 binEdges = l i n s p a c e ( botEdge , topEdge , numBins+1) ;
44
45 d s t e p = f l o o r ( l e n g t h ( s p e c t ) /numBins ) ;
46 IndexNum = 1 : d s t e p : l e n g t h ( s p e c t ) ;
47
48
f o r i = 1 : numBins
49
binMean ( i )= mean ( s p e c t ( IndexNum ( i ) : IndexNum ( i )+dstep
−1) ) ;
50
end
51
52 binEdges2=binEdges ( 1 : l e n g t h ( binEdges ) −1) ;
Bibliography
[1] C. J. Erickson, M. Van Zijll, G. Doermann, and D. S. Durfee, “An Ultra-High
Stability, Low-Noise Laser Current Driver with Digital Control,” http://arxiv.
org/PS cache/arxiv/pdf/0805/0805.0015v2.pdf (Accessed June 21, 2010)
[2] G. Heinzel, “Spectrum and spectral density estimation by the Discrete Fourier
tansform (DFT), including a comprehensive list of window functions and some
new flat-top windows,” http://www.rssd.esa.int/SP/LISAPATHFINDER/docs/
Data Analysis/GH FFT.pdf (Accessed April 29, 2010).
33
Download