You are on page 1of 7

t := 0 ..

127

noise := 0

Amp1 := 1

Frequency1 := 10 t

Amp2 := 1

Frequency2 := 50

This is your "DATA" x := Amp1 sin Frequency1 2


t

+ Amp2 sin Frequency2 2 t + rnd( noise ) noise 127 127 2


N := last( c) N = 64 j := 0 .. N

Take Fourier transform of the "Data" Build a digital filter fleft := 5 Data
2

c := fft( x )

fright := 15

filter := if ( fleft < j < fright , 1 , 0 ) j FFT of Data


5 cj

xt

filter j

50 t

100

20 j

40

60

Apply digital filter to frequency data to remove all unwanted frequency components (i.e. NOISE) Cleaned-up Data
2 5 1 Xt 0 1 2 0 50 t 100 0 kj

k := c filter
j j

X := ifft( k )

FFT of the cleaned-up "DATA"

20 j

40

60

CHEMISTRY DEPARTMENT UNIVERSITY OF NORTH CAROLINA AT CHARLOTTE PHYSICAL CHEMISTRY LABORATORY


EXPERIMENT 17: INTRODUCTION TO CORRELATION TECHNIQUES FOR DATA EXTRACTION
Prerequisite: PHYS 2231L Required Reading: Digital Data Handling of Spectra Utilizing Fourier Transforms, Gary Horick, Analytical Chemistry 44 (6), 943 1972. Stanford Research SR810 Lock-in-Amplifier Manual, pp. 3-1 through 4-28. There is a copy in Burson 276. Tektronix TDS 420A Digitizing Oscilloscope Manual, Sections 1 and 2, and the Fast Fourier Transform section in the appendix. There is a copy in Burson 276.
Introduction

The scientific process is about understanding our observations of the natural world. If something cant be measured by any known or hypothesized method, then its study is not scientific. But what is a measurement and how well do our observations record what nature has provided? The concepts of accuracy and precision should be familiar to you from introductory science laboratories. However, the meaning and significance of a measurement is all too often not examined by even our more advanced students. Random errors and noise limit our ability to measure reality. In fact, it is impossible to make a measurement with infinite accuracy (remember what Heisenberg had to say about this). This laboratory exercise is meant to be an introduction to several techniques that help scientists extract a very small signal from a less than ideal observation (i.e., a measurement with a lot of noise). For our discussion here we will consider any part of the signal that we are not interested in to be noise. You will get a much more complete discussion of noise when you take instrumental analysis. For many of the various types of experiments in chemistry, we make our observations via some type of transducer. A transducer changes the wanted observation (e.g.; pressure, temperature, absorbance, pH, concentration) to a measurable quantity. The quantities of interest include: voltages, currents, capacitance and charge. The ideal voltmeter has infinite input impedance. However, there is no such device. The simple act of measuring the voltage of your transducer will change its value. Similar statements can be made for current measurements and so on. Although our measurements are not perfect, with todays instrumentation they are pretty gosh-darn good! Then nature gets us again by putting noise on our measured signals. When the signal to noise ratio (S/N) is large (i.e. >20) we can usually live with the noise and just report our measurements to whatever level of significance we can attain. However, sometimes the signal we measure is buried within the noise and we can not use the 77

data. This laboratory will introduce you to methods designed to extract small signals from large background noise or other deleterious artifacts. The most common way to extract a small signal from a noisy measurement is by filtering the data. You should be familiar with various types of filters from your introductory physics or engineering courses. The simplest filter is a low-pass filter constructed from a resistor and a capacitor (refer to any physics text for more background). You can easily build a low-pass filter (which attenuates the high frequency noise), or a high-pass filter (which attenuates the low frequency noise), or a band-pass filter (which attenuates all frequencies except the ones about your signal of interest), or a notch filter (which attenuates frequency components that you dont want, such as 60 Hz line noise). If you were measuring a DC (0 Hz) signal and you werent in a hurry, you would use a low-pass filter with a very large RC time constant. This will give you a very clean result, and is the same as taking many measurements and averaging them together. More often than not, the measurement you are making is of a signal that does not stay constant forever (besides, who has the time to waste?). There are two major problems with these types of filters. Firstly, if you filter the data before you record it, you will not have access to the raw data. Secondly, filters can change what your data looks like. If you are looking for a fast pulse of fluorescence as a function of time, a filter will alter the amplitude of the pulse and shift its position relative to others (although the signal will have less noise). The term correlation, with regard to the measurement and analysis of data, refers to the process of correlating your unknown signal with a known reference signal. Correlation techniques are ubiquitous. In fact by the strictest definition, filters are also correlating devices. We are going to focus our attention on two of the three most commonly used correlation techniques; the lock-in-amplifier and the Fourier transform (the third being the box-car integrator which you will use in Experiment 6). Fourier Transform: Fouriers theorem states that any periodically occurring signal (e.g. a series of pulses from a LASER) can be constructed from a series of sinusoidal waves with frequencies of n0 (n = 0,1,2) and amplitudes an and bn. For ease of discussion consider sine and cosine functions of time, t, which are periodic every 2 radians, so that
f( t ) =
a0 + a n cos( n 0 t ) + b n sin( n 0 t ) 2 n =1 n =1

