Wavelet Toolbox Previous page   Next Page

Fast Multiplication of Large Matrices

This section illustrates matrix-vector multiplication in the wavelet domain.

It is clear that when sm is a sufficiently good approximation of m, the error with respect to ordinary multiplication can be small. This is the case in the first example below where m is a magic square. Conversely, when the wavelet representation of the matrix m is dense the error will be large (for example, if all the coefficients have the same order of magnitude). This is the case in the second example below where m is two-dimensional Gaussian white noise. THe figure in Example 1 compares for n = 512, the number of flops required by wavelet based method and by ordinary method versus L.

The function flops is used in the following examples to count floating point operations. This function was available in earlier MATLAB versions and is now obsolete. So, the instructions that call this function will not give the displayed results anymore. But, these examples still illustrate the advantage of the wavelet method in matrix multiplication.

Example 1: Effective Fast Matrix Multiplication

Figure 3-1: Wavelet Based Matrix Multiplication by a Vector

Example 2: Ineffective Fast Matrix Multiplication

The commands used are the same as in Example 1, but applied to a new matrix m.

Then, you obtain


Previous page  Compressing Images Wavelets in Action: Examples and Case Studies Next page

© 1994-2005 The MathWorks, Inc.