Lock in Amplifier

25
The Lock-in Amplifier Brian Leach Lab Partner Ferdinand van Wyk Py3107 10/12/10

description

Description/Results of an experiment using a lock in amplifier to filter out noise from a signal.

Transcript of Lock in Amplifier

Page 1: Lock in Amplifier

The Lock-in Amplifier

Brian LeachLab Partner Ferdinand van Wyk

Py310710/12/10

Page 2: Lock in Amplifier

Introduction

The lock-in amplifier is used to detect signals which would otherwise be undetectable due to a low signal to noise ratio. It uses a filter to focus on the part of the spectrum with the same frequency as the signal which is to be detected. It then uses phase sensitive filtering to filter out noise which does not have the same phase as the desired signal.

In this experiment an oscilloscope is used to examine the frequency response of the preamplifier module of the lock-in amp for different gain settings.

The frequency response of the Filter module is examined and the Kramers-Kronig phase relation is also examined for different Q settings.

A flashing LED is used as a test signal, the Lock-in amp is used to detect the LED signal at distances at which noise would normally block detection.

The speed of sound in air is found to be 353 ± 6 m s-1 by tracing out sound waves using a speaker, microphone and the lock-in amplifier.

Part 1Gain Characteristics of the Preamplifier

In order to find the frequency response of the preamplifier module frequencies from 1Kz to 1MHz were generated using an external signal generator. The signal generator was connected to the non inverting preamp input, the inverting input was shorted to ground, the input and output peak to peak voltages were measured simultaneously using a two channel oscilloscope.

The results are tabulated and graphed below to show the frequency response of the preamplifier at gain settings of 1, 10, 100 and 1000.

Page 3: Lock in Amplifier

Table 1. Gain characteristic at gain = 1Frequency

(Hz)Input Voltage

(V)Output Voltage

(V) Error (V) Gain(+/- )

1 0.312 0.334 0.002 1.0710 1.08 1.08 0.01 1.00

100 1.2 1.21 0.01 1.011000 1.12 1.15 0.01 1.03

10000 1.12 1.12 0.005 1.00100000 1.12 1.13 0.01 1.01200000 1.12 1.25 0.01 1.12300000 1.12 1.6 0.01 1.43400000 1.12 1.46 0.02 1.30500000 1.12 1.17 0.02 1.04600000 1.12 0.96 0.02 0.86700000 1.12 0.8 0.01 0.71800000 1.12 0.7 0.01 0.63900000 1.12 0.6 0.01 0.54

1000000 1.12 0.54 0.01 0.48

1 10 100 1000 10000 100000 10000000.20

2.00

Frequency (Hz)

Gai

n

Figure 1. Frequency response at gain = 1

Page 4: Lock in Amplifier

Table 2. Gain characteristic at gain = 10Frequency /

HzInput Voltage

(V)Output

Voltage (V) Error (V) Gain(+/- )

1 0.31 3.11 0.01 10.0310 1.06 10.5 0.1 9.91

100 1.17 11.6 0.1 9.911000 1.12 11.1 0.1 9.91

10000 1.12 10.8 0.1 9.64100000 1.12 6.4 0.01 5.71

1000000 1.12 0.56 0.01 0.50

1 10 100 1000 10000 100000 10000000.15

1.50

15.00

Frequency (Hz)

Gai

n

Figure 2. Frequency response at gain = 10

Table 3. Gain characteristic at gain = 100Frequency

(Hz)Input Voltage

(V)Output

Voltage (V) Error (V) Gain(+/- )

1 0.055 5.28 0.01 96.0010 0.182 18.2 0.1 100.00

100 0.204 20 0.1 98.041000 0.196 19.2 0.1 97.96

10000 0.194 15.6 0.1 80.41100000 0.194 6.8 0.2 35.05

1000000 0.194 0.56 0.01 2.89

Page 5: Lock in Amplifier

1 10 100 1000 10000 100000 1000000

1.20

12.00

120.00

Frequency (Hz)

Gai

n

Figure 3. Frequency response at gain = 100