. (1)

The amplitudes an and bn are calculated from


an = 0

f( t ) cos( n 0 t ) dt

bn = 0

f( t ) sin( n 0 t ) dt
(2)

Figure 1 illustrates the synthesis of a square wave by adding harmonics of sine waves with amplitudes bn.

78

Figure 1: Fourier synthesis of a square wave with successive additions of sine waves with odd multiples of the fundamental frequency.

From this figure you should realize that a square wave is actually made up of many sine waves. In order to reproduce the sharp edges of the square wave there must be a significant contribution from high frequency sine waves. If we plot the amplitudes bn as a function of frequency we get a result that resembles a histogram as shown in Figure 2. Figure 2: Pseudo Fourier transform of a square wave. Amplitude of frequency components versus frequency.

|b|

The process of going from the time domain function in Fig. 1 to the frequency domain data in Fig. 2 is called the Fourier transform. This transform is based on Fouriers theorem as discussed above. It should be noted that this transform is general and one can convert back and forth between conjugate variable such as time and frequency (think about the units of these quantities). You can also transform between 79

real space and reciprocal space as is done in diffraction studies. This is also used to transform between position and momentum. These conjugate variables should remind you of Heisenberg. The preceding discussion described the discrete Fourier transform, where there are a finite number of frequency components being analyzed. In real data, there are a continuous number of frequency components mostly because noise is present at all frequencies and is not quantized. To handle this, we replace the summation in Eq. 1 with an integral. Also, using Eulers law we can combine the cosine and sine series into a complex exponential function, yielding the integral Fourier transform, 1 g() = f ( t ) e it dt 2 (3) f (t) =

g() e

it

Solving these equations is typically difficult, but under special conditions one typically uses an algorithm called the fast Fourier transform (FFT) and the inverse FFT (IFFT). If we consider the 50 Hz component of the signal to be noise (line noise) then the original data has a S/N = 1. Yet with the FFT digital filter we are able to recover the 10 Hz signal of interest (with the correct amplitude). In Appendix B we attempt the same filtering process but with the addition of some random noise to our data. Do you observe any difference in the result? Lock-in-Amplifier: The lock-in-amplifier is also a correlation technique, where you are correlating an unknown signal containing many frequency components with a known reference signal at a specific modulation frequency. A nice discussion of the lock-in technique is in the SRS 810 user manual. The important point to realize is that with this instrument you are locking-in on and extracting out the frequency component that you are interested in. All other frequency components are not amplified and do not influence the precision of the measurement.
Experimental

This experiment is designed to be discovery based. There is no cookbook by which to follow. You will figure out how to use the equipment. You will figure out what experiments should be done. Because of limited resources, we must work in small groups on several of the experiments in this course. A common problem under these circumstances is that some people get left out of the learning process. Do your best to get the most out of your lab experience. This lab has three components; simulation of the FFT filter process with MATHCAD, analysis of signal with the digital oscilloscope and FFT math function, and analysis of these same signals with the SRS 810 lock-in-amplifier. You have two lab periods to complete this experiment. You must read the required materials before coming to lab (preparation is the best way to get the most out of your lab experience). 80

