Wavelet Analysis

Wavelet Coefficient Plots

Diagnostic plots greatly facilitate the interpretation of a wavelet decomposition. One standard plot is the sequence of detail coefficients by level. By using a module that is defined by the WAVINIT macro call, you can produce the plot shown in Figure 4 as follows:

call coefficientPlot(decomp) header="Quartz Spectrum";

Figure 4: Detail Coefficients Scaled by Level

Detail Coefficients Scaled by Level


The first argument to the COEFFICIENTPLOT module is required; it specifies the wavelet decomposition. Other arguments are optional and need not be specified. This example uses a named argument to specify the header that appears at the top of the coefficient plot.

You can use the WAVHELP macro to obtain a description of the arguments of this and other wavelet plot modules. The WAVHELP macro is defined in the autocall WAVINIT macro. For example, the following call to the WAVHELP macro writes a short description of the COEFFICIENTPLOT module to the SAS log, as shown in Figure 5.

%wavhelp(coefficientPlot);

Figure 5: Log Output Produced by %wavhelp(coefficientPlot) Call

 
      coefficientPlot Module                                                    
 
Function: Plots wavelet detail coefficients                                     
 
Usage: call coefficientPlot(decomposition,                                      
                            threshopt,                                          
                            startLevel,                                         
                            endLevel,                                           
                            howScaled,                                          
                            header);                                            
 
Arguments:                                                                      
   decomposition - (required) valid wavelet decomposition produced              
                              by the IML subroutine WAVFT                       
   threshopt     - (optional) numeric vector of 4 elements                      
                              specifying thresholding to be used                
                              Default: no thresholding                          
   startLevel    - (optional) numeric scalar specifying the lowest              
                              level to be displayed in the plot                 
                              Default: start level of decomposition             
   endLevel      - (optional) numeric scalar specifying the highest             
                              level to be displayed in the plot                 
                              Default: end level of decomposition               
   howScaled     - (optional) character: 'absolute' or 'uniform'                
                              specifies coefficients are scaled uniformly       
                              Default: independent level scaling                
   header        - (optional) character string specifying a header              
                              Default: no header                                
 


In Figure 4, the detail coefficients at each level are scaled independently. The oscillations present in the absorbance data are captured in the detail coefficients at levels 7, 8, and 9. The following statement produces a coefficient plot of just these higher-level detail coefficients and shows them scaled uniformly. The plot is shown in Figure 6.

call coefficientPlot(decomp, , 7, , 'uniform', "Quartz Spectrum");

Figure 6: Uniformly Scaled Detail Coefficients

Uniformly Scaled Detail Coefficients


As mentioned earlier, noise in the data is captured in the detail coefficients, particularly in the small coefficients at higher levels in the decomposition. By zeroing or shrinking these coefficients, you can get smoother reconstructions of the input data. This is done by specifying a threshold value for each level of detail coefficients and then zeroing or shrinking all the detail coefficients below this threshold value. The SAS/IML wavelet functions and modules support several policies both for how this thresholding is performed and for selecting the thresholding value at each level. For more information, see the section WAVIFT Call.

An options vector is used to specify the desired thresholding; several standard choices are predefined as macro variables in the WAVINIT module. The following statements produce the detail coefficient plot with the "SureShrink" thresholding algorithm of Donoho and Johnstone (1995). The plot is shown in Figure 7.

call coefficientPlot(decomp, &SureShrink, 6, , , "Quartz Spectrum");

Figure 7: Thresholded Detail Coefficients

Thresholded Detail Coefficients


You can see that "SureShrink" thresholding has zeroed some of the detail coefficients at the higher levels but the larger coefficients that capture the oscillation in the data are still present. Consequently, reconstructions of the input signal that use the thresholded detail coefficients still capture the essential features of the data, but are smoother because much of the very fine-scale detail has been eliminated.

Last updated: October 10, 2022