The program WPKTDEMO.EXE is a demonstration of the wavelet packet transform as
described in my article "The Wavelet Packet Transform" which appeared in the
April, 1994 issue of Dr. Dobb's Journal. The following files are included:
WPKTDEMO.EXE - The wavelet packet transform demonstration program.
WPKTDEMO.DOC - The file you are reading.
CHIRP.DAT - Signal data file of a sine chirp function.
CHIRP1.COF - Wavelet packet transform coefficient file for the chirp function.
Subband basis of the entire binary tree.
CHIRP2.COF - Wavelet packet transform coefficient file for the chirp function.
Wavelet basis of the entire binary tree.
CHIRP2.COF - Wavelet packet transform coefficient file for the chirp function.
An arbitrary basis which localizes on higher frequency subbands.
CVESA41.ZIP - Archive of Kendall Bennett's Universal VESA VBE driver TSR,
Version 4.1 (requires PKUNZIP 2.0 or greater to unzip).
The program will run on any IBM PC-compatible computer with an 80286 (or
greater) processor. A Super VGA graphics card and monitor are also required.
The graphics card must be capable of supporting VESA* Video BIOS Extension
(VBE*) 1.0 (or greater) and VBE mode 0x104 (1024 x 768, 16 colors).
Most Super VGA graphics cards already have support for VESA VBE, either
through the ROM BIOS on the graphics card or via a driver TSR. To determine if
your graphics card supports VESA VBE, run WPKTDEMO at the DOS prompt. If your
graphics card does not have support for VESA VBE, the following message will be
displayed:
"No VESA support with this display card".
Check the documentation which comes with your graphics card to see if a TSR
driver is available. Also, contact the manufacturer of the graphics card.
Even if there is a VESA VBE driver with your graphics card, WPKTDEMO may still
not run. If there is insufficient memory available for mode 0x104 (or if the
mode is not supported by the driver the following message will be displayed:
"Requested VESA mode is not available".
Check your documentation to see if you can install additional video memory (512
kbytes are required, usually, to support mode 0x104) or contact the manufacturer
for an updated VESA BIOS or driver.
As an immediate (if temporary) solution, I have enclosed a copy of Kendall
Bennett's Universal VESA VBE driver TSR, Version 4.1 to allow you to get up and
running. I MAKE NO GUARANTEE OF THE SUITABILITY OF THIS DRIVER WITH YOUR
GRAPHICS CARD AND I WILL NOT BE HELD RESPONSIBLE FOR ANY DAMAGES RESULTING FROM
THE USE OF HIS DRIVER (or my program for that matter). Installation
instructions for the driver are included with the driver in archive.
USING WPKTDEMO
Once WPKTDEMO is loaded correctly, the screen should display a signal in the
brown region. The signal is a "chirp", i.e., a sinewave with increasing
frequency over time. The signal is generated within the program itself. Below
the signal is four rows of alternating dark and light gray bands. These rows
represent redundant approximation (dark gray) and detail (light gray) data. The
data display in these bands are intermediate results in the calculation of the
wavelet packet basis. Below the redundant data levels is a single row of
alternating green and cyan bands. These rows represent the approximation
(green) and detail (cyan) coefficients of the wavelet packet basis. The initial
disjoint cover represented is a fifth-level subband basis. The full binary tree
is displayed. No transform has been calculated, so all values are zeroed.
Along the left-hand side of the wavelet packet display are labels indicating
the levels of the wavelet packet transform (4 through 0). Each level represents
a different level of scale. Each level is one half the resolution of the level
above and twice the resolution of the level below. The numbers between each
pair of dark gray/light gray and green/cyan bands indicate the basis function
pairs (or subband pairs) in the binary tree.
Below the signal and wavelet packet displays is the menu entry field used to
control the program. Starting on the left-hand side of the menu and working
down and to the right is displayed the following items:
Signal File - Name of the signal file to load or save. The string entered in the field should follow standard DOS file path and file name conventions. The entry is not case sensitive. The format for the file is as follows:
1024 (Integer value indicating number of samples in file.)
0.0000000000000e+00
1.5707632441631e-04
6.2830514264364e-04 (Sample values in floating point format.)
1.4136850594884e-03
2.5132106492058e-03
.
.
.
.
Transform File - Name of the wavelet packet transform coefficient file to load
or save. The string entered in the field should follow standard DOS file path
and file name conventions. The entry is not case sensitive. The format for the
file is as follows:
(Integer values indicating number of samples in original signal
1024 5 and the number of levels in the transform [always 5].)
0.0000000000000e+00 0.0000000000000e+00 (Values of alpha and beta.)
T
T (Thirty-one text characters indicating the states of thirty-one
T nodes representing the subband pairs of the wavelet packet
. transform binary tree. 'T' indicates an active subband pair,
. while 'F' indicates an inactive subband pair. Active subband pairs
. are used in calculating the wavelet packet basis represented by the
F disjoint cover.)
F
T
-0.0000000000000e+00
5.3722339838268e-06 (Coefficients of the wavelet packet transform for the
-1.9663178747461e-06 given basis including the undisplayed terminating
-5.8379489037445e-05 coefficients of the convolutions at the end of each
2.1475008461388e-04 subband. No redundant data is stored in the file.)
.
.
.
.
Pollen Parameterization - This method for generating orthogonal wavelet filter
coefficients was presented in my first article (see bibliography in the wavelet
packet article). The parameterization values are entered in the fields below:
Alpha - The current value of alpha (-pi <= alpha < pi).
Beta - The current value of beta (-pi <= alpha < pi).
Coefficients - The wavelet filter coefficients generated from the values of
alpha and beta. Two, four, or six coefficients will be generated depending upon
the values of alpha and beta.
Basis Function Pair - The quadriture mirror filter (QMF) pairs of the transform
generate adjacent frequency subbands at each level in the binary tree. Each QMF
pair also represents a basis function pair for each level at each 'node' in the
binary tree. These functions are recursively defined according to the
application of the scaling and wavelet functions while working from the top of
the tree down through the particular QMF pair. The values are entered in the
fields below:
Level - The level of the basis function pair in the binary tree.
Subband - The selected subband pair at the given level in the binary tree.
Active - A value of 'T' indicates an active subband pair, while 'F' indicates
an inactive subband pair. Active subband pairs are used in
calculating the wavelet packet basis represented by the disjoint
cover. An inactive pairs is set to black and are not in use. Active
pairs are displayed and are set to a color according to whether they
are part of the disjoint cover (green or cyan) or redundant data
(dark orlight gray) used in the calculation of the wavelet packet
coefficients in the disjoint cover
The two function displays on the right-hand side of the menu field represent
the recursively defined basis functions for the selected subband pair. For
example, if level 0 and subband 0 were selected, the functions would represent
the scaling function (green) and wavelet function (cyan) used in the fast
wavelet transform.
The blue help screen displayed in the middle of the screen lists the available
operations in the program. Note that the caret (^) represents holding down the
control key on the keyboard while pressing the appropriate function key.
F1: Display Help List - Displays the list of available functions.
F2: Load signal data file - Loads the file listed in the Signal File field. If
the file is not found or cannot be opened a beep will sound.
^F2: Save signal data file - Saves the file listed in the Signal File field. If
the cannot be opened a beep will sound. No warning is given if the file already
exists.
F3: Load transform coefficient file - Loads the file listed in the Transform
File field. If the file is not found or cannot be opened a beep will sound.
^F3: Save transform coefficient file - Saves the file listed in the Transform
File field. If the file cannot be opened a beep will sound. No warning is
given if the file already exists.
F4: Decompose signal - Generate the wavelet packet transform coefficients in the
disjoint cover from the signal and the decomposition wavelet filters.
^F4: Reconstruct signal - Reconstruct the signal from the wavelet packet
transform coefficients in the disjoint cover and the reconstruction wavelet
filters.
F5: Zero approximation coefficients selected - Sets the data values in the
approximation half of the selected subband pair to zero. Useful when analyzing
which coefficients are significant to the perfect reconstruction of the original
signal.
^F5: Zero detail coefficients selected - As above but for the detail half of the
selected subband pair.
F6: Zero all redundant coefficients - Used to show that only the wavelet packet
transform coefficients in the disjoint cover are needed to reconstruct the
original signal.
F7: Restore binary tree structure - Makes all basis function (subband) pairs
active. This is faster than manually activating them.
F10: Program exit - Return to the DOS prompt. No prompt is made for saving any
data generated.
Feel free to experiment with the program! The disjoint cover can be free
modified to create alternate wavelet packet bases. Try different wavelet
filters to correlate with the signal or concentrate the signal energy at lower
frequency bands. The following table presents a list of Pollen parameters for