The signals you are measuring are not dangerous. The electronic equipment you are using is robust. It would be very difficult for you to get hurt or for you to break any thing during this lab (but dont try to break it, please). You will get more out of this lab if you allow yourself to play with the instruments, so dont be timid! Simulation of FFT process: Within the P-Chem Lab folder on the computer there is a Mathcad worksheet FFT of signal with noise. Double-click on this file to launch Mathcad. The vector xi is constructed of three components; two sine waves and some random noise. You can adjust the amplitude of all three components and the period of the sine waves. You should explore all of these parameters (including the filter shape) and report on the effectiveness of the filtering process. (Nyquists theorem will not let you analyze data with frequencies greater than 63Hz). 1. FFT of a real signal with the DSO: Use the Tektronics digital storage oscilloscope (DSO) to measure the properties of various waveforms generated by the HP function generator (look at the sine, square and triangle waveforms). Start with frequencies around 100 Hz. Oscilloscopes take some time to figure out how to use. The best way to proceed is to play with it while looking at the manual (I will help you get started). After you understand the amplitude and frequency properties of the waveforms in both the time domain and frequency domain you should clearly understand Fouriers theorem and the Fourier transform. You can save your data to a diskette and analyze it later using any spreadsheet program (e.g. Axum or Excel). In the folder Sound Data there are ten files containing the signal from different notes from a harmonica. These notes can be played back using the program Sound Recorder (located in the P-Chem Lab folder). Connect the system so that you can both hear the sounds and the signal from the amplifier is being fed into the DSO. Analyze all of these signals in both the time and frequency domain. These are your standards. Everyone will be assigned an Unknown signal. I have constructed these by combining more than one of the standards into a convoluted signal. Your job is to deconvolute the signal (part of your grade will be based on your analysis of your unknown). The unknowns are found in the folder Unkowns. These exercises are not just academic. Many common analytical techniques use the Fourier Transform to both analyze and acquire data. In the folder NMR FIDs are data files of the free induction decay (FID) of the pulsed FT-NMR spectra for acetone and ethanol. Use the Sound Recorder to play back this data. With the DSO you can analyze the time and frequency domains of this data. The FFT can help you extract the frequency components out of the FID. You can also explore the phase information within the data. Compare your results to the NMR spectra from the literature (given as an appendix in this lab manual). Make sure you save some of your scope traces so that you can include them in your lab write-up (all the data will be slightly different so I shouldnt see identical data between different groups). If you have time, you can analyze some of your data with the cursors on the DSO. 2. Lock-in-amplification of some real signals: (Some of you will be doing this part first) Use the SRS810 lock-in-amplifier to look at the waveforms from the HP function

81

generator (look at the sine, square and triangle waveforms). You will need to use the same signal to drive the reference signal on the lock-in. Usually, the reference signal is the modulation that you use to take your data (i.e., the chopper frequency for a laser experiment or the voltage modulation frequency for an electrochemistry experiment). The lock-in only measures one frequency component at a time. Use the HARM# control to sweep through the numerous harmonics within each waveform. You can use this amplitude data to evaluate how the function generator creates each of these different waveforms. You will need this data for your write-up so make these measurements with careful consideration of both accuracy and precision. Remember, the lockin reports RMS amplitudes, not peak-to-peak (the RMS value of a 2 Vp-p sine wave is 0.5). You will be expected to compare the amplitude of the frequency component of the square and triangular waveforms to those theoretically expected from Fouriers theorem. Try to measure some of the signal in Sound Data or NMR FIDs using the lock-inamplifier. What do you conclude from this experience? This section of the lab will take less time than Section 1, therefore you should go on to Section 1 after you are sure you have done a thorough investigation. You can use one of the computers in the resource room to explore the worksheet stored on the diskette provided (use your own diskette to save your data).
Laboratory Report

Submit a write-up of this lab using standard journal format. If you are unfamiliar with what a journal article looks like, go to the periodicals section of the library to see some examples (you might want to do a literature search on your favorite faculty member to see just how brilliant they really are). The write-up should contain an abstract (summary of results), introduction (what you are doing and why, what are you trying to learn?), results (simulation of FFT process, examples of time frequency domain conversion, PID analysis), discussion (analysis of your unknown, derivation of frequency components for a triangular wave and a comparison with your results, comparison of FFT oscilloscope versus lock-in-amplifier) and a conclusion (not just the same thing as your abstract). You must address these points in your write-up: What is the minimum S/N before digital FFT filtering gives you poor results? What technique gives you the best frequency resolution? What technique gives you the most accurate amplitudes of frequency components in a complex waveform? Can you use a lock-in-amplifier to measure transient data? What technique would be best? With what frequencies was your unknown composed? Support your conclusion. Derive the amplitudes of the frequency components of the square and triangular waveforms using Eq. 2. Compare these theoretical values with your experimentally determined results from the FFT DSO and the lock-in-amplifier. Discuss the analysis of the FT-NMR FIDs.

82

You might also like