UTiLIA: An Inexpensive Labview Lock in Amplifier


Rescue small signals from a sea of noise

We have implemented a versatile, low-cost digital lock-in analyzer in LabView -- a device capable of extracting small signals, even in the presence of broadband noise several times greater than the signal itself.

The lock-in has a sensitivity of 50 nV, negligible offset drift, and superior robustness against many forms of noise and interference. No specialized hardware is required beyond a general-purpose data acquisition board and a homemade low-noise amplifier -- all signal analysis is done in software.

Any generic low-noise, high gain amplifier that is stable at your reference frequency will work as a front-end. We use a shop-built two-stage amplifier, based on Texas Instruments' INA114 precision instrumentation amplifier, together with a voltage-controlled current source and the lock-in analyzer, to create a nano-ohm meter. [Circuit diagram: pdf; other formats].

Compared to purpose-built equipment, our device has lower cost with reasonable resolution, yet gives increased functionality, excellent flexibility, and the ability to inspect the signal at all stages of processing. This approach is suitable for a variety of applications in research and industry.

You may wish to read a description of the implementation of the Lock-In Amplifier (LIA) and its application in a direct measurement of superconductor resistance. We have some useful references, if you are pursuing a similar project. You may also download the UTiLIA (UT Lock-In Amplifier) program.

Choosing a reference frequency is harder than it seems -- I have a brief discussion of the frequencies in the lock-in and their constraints. The primary limit on the sensitivity of the lock-in is its dynamic range, discussed below.

Jump To:


References

 
Here are some useful references:

