WPL -- Wavelet Packet Laboratory Version 1.02 WALKTHRU.TXT A tutorial walk the user through the WPL program This program is currently Shareware. Please include this notice in all copies. Any people interested in obtaining the release version should print and fill out the order form in the file ORDER.FRM. Registration entitles the user to technical support and notices of updates to the program. A nominal fee of $50 will be charged for duplications costs. Receipt of payment will register the user. The form should be sent to: Wavelet Packet Laboratory Digital Diagnostic Corp. 26 Rossotto Drive Hamden, CT 06514 Phone: (203)-288-9444 FAX: (203)-287-8765 INTERNET: ddc@cs.yale.edu 1. INTRODUCTION The purpose of this document is to walk first time users through the WPL program. The WPL software must be installed before the starting this example (see read.me for instructions). The following conventions are used in this document: - All keys to be typed in by the user are surrounded in quotes; i.e. "Enter". If the "Alt", "Shift", or "Ctrl" keys are to be pressed with a key, it is indicated like "Alt F". - Strings to type are surrounded with single quotes: i.e. `heart.byt'. - Check marks are indicated by _/. In WPL, they are displayed with the square rooot character. - The Go Away button which is displayed on the top left of windows is indicated by the -^- character. This button is equivalent to pressing the "Esc" key. - Entries in pull down windows are indicated with | symbols seperating the individual menu entry selections; i.e., FILE|OPEN|SIGNAL. - All descriptions of edit, directory, or selection windows are preceded by the associated menu which appears at the top of the screen. - Menu entries can alternatively be selected by typing the highlighted letters. The only exception to this rule is that the top main menu entries (FILE...) and menu entries for edit window require that the "Alt" key also be pressed. For example, FILE from the main menu is selected by pressing "Alt F" 2. STARTING UP WPL WPL is started by typing "WPL" from the \WPL directory. C:\>cd \wpl C:\WPL>wpl A disclaimer is displayed on the screen. After reading this screen, press the "Enter key". The Startup Main MENU is then displayed on top of the screen. Main MENU: FILE SYSTEM 3. LOADING AN ASCII SIGNAL FILE 3.1. Getting into the Open Signal Menu Choose File|Open|Signal with the mouse or type "Alt F" and "I". The following edit window will pop up: Open Signal MENU: Names Path Types F12DONE -^---------OPEN DIRECTORY C:\WPL\*.WPL---------------- | | | FILE NAME .\.WPL | | FILE TYPE Wavelet Packet | | | ------------------------------------------------------ The following keys are now valid: ESC -- Go back to the Startup MENU F12 -- Try to load the file name Alt N -- Load a directory window containing the file names Alt P -- Load a directory window containing the directories on your computer ALT T -- Load a list of valid signal file formats Typing Keys -- Enter in a file name Enter -- Register the typed in file name 3.2. Select the type of data contained in the file In this case, the file to be loaded will be a Byte file in the current directory called HEART.BYT. Type "Alt T" to change the FILE TYPE to Byte Format. A pop up window will appear which looks like the following: Type MENU: F12DONE -^---FILE TYPES-------- |_/WPL - Wavelet Packet | | ASC - Ascii Text | | BYT - Byte Format | | INT - Integer Format | ----------------------- The following keys are now valid: ESC -- Go back to the edit window Up Arrow -- Move the cursor up Down Arrow -- Move the cursor down Enter -- Select a file type F12 -- Set the file type and go back to the edit window Click on the BYT - Byte Format selection with the mouse or use the arrow keys to position the cursor and then press "Enter". Open Signal MENU: Names Path Types F12DONE -^----------OPEN DIRECTORY C:\WPL\*.WPL--------------- | | | FILE NAME C:\WPL\.BYT | | FILE TYPE Byte Format | | | ------------------------------------------------------ 3.3. Select the file from the name directory Type "Alt N" to bring up the names directory. The following directory window will appear: Open Signal MENU: F12DONE -^----------NAME DIRECTORY C:\WPL\*.WPL--------------- |heart.byt sinxcube.byt ..\ | | | ----------------------------------------------------- The following keys are now valid: Up Arrow -- Move the cursor up Down Arrow -- Move the cursor down Left Arrow -- Move the cursor Left Right Arrow -- Move the cursor Right Enter -- Load a file under the cursor F12 -- Load a file under the cursor ESC -- Go back to the Open Signal edit window Click on the `heart.byt' selection with mouse or move the cursor and type "Enter". The following Import Window will appear. Import MENU: F12DONE -^-------------IMPORT PARAMETERS --------------------- | | | SIGNED PIXEL (Y/N) N | | FILE OFFSET (in bytes) 0 | | TRACE LENGTH (in pixels) -1 | | FILE LENGTH (in pixels) -1 | ------------------------------------------------------ where: SIGNED PIXEL = If Y then the data has negative values (2's complement). FILE OFFSET = Skip over this many bytes of header which may be present in the file TRACE LENGTH = Used to break up long signals into several small ones -1 will load all the points into a single trace. FILE LENGTH = Used to limit the amount of points loaded. -1 will not limit the amount of loaded points. The following keys are now valid: Up Arrow -- Move the cursor up Down Arrow -- Move the cursor down Typing Keys -- Enter in data Enter -- Register typed in data ESC -- Go back to the Startup MENU F12 -- load the file name Use the cursor and typing keys needed to display the following screen. Import MENU: F12DONE -^-------------IMPORT PARAMETERS--------------------- | | | SIGNED Y | | OFFSET 0 | | TRACE LENGTH 512 | | FILE LENGTH -1 | ------------------------------------------------------ Once the parameters have been set, type "F12" to load the signal window. The signal window contains several traces of length 512 from the file HEART.ASC. The Main MENU will appear: Main MENU: FILE WINDOW VIEW EDIT CALCULATE TRANSFORM MACRO SYSTEM 4. PREPARING THE SIGNAL FOR THE WPT TRANSFORM When using the Wavelet Packet Transform, any DC offsets in the signal will create large spikes in Frequency 0. In this example, we are only interested in higher frequencies in the signal, so we will remove the DC offset. 4.1. Turning on the numeric cursor Choose the VIEW|ANNOTATIONS|NUMERIC CURSOR option with the mouse or by typing "Alt V" and "C". The following selection window will appear: NUMERIC CURSOR F12DONE -^-------------------- |_/Off | | On | ---------------------- The following keys are now valid: Up Arrow -- Move the cursor up Down Arrow -- Move the cursor down Enter -- Use the setting of the current item ESC -- Go back to the Main MENU without changes F12 -- Go back to the Main MENU Click on the "On" selection with the mouse or use arrow keys to position the cursor and press the "Enter" key. Press the "F12" key and the following information will appear on the bottom of the window: Cursor:[ 58] at (000,000) 4.2. Move to the desired signal In this example, the seventh signal from the top (Trace 7) will be used. Move the cursor to this trace by clicking on this trace with the mouse or by pressing the "Down Arrow" key seven times. The following information will appear at the bottom of the signal window: Cursor:[ 165] at (000,007) 4.3. Determine the value of the DC offset (the average value) Choose the VIEW|ANNOTATIONS|TRACE CONSTANT option with the mouse or by typing "Alt V" and "R". The following selection window will appear: TRACE ANNOTATIONS F12DONE -^-------------------- | Size | | Min | | Max | | Average | | Energy | | Entropy | | Compression Ratio | | Segmentation | | Status | | Comment | |All | |None | ---------------------- where: Size = Display the trace size Min = Display the trace minimum value and position Max = Display the trace maximum value and position Average = Display the trace average value Energy = Display the energy in the trace, the energy in subsets, the percentage of the subset energy Entropy = Display the information cost Compression Ratio = Display the trace compression ratio Level = Display the level of the transform traces Status = Display the display status of the trace Comment = Display the trace comment All = Selects all of the above selections None = Removes any selections The following keys are now valid: Up Arrow -- Move the cursor up Down Arrow -- Move the cursor down Enter -- Toggle the selection of the current item ESC -- Go back to the Main MENU without changes F12 -- Set up the trace annotations and go back to the Main MENU Click on the "All" selection with the mouse or use arrow keys to position the cursor and press the "Enter" key. Check marks will appear alongside the items. Press the "F12" key and the following information will appear at the bottom of the signal window: Cursor:[ 165] at (000,007) Trc Size: [512] Trc Min: [ 104] at ( 421, 7) Trc Max: [ 202] at ( 412, 7) Trc Average Value: [ 155] Trc Energy: [ ] Subset Energy: [ ] Trc Entropy: [ ] Compression Ratio: 0:1 Level: Scale To Trace LINEAR TrcCmnt: Notice that the average value of the trace is 155. 4.4. Subtract the average value Choose the CALCULATE|SUBTRACT CONSTANT option with the mouse or by typing "Alt C" and "U". The following edit window will pop up: Get Constant MENU: F12DONE -^------------SUBTRACT CONSTANT----------------------- | | | CONSTANT 0.000000 | | | ------------------------------------------------------ The following keys are now valid: Numeric Keys -- type in a number ENTER -- Enter the number into the constant ESC -- Go back to the Main MENU F12 -- Go on to operation Menu Type 155 and press the "Enter" key. Press the "F12" to display the following menu: Subtract Constant MENU: Mark Upper Trace All OPTIONS Select the Options menu by typing "O" and the following pull down menu will appear: Subtract Constant MENU: Mark Upper Trace All OPTIONS | RANGE | |_/TRACE | | RECTIFY | ----------- where: RANGE = Use a range cursor. TRACE = Use a trace cursor. RECTIFY = Clip all resulting negative numbers at zero. Select the TRACE option with the mouse or by pressing the "T" key. Notice that the menu contains the entry Mark Upper Trace. Press the "Enter" key and the menu at the top of the screen will change to: Subtract Constant MENU: Mark Lower Trace All OPTIONS Press the "Enter" key once again and the trace annotations at the bottom of the signal window will change to: Cursor:[ 10] at (000,007) Trc Size: [512] Trc Min: [ -51] at ( 421, 7) Trc Max: [ 47] at ( 412, 7) Trc Average Value: [ 155] Trc Energy: [ ] Subset Energy: [ ] Trc Entropy: [ ] Compression Ratio: 0:1 Level: Scale To Trace LINEAR TrcCmnt: Press "Esc" to get back to the main menu. Notice that the average value of the trace is now 0. 5. USING THE WPT TRANSFORM ----------------------- 5.1. Go to the WPT menu Choose the TRANSFORM|WPT menu entry with the mouse or by typing "Alt T" and "W". The following menu will appear at the top of the screen: WPT MENU: Mark Upper Trace ALL PARAMETERS The following keys are now valid: Up Arrow -- Move the cursor up Down Arrow -- Move the cursor down Enter -- Mark the upper and lower traces to transform A -- Perform WPT on all traces in the signal P -- Edit the WPT Parameters ESC -- Go back to the Main MENU 5.1. Select a wavelet For this example, the D8 wavelet will be used. Select the PARAMETERS option with the mouse or by typing "P". The following edit window will appear: WPT Parameters MENU: View Wavelets F12DONE -^------WAVELET PARAMETERS-------- | | | WAVELET TYPE C6 | | | | MAXIMUM LEVEL 8 | | | ---------------------------------- where: WAVELET TYPE = the name of the wavelet (uppercase letters only) MAXIMUM LEVEL = the max. number of transforms generated in the tableau The following keys are now valid: Up Arrow -- Move the cursor up Down Arrow -- Move the cursor down Typing Keys -- Enter in data Enter -- Register typed in data V -- View wavelets if the cursor is on the WAVELET PARAMETERS ESC -- Go back to the Main MENU without any changes F12 -- Use the parameters and go back the WPT menu. Choose View Parameters with the mouse or by pressing the "V" key. A window will appear with several waveforms in it. These are the wavelets and they are labeled on the left of each wavelet. The following keys are now valid: Up Arrow -- Move the cursor up Down Arrow -- Move the cursor down ENTER -- Select the current wavelet ESC -- Go back to the Main MENU with selecting wavelet F12 -- Use the selected wavelet and go back the parameters menu. Click on the D8 wavelet selection with the mouse or use the arrow keys and press "Enter". Press F12 and the WPT Parameter edit window will reappear as follows: WPT Parameters MENU: View Wavelets F12DONE -^------WAVELET PARAMETERS-------- | | | WAVELET TYPE D8 | | | | MAXIMUM LEVEL 8 | | | ---------------------------------- Press "F12" to get back to the WPT menu. 5.2. Select the trace to be transformed Notice that WPT menu contains the entry `Mark Upper Trace': WPT MENU: Mark Upper Trace ALL PARAMETERS Press the "Enter" key and the menu at the top of the screen will change to: WPT MENU: Mark Lower Trace ALL PARAMETERS Press the "Enter" key. The system will pause for a few seconds while it is creating the tableau of transform traces. When the system comes back, a tableau of 9 traces will have been inserted in the signal. The first 8 traces are transform traces and the last trace is a basis (a disjoint cover of the tableau). One of the transforms (L4) will be drawn in a different color from the rest of the transform traces. This is the Best Level and it is labeled with a BL4. The basis is the Best Basis and it is labeled with a BBAS. There are a number of vertical lines on each transform traces. These lines show how the transform traces is segmented. If there a large number of segment lines on level 1 and the number of segments are halved for each following transform trace, then the tableau is being viewed in a POSITION DOMINANT format. L1 | | | | | | | | | | | | | | | | | L2 | | | | | | | | | L3 | | | | | L4 | | | POSITION DOMINANT If there is only one segment line in the middle of level 1 and the number of segments are doubled for each following transform trace, then the tableau is being viewed in a FREQUENCY DOMINANT format. L1 | | | L2 | | | | | L3 | | | | | | | | | L4 | | | | | | | | | | | | | | | | | FREQUENCY DOMINANT Note: the Frequency Dominant is required for selecting coefficients of a basis, so this mode is automatically displayed when selecting bases. 5.3. Move the tableau of transform traces to the top of the screen Shift this trace to the top of the screen by: clicking 7 times on the DOWN ARROW character of the vertical scrollbar or pressing on the "Ctrl UpArrow" key 7 times 6. VIEWING THE PHASE PLANE DISPLAY OF THE BEST BASIS ------------------------------------------------- 6.1. Move the cursor to the best basis trace Click on the trace labeled BBAS or press the "Down Arrow" key 9 times. 6.2. Display the phase plane Choose the TRANSFORM|PHASE PLANE DISPLAY option with the mouse or by typing "Alt T" and "H". Phase Display MENU: Select Transform F12DONE Click on the trace labeled BL6 with the mouse or press the "Enter" key. This will bring up the phase plane display window. The following menu will appear at the time of the screen: Phase Plane Display MENU: TOGGLE SUBSETS OPTIONS F12DONE The upper right portion of the screen contains the phase plane where rectangles are drawn whose: - x position depends upon increasing positions left to right - x size depends upon the level - y position depends upon increasing frequencies - y size depends upon the inverse of the level - color depends upon the amplitude The phase plane is scaled up to a 512 x 512 rectangle. Initially, only the bottom half of the phase (containing the lower frequencies) is displayed. A color scale showing the correspondence of colors to amplitudes is displayed on the left side of the screen. The numeric cursor, Trace Energy, Subset Energy, and Compression Ratio are always displayed on the bottom of the window. The numeric cursor information looks like: Cursor: L6 F0 P0 C10 N-1.02E3 where: F0 = Frequency 0 P0 = Position 0 C10 = The coefficient or amplitude is 10 N-1.02E3 = The entropy of this frequency The following keys are now valid: Up Arrow -- Move the cursor up Down Arrow -- Move the cursor down Left Arrow -- Move the cursor Left Right Arrow -- Move the cursor Right Page Up -- Display the upper half of the phase plane Page Down -- Display the lower half of the phase plane ESC -- Go back to the Select Transform MENU F12 -- Go back to the Select Transform MENU T -- Toggle the coefficient on or off as a subset O, L -- Turn on/off the log scaling the coefficients (default ON) 0, B -- Bring up an edit window to change the base of the log scaling Look at the entire phase plane by pressing "Page Up" and "Page Down". 7. SELECT SUBSETS OF THE BEST BASIS Notice that there are some strong localized coefficients in the lower right of the phase plane. 7.1. Toggle the individual subsets Select each of the following coefficients by clicking on them with the mouse (or using the arrow keys). Turn on the subsets by typing "T". The coefficient will be outlined by thick lines. L4 F1 P25 C1574 N-1.87E+005 L4 F1 P26 C12894 N-1.87E+005 L4 F1 P28 C4103 N-1.87E+005 L4 F2 P27 C8989 N-1.55E+005 L4 F2 P28 C6458 N-1.55E+005 When all the coefficients have been selected, the follow annotations will be displayed at the bottom of the screen. Cursor:L4 F2 P28 C6458 N-1.55E+005 Trc Energy: [ 42765] Subset Energy: [ 34021] 79.55% Compression Ratio: 102:1 Notice that just five coefficients contain almost 80% of the trace energy. This is a compression ratio of 102:1 7.2. Go back to the Main Menu Press "Esc" twice to get back to the main menu. 7.3. Look at the subsets in the Position Dominant format Press "X" to magnify the X axis so that the subsets which appear as shaded regions are more apparent. Press the "x" to reduce X magnification down to its original size. 8. RECONSTRUCTING THE BEST BASIS USING SUBSETS 8.1. Select the Reconstruction menu Choose the TRANSFORM|RECONSTRUCT option with the mouse or by typing "Alt T" and "R". Reconstruct MENU: Mark Upper Trace ALL PARAMETERS F12DONE Click on the best basis with the mouse or press the "Enter" key and the following menu will appear: Reconstruct MENU: Mark Lower Trace ALL PARAMETERS F12DONE Click on the best basis with the mouse or press the "Enter" key and a new trace labeled RECN will appear. Notice how well this trace approximates the original trace and how the noise has been eliminated. 9. SELECTING SUBSETS AUTOMATICALLY 9.1. Select the Subsets menu Choose the TRANSFORM|SELECT SUBSET entry with the mouse or by typing "Alt T" and "S". Select Subset MENU: MANUAL AUTOMATIC DelETE SUBSET F12DONE where: MANUAL - N - Select subsets manually AUTOMATIC - A - Automatically select subsets DelETE SUBSET - Del - Delete a group of subsets Press "A" to select the Automatic Subsets Menu. Auto Subset MENU: Mark Upper Trace ALL OPTIONS _/ENERGY RETAINED COEFFICIENTS RETAINED ENERGY THRESHOLD where ENERGY RETAINED = Selects enough coefficients to retain a percentage of energy COEFFICIENTS RETAINED = Selects a percentage of the most energetic coefficients ENERGY THRESHOLD = Select all coefficients above a threshold Select the OPTIONS|COEFFICIENTS RETAINED option with the mouse or by pressing "O" and "C". The following edit window appears: SUBSET AUTO PARAMETERS F12DONE -^------------SUBSET AUTO PARAMETERS--------------------- | | | COEFFICIENTS RETAINED (% of COEFFS) 90.00 | | | --------------------------------------------------------- The following keys are now valid: Numeric Keys -- type in a number ENTER -- Enter the number into the constant ESC -- Go back to the Main MENU F12 -- Go on to operation Menu Type in the `10' then "Enter" and "F12". Now, the top 10 percent most energetic coefficients will be retained. Click on the best basis with the mouse or press the "Enter" key and the following menu will appear: Auto Subset MENU: Mark Lower Trace OPTIONS F12DONE Click on the best basis with the mouse or press the "Enter" key and the subsets will be selected. Note: any prior subsets will be removed before the auto subsets are selected. Notice that the compression ratio is smaller at 10:1 and that 97% of the energy is retained. Press the "Esc" key two times to get back to the Main menu. 9.2. Reconstruction Choose the TRANSFORM|RECONSTRUCT option with the mouse or by typing "Alt T" and "R". Reconstruct MENU: Mark Upper Trace ALL PARAMETERS F12DONE Click on PARAMETERS with the mouse or type the "P" key. This will bring up the following selection window: RECONSTUCT PARAMETERS F12DONE -^---RECONSTUCT PARAMETERS------- |_/Delete Previous Reconstruction | |_/Use Subsets | --------------------------------- where: Delete Previous Reconstruction = Automatically delete all previous reconstructions so that only one reconstruction will appear per transform trace Use Subsets = Use or don't use subsets The following keys are now valid: ESC -- Go back to the reconstruct menu Up Arrow -- Move the cursor up Down Arrow -- Move the cursor down Enter -- Toggle the correct selection on or off F12 -- Use selections and go back to the reconstruct menu Click on Delete Previous Reconstruction with the mouse or press the "Enter" key so that the check mark disappears. RECONSTUCT PARAMETERS F12DONE -^---RECONSTUCT PARAMETERS------- | Delete Previous Reconstruction | |_/Use Subsets | --------------------------------- Press the "F12" key to get back to the reconstruct menu. Click on the best basis with the mouse or press the "Enter" key and the following menu will appear: Reconstruct MENU: Mark Lower Trace ALL PARAMETERS F12DONE Click on the best basis with the mouse or press the "Enter" key and a another trace labeled RECN will appear below the previously reconstructed trace. Notice how well this trace approximates the original trace. especially notice that the signal noise is now present. 10. SAVING YOUR WORK IN THE WAVELET PACKET FORMAT Choose the FILE|SAVE option with the mouse or by typing "Alt F" and "S". The following edit window will pop up: Save MENU: NAMES PATH TYPES OPTIONS F12DONE -^------------SAVE DIRECTORY .C:\WPL\*.WPL------------ | | | FILE NAME C:\wpl\heart.wpl | | FILE TYPE Wavelet Packet | | | ------------------------------------------------------ The following keys are now valid: ESC -- Go back to the Startup MENU F12 -- Try to load the file name Alt N -- Load a pop up directory window filled with file names Alt P -- Load a pop up directory window representing the directories on your computer ALT T -- Load a list of valid signal file formats Typing Keys -- Enter in a file name Press F12 to save the file. 11. EXITING WPL Close all open files by typing the following for each open signal file. Choose File|Close by typing "Alt F" then "C". The following window will appear. -^------------------------------- | Save before abandoning, | | Continue abandoning, or | | Cancel Abandoning | | | | | --------------------------------- The following keys are now valid: S = save the file and calculations (Use of .WPL format is suggested). C = continue the closing of the file. ESC = go back to the Main MENU Press "C" to continue abandoning. When the Startup MENU appears: Main MENU: FILE SYSTEM choose System|Exit To DOS by typing "Alt S" then "X". The DOS Prompt will appear. C:\WPL> 12. SUGGESTIONS FOR FURTHER EXPERIMENTATION - View the phase plane display of each level to get a feel for the various data representations - See what effect using different wavelets make - Transform and view the file WHISTLE.ASC, which contains a signal with a single frequency. - Transform and view the file SINXCUBE.BYT, which contains a signal which increases frequency over time. 13. Error Reporting Please send any error reports, comments, and suggestions to: Wavelet Packet Laboratory Digital Diagnostic Corp. 26 Rossotto Drive Hamden, CT 06514 Phone: (203)-288-9444 FAX: (203)-287-8765 or send by electronic mail to ddc@cs.yale.edu Please include your serial number and your name. Use System|About to find the serial number. Only registered users may receive technical support so send in your order form today!