When it came to measuring the gain characteristic of the gain setting = 1000 even the smallest out put amplitude of the frequency generator was high enough to cause clipping of the output of the preamp. For this reason the attenuator module built into the lock-in amplifier was needed. Because this module has its own frequency response and may not attenuate all frequencies equally it was necessary to measure the frequency response of the attenuator alone first, then the output of the attenuator was connected to the preamp input and the frequency response of the two units in series was found. By dividing the frequency response of this system by the frequency response of the attenuator the true frequency response of the preamp gain setting = 1000 was found.

Table 4. Gain characteristic at Attenuator = 100Frequency

(Hz)Input Voltage

(V)Output Voltage

(V) Error (V) Gain(+/- )

1 1Hz Could not be measured due to excessive noise on the signal10 2.11 0.024 0.001 0.011374408

100 2.31 0.025 0.001 0.0108225111000 2.22 0.023 0.001 0.01036036

10000 2.24 0.024 0.001 0.010714286100000 2.22 0.02 0.001 0.009009009

1000000 2.22 0.008 0.001 0.003603604

Page 6: Lock in Amplifier

10 100 1000 10000 100000 1000000

0.005

Frequency (Hz)

Ga

in

Figure 4. Frequency response at attenuator = 100

Table 5. Gain characteristic of Attenuator = 100 and gain = 1000Frequency /

HzInput

Voltage / VOutput

Voltage / V error error Gain(+/- )

1 0.616 2 0.001 0.1 3.2510 2.14 20 0.01 0.3 9.35

100 2.35 24 0.03 0.3 10.211000 2.25 20 0.03 0.3 8.89

10000 2.27 5.51 0.03 0.1 2.43100000 2.22 1.39 0.01 0.01 0.63

1000000 2.22 0.018 0.01 0.004 0.01

10 100 1000 10000 100000 10000000.00

0.01

0.10

1.00

10.00

100.00

Frequency (Hz)

Gai

n

Figure 5. Frequency response of attenuator = 100 and gain = 1000

Page 7: Lock in Amplifier

Table 6. Calculated gain characteristic at gain = 1000Frequency (Hz) Gain

10 822100 9441000 85810000 227100000 69.51000000 2.25

10 100 1000 10000 100000 1000000

1

15

150

1500

Frequency (Hz)

Ga

in

Figure 6. Calculated Frequency response of gain = 1000

Higher frequencies are clearly not amplified effectively for all the gain settings, however the higher the gain setting is, the sooner the effectiveness of the preamp dips as the frequency is increased. The following graph shows the frequency for which the gain drops to half the desired amount in each case. This is the same as a drop of 3dB or a halving of the volume of an audio signal.

Page 8: Lock in Amplifier

1 10 100 10001

10

100

1000

-3dB frequency (kHz)

Gain setting

Figure 7. Frequencies above which the preamp fails to amplify as expected.

Clearly the price we pay for using high gain settings is a limited effective range of amplification: the higher the gain setting, the smaller the range of frequencies that are amplified effectively.

Part 2Gain Characteristics of the Filter.

To examine the frequency response of the band pass filter module of the lock-in amplifier the following setup was used:

The filter was set to 300Hz and the same procedure was followed as is part 1 for different values of Q, the quality factor of the filter, which determines how sharply frequencies either side of the resonance frequency are attenuated.

The results are tabulated and graphed for Q = 2, 5, 50 as well as the Chebyshev, Butterworth and Bessel settings below.

Page 9: Lock in Amplifier

Table 7. Gain at given frequencies for Q=2,5,50Q = 2

Frequency (Hz)

Input Voltage (V)

Output Voltage (V)

In error (V)

Out error (V) Gain

Gain Error

100 0.244 0.098 0.002 0.002 0.40 0.01150 0.238 0.16 0.002 0.002 0.67 0.01200 0.238 0.256 0.002 0.002 1.08 0.01250 0.236 0.396 0.002 0.002 1.68 0.02300 0.236 0.472 0.002 0.002 2.00 0.02350 0.236 0.398 0.002 0.002 1.69 0.02400 0.236 0.308 0.002 0.002 1.31 0.01450 0.236 0.246 0.002 0.002 1.04 0.01500 0.236 0.204 0.002 0.002 0.86 0.01750 0.23 0.108 0.002 0.002 0.47 0.011000 0.23 0.08 0.002 0.002 0.35 0.01

Q = 5

