calculates histogram for multiple columns with common bin values among all data columns, and can be useful for data compression.
R = nan_histo3(Y) R = nan_histo3(Y,W) [R,tix] = nan_histo3(Y)
data
weight vector containing weights of each sample, number of rows of Y and W must match. default W=[] indicates that each sample is weighted with 1. R : is a struct with th fields
struct with these fields
the bin-values, bin-values are equal for each channel thus R.X is a column vector. If bin values should be computed separately for each data column, use nan_histo2
is the frequency of occurence of value X
are the number of valid (not %nan) samples
enables compression
provides a compressed data representation.
estimates the compression ratio
reconstruct the orginal signal (decompression)
Data compression can be performed in this way
[R,tix] = histo3(Y) is the compression step
The effort (in memory and speed) for compression is O(n*log(n)).
The effort (in memory and speed) for decompression is O(n) only.
x= [ 9 9 9 9 2 2 3 3 4 5 9 ]'; [R,tix]=nan_histo3(x) disp(R.X(R.tix)) | ![]() | ![]() |
C.E. Shannon and W. Weaver "The mathematical theory of communication" University of Illinois Press, Urbana 1949 (reprint 1963).