Here is an example of a set of sorted coefficients:

Notice the
glyph along the
bottom of the sorted Image window. This glyph tells you that the data in this
window has been sorted (and can therefore be unsorted).

Truncating coefficients means throwing some of them away (i.e. setting their values to zero, and then resizing the array to eliminate them). The Truncate Coeffs... dialog allows you to truncate wavelet coefficients in 4 ways:
Here is an example of a truncation operation which kept 50% of the previous set of coefficients:

Note that the resulting truncated coefficients are formatted into the smallest square which will contain them. This is purely for display purposes only, and will have no effect on further operations. If the truncated data is written to a file (see section 4.2.8 below), or is used to reconstruct data, only the actual retained coefficients will be used, and any "padding" will be discarded.
Notice that when data is unsorted:
glyph disappears from
the Image window, indicating that the data is no longer sorted.
Once the coefficient array has been unsorted, it can be used in an inverse wavelet transform to reconstruct the original dataset.
Choosing this item will perform the following steps in sequence:
To perform a compression, first select an Image window containing 2d data. Then, choose the Compress... item of the Wavelets menu, and one of the filter items of the attached submenu. Whatever filter set you choose from the submenu will be used to perform the wavelet transform as part of the compression operation. You can also perform compression using a custom filter by choosing the Custom... item of the submenu. Compression of a 256x256 image takes about 40-sec on a Centris 650.
Here is an example of an input dataset and its compressed coefficients, based on keeping 50% of the sorted coefficients (i.e 2:1 compression):

To perform an expansion, first select a Wavelet window containing truncated wavelet coefficients. Then, choose the Expand... item of the Wavelets menu, and one of the filter items of the attached submenu. Whatever filter set you choose from the submenu will be used to perform the inverse wavelet transform as part of the expansion operation. You can also perform expansion using a custom filter by choosing the Custom... item of the submenu. Expansion of a 256x256 image takes about 40-sec on a Centris 650.
Here is an example of an expansion of the previously compressed dataset:

Note that this dataset appears very similar to the original dataset, even though 50% of the intermediate wavelet coefficients were eliminated.

To compare the reconstructed data to the original, you can subtract the original dataset from the reconstructed one. To do this, first select the window containing the reconstructed dataset. Then, choose the Subtract Datasets... item from the Wavelets menu. You will see the following dialog:

From the pop-up menu of windows (every 2d window in the current document), choose the Original window. When performing subtraction and other math operations, you may want to name your windows first, so that you can distinguish one from another in the pop-up menu. The result of subtracting the original dataset from the reconstruction looks like the following:

Note that the magnitude of the difference is at most about 10% of the original.
One way to measure the accuracy of reconstruction of the data is to look at the average sum of squared differences between the original and the reconstruction. This information is available from the Data Stats... item of the Edit menu. To see this infomation, select the window showing the subtracted dataset, and then choose the Data Stats... menu item. You should see the following:

When compressing data, you may want to try different wavelet filter sets and different truncation options, until you find the method that eliminates the most coefficients, while minimizing the average sum of squares difference between the original data and its reconstruction.

You may select either the Text or Binary Data type: button. The format of a text file of sorted/truncated coefficients is the following:
Original number of rows, cols in data: Text value, text value
Actual number of points: Text value
Current rows, cols of array
(including padding): Text value, text value
Each row of data: Text values
Each row of index of data: Text values
The original number of rows and cols is the size of the unsorted array. The
index of each point is the position (0-based) that the point occupied in the unsorted
array, considered as a single row vector.Note that not all current rows and columns of data or index may be written to the file, due to display padding. Only as many values as the current number of actual truncated values will be written. Therefore, some rows, and some columns within the last row, of padded data may be omitted from the file.
The format of a binary file of sorted/truncated coefficients is the following:
Original number of rows in data: 4-byte integer value
Original number of cols in data: 4-byte integer value
Actual number of points: 4-byte integer value
Current number of rows in data: 4-byte integer value
Current number of cols in data: 4-byte integer value
Each data point: 4-byte real value
Index of each data point: 4-byte integer value
Again, note that not all values or indices may be
written to the file, due to display padding. Only as many values as the current number of
actual truncated values will be written.
Note that only the actual number of current truncated points and their indices will be written to the file, in one of the formats listed above.
Contents | Previous Section | Next Section
MacWavelets 2.00 User's Manual.
"MacWavelets" is a trademark of Intergalactic Reality.
© Copyright Intergalactic Reality, 1996.
All rights reserved.