## Math 414 — Wavelet Toolbox Example

Here is an example of how to use the wavelet toolbox. Suppose that you want to analyze a data file with a cat meowing, cat.wav; the ".wav" extension is one of the standard formats for sound. Bring up Matlab. Load the file using the command:

The row vector ycat contains the digitized sound samples in double precision arithmetic. The variable srate is the sampling rate in hertz - i.e, the number of samples per second. For cat.wav, the number of samples in ycat is 10,319. The rate is 11,025, or 11.025 kHz.

To do a wavelet analysis of ycat, first bring up the wavelet menu with the command

This will bring up a window with various options for dding a wavelet analysis. Since sound files are 1-D, go to the panel labeled "One-Dimensional," then click on Wavelet 1-D. This will open a new window. Click on file, and then on "import from Workspace." This brings up a list variables in the workspace. Click on ycat. This loads ycat. The data loaded in is displayed as a plot. You are now ready to do a wavelet analysis on the data. 
 On the top of the right panel you will see written Wavelet and next to that a drop down menu, with haar at the top. From the wavelets listed, choose db, for Daubechies wavelet. Once you've done that, another drop down menu appears. The number there refer to the wavelet type: db1 is actually the Haar wavelet; db2 is the Daubechies wavelet that has N = 2 vanishing wavelet moments; db3 has N = 3 vanishing wavelet moments. The number of pk's is 2N. Thus, for N =2, there are four, p0, p1 ,p2, p3, whose values are given in the text. 
 Next, choose the decomposition level that you want to use. The convention used in Matlab is opposite the one used in the text. The finest level is 0 in Matlab. As the level increases, the levels become coarser. For instance, if we have our starting level at j = 3, which corresponds to 8 samples per second, the analysis would step down to j = 2, then j = 1, j = 0, etc. The same analysis in Matlab would start at level 0, then go to level 1, level 2, an finally stop at level 3. Once you've picked a level, click analyze. Try the various options available to examine the data to display the wavelet decomposition. 
 Finally, the wavelet window has several options for dealing with the data: compression and denoising being the standard options Of course, there are a number of other things you can do, singularity detection, for example. This is useful if you are looking for a change in behavior of the signal.