Frequency (Hz)

Input Voltage (V)

Output Voltage (V)

In error (V)

Out error (V) Gain

Gain Error

100 1 0.39 0.01 0.004 0.39 0.01150 0.964 0.664 0.004 0.004 0.69 0.01200 0.96 1.15 0.004 0.01 1.20 0.01250 0.96 2.35 0.004 0.01 2.45 0.01300 0.956 4.8 0.004 0.04 5.02 0.05350 0.953 2.7 0.004 0.02 2.83 0.02400 0.956 1.62 0.002 0.01 1.69 0.01450 0.956 1.15 0.002 0.01 1.20 0.01500 0.956 0.924 0.002 0.004 0.97 0.00750 0.956 0.48 0.002 0.004 0.50 0.001000 0.952 0.334 0.004 0.002 0.35 0.00

Q = 50

Frequency (Hz)

Input Voltage (V)

Output Voltage (V)

In error (V)

Out error (V) Gain

Gain Error

100 1 0.392 0.01 0.001 0.39 0.00150 0.968 0.664 0.001 0.004 0.69 0.00200 0.964 1.19 0.004 0.01 1.23 0.01250 0.956 2.68 0.004 0.02 2.80 0.02300 0.956 24 0.004 0.1 25.10 0.15350 0.956 3.22 0.004 0.02 3.37 0.03400 0.956 1.72 0.002 0.02 1.80 0.02450 0.956 1.19 0.002 0.01 1.24 0.01500 0.956 0.928 0.002 0.02 0.97 0.02750 0.956 0.48 0.002 0.004 0.50 0.00

Page 10: Lock in Amplifier

Table 8. Gain at given frequencies for Chebyshev, Butterworth and Bessel FiltersChebyshev:

Frequency (Hz)

Input Voltage

(V)

Output Voltage

(V)

In error (V)

Out error (V)

Gain Gain Error

100 0.84 0.124 0.01 0.003 0.148 0.004150 0.808 0.238 0.003 0.003 0.295 0.004200 0.808 0.315 0.003 0.003 0.390 0.004250 0.804 0.38 0.003 0.003 0.473 0.004300 0.804 0.41 0.003 0.003 0.510 0.004350 0.804 0.392 0.003 0.003 0.488 0.004400 0.804 0.36 0.003 0.003 0.448 0.004450 0.808 0.324 0.003 0.003 0.401 0.004500 0.808 0.29 0.003 0.003 0.359 0.004750 0.808 0.187 0.003 0.003 0.231 0.004

1000 0.808 0.14 0.003 0.003 0.173 0.004

Butterworth:Frequency

(Hz)Input

Voltage (V)

Output Voltage

(V)

In error (V)

Out error (V)

Gain Gain Error

100 0.84 0.126 0.01 0.003 0.150 0.004150 0.816 0.205 0.003 0.003 0.251 0.004200 0.808 0.253 0.003 0.003 0.313 0.004250 0.808 0.284 0.003 0.003 0.351 0.004300 0.808 0.293 0.003 0.003 0.363 0.004350 0.808 0.288 0.003 0.003 0.356 0.004400 0.808 0.274 0.003 0.003 0.339 0.004450 0.808 0.258 0.003 0.003 0.319 0.004500 0.808 0.238 0.003 0.003 0.295 0.004750 0.808 0.172 0.003 0.003 0.213 0.004

1000 0.808 0.135 0.003 0.003 0.167 0.004

Bessel:Frequency

(Hz)Input

Voltage (V)

Output Voltage

(V)

In error (V)

Out error (V)

Gain Gain Error

100 0.84 0.124 0.01 0.003 0.148 0.004150 0.816 0.186 0.003 0.003 0.228 0.004200 0.808 0.217 0.003 0.003 0.269 0.004250 0.808 0.234 0.003 0.003 0.290 0.004300 0.808 0.238 0.003 0.003 0.295 0.004350 0.808 0.236 0.003 0.003 0.292 0.004400 0.808 0.228 0.003 0.003 0.282 0.004450 0.808 0.218 0.003 0.003 0.270 0.004500 0.808 0.206 0.003 0.003 0.255 0.004

Page 11: Lock in Amplifier

750 0.808 0.16 0.003 0.003 0.198 0.0041000 0.808 0.128 0.003 0.003 0.158 0.004

The Frequency response graphs in order of increasing Q:

100 1000

0.000

0.050

0.100

0.150

0.200

0.250

0.300

0.350

Figure 8. Bessel Filter Frequency response.

100 1000

0.000

0.050

0.100

0.150

0.200

0.250

0.300

0.350

0.400

Figure 9. Butterworth Filter frequency response.

100 1000

0.000

0.100

0.200

0.300

0.400

0.500

0.600

Page 12: Lock in Amplifier

Figure 10. Chebyshev Filter frequency response.

100 1000

0.00

0.50

1.00

1.50

2.00

2.50

Figure 11. Q=2 Filter Frequency response.

100 1000

0.00

1.00

2.00

3.00

4.00

5.00

6.00

Figure 12. Q=5 Filter Frequency response.

100 1000

0.00

5.00

10.00

15.00

20.00

25.00

30.00

Figure 13. Q=50 Filter Frequency response.

Page 13: Lock in Amplifier

The Kramers-Kronig relation applied to a band pass filter tells us that the filtered signal will be in phase with the original signal when the frequency of the two are equal. The phase shift of the filtered signal was measured on an oscilloscope to show this is the case.

Table 9. Phase shift for given frequencies for Q=2, 50Q = 2

Frequency (Hz)

Time for one wavelength (ms) error

Difference (ms) error

Phase (deg)

100 10 0.04 -2.3 0.04 -82.80150 6.64 0.04 -1.32 0.04 -71.57200 5.04 0.04 -0.84 0.04 -60.00250 4.04 0.04 -0.44 0.04 -39.21300 3.32 0.02 -0.032 0.008 -3.47350 2.84 0.04 0.24 0.02 30.42400 2.5 0.04 0.32 0.02 46.08450 2.22 0.04 0.35 0.02 56.76500 2 0.04 0.36 0.02 64.80750 1.33 0.04 0.29 0.02 78.50

1000 1 0.04 0.22 0.02 79.20

Q =50

Frequency / Hz

Time for one wavelength (ms) error

Difference (ms) error

Phase (deg)

100 10 0.04 -2.6 0.04 -93.60150 6.64 0.04 -1.72 0.04 -93.25200 5.04 0.04 -1.24 0.04 -88.57250 4.04 0.04 -0.96 0.02 -85.54300 3.32 0.02 -0.5 0.02 -54.22303 3.3 0.02 -0.21 0.02 -22.91304 3.28 0.02 -0.03 0.01 -3.29307 3.24 0.02 0.38 0.02 42.22310 3.24 0.02 0.54 0.02 60.00320 3.14 0.02 0.66 0.02 75.67350 2.84 0.04 0.7 0.02 88.73400 2.5 0.04 0.62 0.02 89.28750 1.33 0.04 0.33 0.01 89.32

1000 1 0.04 0.248 0.01 89.28

Page 14: Lock in Amplifier

100 1000

-100.00

-80.00

-60.00

-40.00

-20.00

0.00

20.00

40.00

60.00

80.00

100.00

Figure 14. Phase shift versus frequency for Q=2

100 1000

-150.00

-100.00

-50.00

0.00

50.00

100.00

150.00

Figure 15. Phase shift versus frequency for Q=50.

Figures 14 and 15 illustrate that the phase shift of the filtered signal goes from negative to positive more quickly for higher values of Q and is only in phase when the input signal is equal to the filter frequency.

Part 3Light Detection using the Lock-in

The reference oscillator was connected to a led. A photodiode detector was used to detect the signal. It was found that

Page 15: Lock in Amplifier

Figure 15. With the detector connected directly to the oscilloscope a signal amplitude of only 10mV registered on the oscilloscope.

Page 16: Lock in Amplifier

Figure 16. Connecting the photo diode to the preamplifier at gain = 1000 greatly improved the amplitude of the detected signal on the oscilloscope to ~ 7V.

Figure 17. Using a square wave instead of a sine wave visibly increased the brightness of the LED. This is evident here where the amplitude of the detected

Page 17: Lock in Amplifier

signal is increased to ~ 10V. The signal is also easier to identify. As a result the rest of the experiment was carried out with a square wave powering the LED.

