wavelet_util
Class gnuplot3D

java.lang.Object
  |
  +--wavelet_util.plot
        |
        +--wavelet_util.gnuplot3D

public class gnuplot3D
extends plot

Define the class gnuplot3D for the wavelet_util package.

The class outputs a Haar wavelet spectrum array in a format that can be read by gnuplot for 3D plotting. This function can be used to plot either Haar wavelet spectrums or Haar wavelet coefficients.

The constructor is given an array of Haar spectrum values and a file name. The Haar spectrum values will be written out to the file so that they can be graphed.

The length of the array must be 2N. The lengths of the spectrums are 2N-1, ... 20. If the original data was

{32.0, 10.0, 20.0, 38.0, 37.0, 28.0, 38.0, 34.0, 
18.0, 24.0, 18.0,  9.0, 23.0, 24.0, 28.0, 34.0}

The Haar spectrum will be:

0.0
25.9375
29.625 22.25
25.0 34.25 17.25 27.25
21.0 29.0 32.5 36.0 21.0 13.5 23.5 31.0

If the original data length was 2N, then the total length of the spectrum data will be 2N-1, so the first element is zeroed out in the case of a Haar spectrum. In the case of the wavelet coefficients, the first value will be the average for the entire sample. In either case this value will not be output.

The plot used to display the Haar wavelet spectrums is modeled after the plots shown in Robi Polikar's Wavelet Tutorial, Part III. Here the x-axis represents the offset in the data. The y-axis represents the width of the Haar window (which will be a power of two) and the z-axis represents the spectrum value.

In order for gnuplot to display a 3D surface each line must have the same number of points. The wavelet spectrum is graphed over the original rage. The first spectrum repeats two values for each average or coefficient calculated. The second spectrum repeats each value four times, the third spectrum eight times, etc...


Constructor Summary
gnuplot3D(double[] values, java.lang.String path)
           
 
Method Summary
(package private)  java.lang.String class_name()
           
private  void outputSpectrum(java.io.PrintWriter prStr, double[] values, int end, int windowWidth)
          Output a Haar spectrum where the x-axis is the sample value number, the y-axis is the log2 of the window width and the z-axis is the value (e.g., average or average difference).
 
Methods inherited from class wavelet_util.plot
OpenFile
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

gnuplot3D

public gnuplot3D(double[] values,
                 java.lang.String path)
Method Detail

class_name

java.lang.String class_name()
Overrides:
class_name in class plot

outputSpectrum

private void outputSpectrum(java.io.PrintWriter prStr,
                            double[] values,
                            int end,
                            int windowWidth)
Output a Haar spectrum where the x-axis is the sample value number, the y-axis is the log2 of the window width and the z-axis is the value (e.g., average or average difference).