More information is available at the course home page (http://www.ph.utexas.edu/~phy453/) or by contacting professor Roger Bengtson (bengtson@physics.utexas.edu).

Sources of, and defenses against, noise:

  1. P. Horowitz and W. Hill, The Art of Electronics. Cambridge University Press, New York, 1980.
  2. Low Level Measurements Handbook, ed. J. Yeager and M.A. Hrusch-Tupta. Keithley Instruments, Cleveland, OH, 1998. An excellent introduction to precision measurement, and Freely available on request.
  3. "Signal Enhancement" Application Note (catalog p.225) Stanford Research Systems, Sunnyvale, CA, 1999. A summary of fundamental noise sources.
  4. S.J. Shah, "Field Wiring and Noise Considerations," Application Note AN025. National Instruments Corp., Austin, TX, 1994.

Lock-in detection:

  1. M. Stachel, "The Lock-in Amplifier: Exploring Noise Reduction and Phase." An excellent web-based introduction to lock-in detection, complete with Java simulations.
  2. P. Temple, Am. J. Phys. 43(9), 801 (1975).
  3. "About Lock-in Amplifiers" Application Note. Stanford Research Systems, Sunnyvale, CA, 1999. A functional description of lock-in amplifiers.
  4. Lock-in Applications Anthology, ed. Douglas Malchow. EG&G Princeton Applied Research, Princeton, NJ, 1985. A freely available guide to applications of the lock-in analyzer.
  5. D.W. Preston and E.R. Dietz, The Art of Experimental Physics. John Wiley & Sons, New York, 1991. Discusses lock-in detection on pp. 367-375.

Data Acquisition:

  1. Data Acquisition Handbook, ed. J. Yeager and M.A. Hrusch-Tupta. Keithley Instruments, Cleveland, OH, 1998. An excellent introduction to data acquisition, and Freely available on request.
  2. We use National Instruments' PCI-MIO-16E-4 (NI 6040E) multifunction I/O board; it has 16 12-bit, 250 kS/s analog inputs; two 12-bit, 1 MS/s analog outputs; and two 24-bit counters. National Instruments, 11500 N. MoPac Expressway, Austin, TX 78759
  3. Our front-end amplifier is based on Texas Instruments' INA114 precision instrumentation amplifier. Other suitable devices include Analog Devices' AD624 and Texas Instruments' OPA111.

Superconductivity:

  1. G.C. Brown, J.O. Rasure, and W.A. Morrison, Am. J. Phys. 57(12), 1142-1144 (1989).
  2. M.J. Pechan and J.A. Horvath, Am. J. Phys. 58(7), 642-644 (1990).
  3. Semiconductor samples available from Colorado Superconductor, 1623 Hillside Drive, Fort Collins, CO 80524.


2002 NIWeek Competition Paper

 
We submitted a paper in 2002 describing the instrument. This is less detailed but more recent than the paper below.

View this paper:
Printable (Adobe Acrobat)
Source (Microsoft Word)
Get figures (high res)


AAPT Apparatus Competition Paper

 
We submitted a paper in 1999 describing the instrument to the AAPT Apparatus Competition. Here is its abstract:

Several interesting experiments in the advanced laboratory require an accurate measurement of a slowly varying, extremely small voltage. Lock-in detection is a powerful technique to recover such a signal, even in the presence of broadband noise whose magnitude is several times greater than the signal itself. We have implemented a versatile, low-cost digital lock-in analyzer completely in software. No specialized hardware is required beyond a general-purpose data acquisition board and a low-noise amplifier, yet the detector has a sensitivity of 20 nV and negligible offset drift. Since all signal processing takes place on the computer, students can display the waveform -- as a time series or power spectrum -- and see it progress through the instrument. We describe the implementation of the lock-in amplifier and describe its use in a measurement of the resistance of a superconductor as it undergoes its superconducting transition. Its versatility, resolution, and teaching utility make this tool excellently suited to the advanced laboratory.

View this paper:
Read on-line (HTML)
Printable (Adobe Acrobat)
Source (Microsoft Word)
Get figures (high & low res)


Download


You may download the full version of our Lock-In code:

UTiLIA Full Version for LabView 6.0

You will have to rework the program to suit your particular application before you can do any actual data acquisition. You may choose to run on a simulated signal or actual acquired data. This code was made with LabView version 6.02, which is a free upgrade from LabView 6.0.

Grab a ZIP File with everything you need
Browse a directory with all the files.

UTiLIA For LabView Player [Simulation Only]

The LabView Player [info; download] will allow you to view the program and its diagram, but not to edit it. If you don't already own LabView, or if you have an incompatible LabView installation, try this version of UTiLIA:

Grab a ZIP File with everything you need
Browse a directory with all the files.

You will get a message about an unsigned certificate; if you are willing to trust that I am me then please click "Accept."

UTiLIA Full Version For LabView 5.0

If you do not have LabView 6 you may try the "Save as version 5" copy.

Grab a ZIP File with everything you need
Browse a directory with all the files.

Unfortunately it seems that this version is pretty broken, and I can't easily fix it. There isn't anything that particularly required LV6, although I did use the new waveform data types -- I just don't have LabView 5 to fix it. If you replace all of the unhappy VI's by their obvious LV5 equivalents you may be able to get it to work. I think yourbest bet is to download the simulation-only version for LabView player above. If, after playing with that, you think the LV5 code will be helpful, contact me and we can figure out a way to regress the code.

Screenshots of simulation version

Here are some LabView printouts of the program.

Front Panel (User view)
Block Diagram (Programming view)

Important Notice: This code is free but carries certain obligations...

This program is released under the Gnu Public License (GPL). You may download and use it for personal or internal use without restrictions. However, if you modify and distribute the code (for example, by selling it or including it with something you sell) you must make the derived source code, including your modifications, publicly and freely available; and you must include the Gnu Public License on any derived works. For more details please see the license.

The UTiLIA program is (C) 1999 Philip Kromer. Last Updated 4/25/2002

 


Frequency Constraints

There are many different frequencies going on in the lock-in amplifier, and there are some hard limits on the reference frequency. The short version:
  1. Choose Fref > 200 Hz if possible, and avoid multiples of 60 Hz at all costs.
  2. A software approach won't work for Fref > 100kHz; hardship and/or expense begin at Fref ~ 30kHz.

Here are some notes for people implementing their own LIA, and will only be helpful if you are somewhat familiar with both the details of the lock-in and a small amount of signal processing.

  1. The sampling frequency should be several times the reference frequency to avoid aliasing. I've found that Fsamp below 8·Fref is unsatisfactory, and that more than Fsamp=32·Fref makes no difference. This is the primary limit on the reference frequency. A low-cost, moderate-data setup -- 200kS/s board, 3 inputs, Fsamp=32·Fref -- can support reference frequencies up to 2 kHz. With fancy hardware and minimal data requirements -- 1.25 MS/s, 1 channel, Fsamp=8·Fref -- you can use reference frequencies up to 156 kHz.
     
  2. [To make later analysis simpler, I am sampling at a direct multiple of the reference. To go closer to the Nyquist limit of Fsamp=2·Fref, use a sampling frequency that is _incommensurate_ with the reference. Otherwise the quantization error will start to appear as a separate and nearby signal. Alternately, use a square wave reference, Fsamp=Fref, and continuous sampling. You will lock in to all the harmonics of the reference frequency, and should adjust the constant of (1/2) in the lock-in procedure. See The Art of Electronics by Horowitz and Hill for more on this technique.]
     
  3. We scan in a "chunk" of reference waveforms and process the whole batch at once. The samples per chunk should be a power of 2 (1024, 2048, ...) so that FFT's are fast. The faster your PC, the smaller the chunks can be. I've been using 214 = 16,384 S/chunk, which is 512 reference cycles for Fs=32·Fref. If this is a problem you can stream to disk for later analysis, or simply do a bare minimum of processing.
     
  4. It's important to avoid discontinuities at the chunk barrier: any discontinuity will appear as noise at the chunk-barrier frequency. If you use either continuous or triggered acquisition there will be no discontinuities -- the best solution. For more work and worse results, you can instead "window" the acquisition and then filter out the windowing frequency.
     
  5. The only lower limit on the reference frequency is the need to sample away from any noise sources. So-called "flicker" noise has a 1/f spectrum: it gets progressively worse at lower frequencies. Frequencies above a couple hundred Hz avoid most of this. You should also avoid line noise at multiples of 60 Hz. Other than that, try a couple nearby frequencies to make sure you don't pick up radio stations or fluorescent light ballasts :-)

 

 


Lock In to an External Reference


It is often necessary to use an external reference with a lock-in amplifier. Stand-alone lock in amplifiers provide the ability to use either an external or internal reference. It is somewhat more difficult to accomplish this with a software lock-in.

The task is much easier if a square-wave sync signal is available -- a square wave whose frequency and phase exactly match the reference. An external TTL phase-locked loop circuit can provide such a sync reference.

One relatively straightforward method is to simply read the sync signal as an analog input along with the other input signals. Find the time interval between leading edges, and construct a series of sine waves whose periods match those time intervals. Unfortunately, the phase jitter may not be controlled to better than 1/Fs, since the sync is only observed at the sampling frequency.

A better, but more difficult, method would use high-resolution counters to determine both the sync frequency and its offset from the beginning of the acquisition chunk. This is hard because managing synchrony of the counter and analog inputs is difficult.

 

 


Use of a lock-in to extract derivatives


A lock-in may also be used to extract derivatives -- harmonics in the frequency domain correspond to derivatives in the time domain...

... under construction.

 

 


About Dynamic Range


Given a good enough amplifier, you can extract an arbitrarily small signal using the Lock in analyzer. The primary limit on the sensitivity of the lock-in is its dynamic range, which in turn is largely determined by the analog-to-digital converter (ADC). A 12-bit linear ADC, set to read a ±0.5V signal, gets only 212 numbers for its 1V range. Thus the smallest signal that may be detected against a ±0.5V background is 1/212= 244 uV. This device is said to have a dynamic range of 212 = 4096, or 36 dB.
                       
  ADC Size   Dynamic Range   Range in dB   Sensitivity
(vs. 1V noise)
 
8 bits 28 256 24 dB 3.90 mV
12 bits 212 4,096 36 dB 244.00 uV
16 bits 216 65,536 48 dB 15.30 uV
20 bits 220 1,048,576 60 dB 0.95 uV
24 bits 224 16,777,216 72 dB 0.06 uV
                       

 

Valid HTML 4.01! The UTiLIA program is (C) 1999 Philip Kromer, flip -at- mrflip com.
Last Updated: 4/25/2002.