This increase in brightness is due to the properties of the LED, namely the ‘cut-in’ voltage below which the LED will not light. A large proportion of the sine wave is below this voltage while the small rise time of the square wave means it is above the ‘cut-in’ voltage for longer. The LED is on for longer with the square wave so it is brighter and easier to detect.

Figure 18. This is the signal detected using the preamp only, with gain=1000. The signal was detected at a distance of 16cm from the source LED. When the LED was moved any further away the signal could not be discriminated from the noise.

Using the lock-in amplifier the signal could be detected much farther away. With the ‘low pass filter/amplifier’ gain set to 1 the following voltages versus distances were recorded using a multimeter.

Table 10. Distance of detector versus voltage recorded.Distance (m) Voltage (V)(+/- 0.002m) (+/- 0.005V)

0.16 1.0500.3 0.4800.6 0.3000.9 0.2701.2 0.2601.4 0.256

Page 18: Lock in Amplifier

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.60

0.2

0.4

0.6

0.8

1

1.2

Distance (m)

Vol

tage

Mea

sure

d (V

)

Figure 19. Distance of detector versus Voltage recorded.

Using the lock-in detector meant the signal could be detected 8 times further away than could be achieved using the preamplifier alone. Table 10 only ends at 1.4m because this was the length of the test track used. In fact the signal could be detected by reflecting the LED off the wall in the lab.

Noise

Figure 20. With the LED off, the 100Hz Flicker of the fluorescent Lights in the lab was detected with the photodiode. This is an example of the type of noise that we are trying to filter out with the Lock-in Amplifier.

Page 19: Lock in Amplifier

Part 4Measuring the Speed of Sound in Air

Replacing the LED with a Small Speaker and the photo sensor with a microphone it was possible to measure the speed of sound in air.

(1)C=f λ

Gives the relationship between the frequency, f, and wavelength, λ, of a wave where the speed of the wave is c.

By placing the speaker and microphone on a track the length of a sound wave was traced out by moving the microphone along the track. Initially the microphone was placed close to the speaker and the phase shift of the lock-in amp was adjusted until the ‘low pass filter amplifier’ read zero. The microphone was moved away from the speaker until the ‘low pass filter amplifier’ read zero again, this corresponds to the microphone having traced out half a wavelength of the sound wave. The track was long enough to measure several wavelengths. This distance was multiplied by the frequency of the wave, which was read off the oscilloscope to give the speed of the wave. This was repeated for several frequencies, each time the filter of the lock-in amplifier had to be set to the same frequency that was being measured.

Figure 21. Part 4 experimental set up.

Page 20: Lock in Amplifier

Table 11. Calculating the speed of sound in air.

Frequency (Hz)

Position 1 (m)

Position 2 (m)

Number of wavelengths

Wavelength (m)

Wavelength Error (m)

Speed (m/s)

Error (m/s)

3320 0.156 1.423 12 0.1056 0.0003 351 23130 0.224 1.341 10 0.1117 0.0004 350 22520 0.211 1.315 8 0.1380 0.0005 348 22000 0.186 1.084 5 0.1796 0.0008 359 21500 0.221 1.15 4 0.2323 0.0010 348 31000 0.15 1.234 3 0.3613 0.0013 361 4

Frequency (Hz)

Position 1 (m)

Position 2 (m)

Number of wavelengths

Wavelength (m)

Wavelength Error (m)

Speed (m/s)

Error (m/s)

3320 0.156 1.423 12 0.1056 0.0003 351 23130 0.224 1.341 10 0.1117 0.0004 350 22520 0.211 1.315 8 0.1380 0.0005 348 22000 0.186 1.084 5 0.1796 0.0008 359 21500 0.221 1.15 4 0.2323 0.0010 348 31000 0.15 1.234 3 0.3613 0.0013 361 4

The Error in Wavelength was calculated using(2)

Δλ=√( 0.004P1−P2 )

2

The error in the speed of sound was calculated using(3)

Δc=√¿¿

Taking the Standard deviation and average of the results obtained for the speed of sound:

Speed of sound in air = 353 ± 6 m s-1

The speed of sound is generally regarded to be 350m s-1 but this is dependent on air temperature and pressure.