Class histo


public class histo
extends plot

Support for generating histograms for the Haar wavelet coefficients.

Inner Class Summary
 class histo.bin
 class histo.mean_median
Constructor Summary
Method Summary
 histo.bin alloc_bin()
private  histo.bin[] calcHisto(double[] v, histo.mean_median m)
          Generate a histogram array from the input vector.
 histo.mean_median histogram(double[] vals, java.lang.String path)
           histo class constructor
Methods inherited from class experimental.plot
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait

Constructor Detail


public histo()
Method Detail


public histo.bin alloc_bin()


private histo.bin[] calcHisto(double[] v,
                              histo.mean_median m)
Generate a histogram array from the input vector. The data in the input vector is modified.

The values to be histogrammed are sorted to obtain a low and a high value.

The histogram is calculated by dividing the number range into a set of bins. Each bin has a start value. The end value is the start of the next bin. The sorted input array is traversed and the number in each bin range are counted. Each bin is set to the associated count. The histogram is graphed with the bin range on the x-axis and the count on the y-axis.

The histogram range has zero elements at the top and bottom to improve the appearance of the histogram when plotted with gnuplot.

The function also returns the mean (a.k.a average) and the median in the argument m. The median is the middle of a sorted list of numbers. In the case of the wavelet algorithm, all arrays are a power of two. So the middle value is calculated from the two values on either side of the middle. For example, if the vector has 32 numbers, the median is calculated from the average of v[15] and v[16].


public histo.mean_median histogram(double[] vals,
                                   java.lang.String path)

histo class constructor

The histo class constructor is initialized with an array of doubles and a String that contains the path for a file name. The constructor writes out a file that contains histogram plot data formatted for gnuplot. The input array vals is sorted.

The function returns the mean (a.k.a. average) and the median in a two element double array.