Wavelet Analysis

Using Symbolic Names

Several of the wavelet subroutines take arguments that are options vectors that specify user input. For example, the third argument in a WAVFT subroutine call is an options vector that specifies which wavelet and which boundary treatment are used in computing the wavelet transform. Typical code that defines this options vector is as follows:

  
      optn    = j(1, 4, .); 
      optn[1] = 0; 
      optn[3] = 1; 
      optn[4] = 3;
 

A problem with such code is that it is not easily readable. By using symbolic names readability is greatly enhanced. SAS macro variables provide a convenient mechanism for creating such symbolic names. For example, the previous code could be replaced by the following code:

  
       optn            = &waveSpec; 
       optn[&family]   = &daubechies; 
       optn[&member]   = 3; 
       optn[&boundary] = &zeroExtension;
 

where the symbolic macro variables (names with a preceding ampersand) resolve to the relevant quantities. Symbolic names also improve code readability when substituted for integer arguments that control what actions a multipurpose subroutine performs. Consider the following code:

  
      call wavget(n,decomposition,1); 
      call wavget(fWavelet,decompostion,8);
 
This code can be replaced by the following statements:
  
      call wavget(n,decomposition,&numPoints); 
      call wavget(fWavelet,decompostion,&fatherWavelet);
 

A set of symbolic names is defined in the autocall WAVINIT macro. The following tables list the symbolic names that are defined in this macro.

Table 16.1: Macro Variables for Wavelet Specification
Position Admissible Values
Name Value Name Value
&boundary1&zeroExtension0
  &periodic1
  &polynomial2
  &reflection3
  &antisymmetricReflection4
&degree2&constant0
  &linear1
  &quadratic2
&family3&daubechies1
  &symmlet2
&member41 - 10

Table 16.2: Macro Variables for Threshold Specification
Position Admissible Values
Name Value Name Value
&policy1&none0
  &hard1
  &soft2
  &garrote3
&method2&absolute0
  &minimax1
  &universal2
  &sure3
  &sureHybrid4
  &nhoodCoeffs5
&value3positive real
&levels4&all-1
  positive integer

Table 16.3: Symbolic Names for the Third Argument of WAVGET
Name Value
&numPoints1
&detailCoeffs2
&scalingCoeffs3
&thresholdingStatus4
&specification5
&topLevel6
&startLevel7
&fatherWavelet8

Table 16.4: Macro Variables for the Second Argument of WAVPRINT
Name Value
&summary1
&detailCoeffs2
&scalingCoeffs3
&thresholdedDetailCoeffs4

Table 16.5: Macro Variables for Predefined Wavelet Specifications
Name   &boundary &degree &family &member  
&waveSpec{.. .}
&haar{&periodic.&daubechies1}
&daubechies3{&periodic.&daubechies3}
&daubechies5{&periodic.&daubechies5}
&symmlet5{&periodic.&symmlet5}
&symmlet8{&periodic.&symmlet8}

Table 16.6: Macro Variables for Predefined Threshold Specifications
Name   &policy &method &value &levels  
&threshSpec{. ..}
&RiskShrink{&hard&minimax.&all}
&VisuShrink{&soft&universal.&all}
&SureShrink{&soft&sureHybrid.&all}

Previous Page | Next Page | Top of Page