|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--experimental.plot | +--experimental.histo
Support for generating histograms for the Haar wavelet coefficients.
Inner Class Summary | |
class |
histo.bin
|
class |
histo.mean_median
|
Constructor Summary | |
histo()
|
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 |
OpenFile |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public histo()
Method Detail |
public histo.bin alloc_bin()
private histo.bin[] calcHisto(double[] v, histo.mean_median m)
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |