Wavelet Analysis
Getting Started
(View the complete code for this example.)
Fourier transform infrared (FT-IR) spectroscopy is an important tool in analytic chemistry. The following example demonstrates wavelet analysis applied to an FT-IR spectrum of quartz (Sullivan 2000). The following DATA step creates a data set that contains the spectrum, expressed as an absorbance value for each of 850 wave numbers:
data quartzInfraredSpectrum;
WaveNumber=4000.6167786 - _N_ *4.00084378;
input Absorbance @@;
datalines;
4783 4426 4419 4652 4764 4764 4621 4475 4430 4618
4735 4735 4655 4538 4431 4714 4738 4707 4627 4523
4512 4708 4802 4811 4769 4506 4642 4799 4811 4732
4583 4676 4856 4868 4796 4849 4829 4677 4962 4994
... more lines ...
43341 41111 36131 35377 34431 31679 29237 26898 24655 22417
19876 17244 15176 12575 10532 8180 6040 4059 2210 575
;
The following statements produce the line plot of these data, which is displayed in Figure 1:
proc sgplot data=quartzInfraredSpectrum;
series x=WaveNumber y=Absorbance;
xaxis reverse min=0;
yaxis values=(0 to 70000 by 10000);
run;
Figure 1: FT-IR Spectrum of Quartz

These data contain information at two distinct scales, namely a high-frequency oscillation superimposed on a low-frequency curve. Notice that the oscillation is not uniform but occurs in several distinct bands. Wavelet analysis is an appropriate tool for providing insight into this type of data, because it enables you to identify the frequencies present in the absorbance data as the wave number changes. This property of wavelets is known as "time frequency localization"; in this case, the role of time is played by WaveNumber. Also note that the dependent variable Absorbance is measured at equally spaced values of the independent variable WaveNumber. This condition is necessary for the direct use of the discrete wavelet transform that is implemented in the SAS/IML wavelet functions.