Home > phiwave > uvi_wave > wt.m

wt

PURPOSE ^

WT Discrete Wavelet Transform.

SYNOPSIS ^

function y=wt(x,h,g,scales,del1,del2)

DESCRIPTION ^

 WT   Discrete Wavelet Transform.
 
      WT(X,H,G,SCALES) calculates the wavelet transform of vector X.  If X
      is a matrix (2D), WT will calculate the one dimensional wavelet
      transform of each row vector. The second argument H is the lowpass
      filter and the third argument G the highpass filter.

      The output vector contains the coefficients of the DWT ordered from
      the low pass residue at scale SCALES to the coefficients at the
      lowest scale, as the following example ilustrates:

      Output vector (k=3):

      [------|------|------------|------------------------]
      |      |       |            |
      |      |       |            `-> 1st scale coefficients 
       |      |       `-----------> 2nd scale coefficients
      |      `--------------------> 3rd scale coefficients
      `----------------> Low pass residue  at 3rd scale 

       
      If X is a matrix, the result will be another matrix with 
      the same number of rows, holding each one its respective 
      transformation.

      WT (X,H,G,SCALES,DEL1,DEL2) calculates the wavelet transform of
      vector X, but also allows the user to change the alignment of the
      outputs with respect to the input signal. This effect is achieved by
      setting to DEL1 and DEL2 the delays of H and G respectively. The
      default values of DEL1 and DEL2 are calculated using the function
      WTCENTER.

 This function is a wrapper for wtnd, for compatibility with UviWave. See
 below for UviWave copyright.

 See also:  WTND, IWT, IWTND, WTCENTER, ISPLIT.

 $Id: wt.m,v 1.1 2004/09/26 04:00:24 matthewbrett Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function y=wt(x,h,g,scales,del1,del2)
0002 % WT   Discrete Wavelet Transform.
0003 %
0004 %      WT(X,H,G,SCALES) calculates the wavelet transform of vector X.  If X
0005 %      is a matrix (2D), WT will calculate the one dimensional wavelet
0006 %      transform of each row vector. The second argument H is the lowpass
0007 %      filter and the third argument G the highpass filter.
0008 %
0009 %      The output vector contains the coefficients of the DWT ordered from
0010 %      the low pass residue at scale SCALES to the coefficients at the
0011 %      lowest scale, as the following example ilustrates:
0012 %
0013 %      Output vector (k=3):
0014 %
0015 %      [------|------|------------|------------------------]
0016 %      |      |       |            |
0017 %      |      |       |            `-> 1st scale coefficients
0018 %       |      |       `-----------> 2nd scale coefficients
0019 %      |      `--------------------> 3rd scale coefficients
0020 %      `----------------> Low pass residue  at 3rd scale
0021 %
0022 %
0023 %      If X is a matrix, the result will be another matrix with
0024 %      the same number of rows, holding each one its respective
0025 %      transformation.
0026 %
0027 %      WT (X,H,G,SCALES,DEL1,DEL2) calculates the wavelet transform of
0028 %      vector X, but also allows the user to change the alignment of the
0029 %      outputs with respect to the input signal. This effect is achieved by
0030 %      setting to DEL1 and DEL2 the delays of H and G respectively. The
0031 %      default values of DEL1 and DEL2 are calculated using the function
0032 %      WTCENTER.
0033 %
0034 % This function is a wrapper for wtnd, for compatibility with UviWave. See
0035 % below for UviWave copyright.
0036 %
0037 % See also:  WTND, IWT, IWTND, WTCENTER, ISPLIT.
0038 %
0039 % $Id: wt.m,v 1.1 2004/09/26 04:00:24 matthewbrett Exp $
0040 
0041 %--------------------------------------------------------
0042 % Copyright (C) 1994, 1995, 1996, by Universidad de Vigo
0043 %
0044 %
0045 % Uvi_Wave is free software; you can redistribute it and/or modify it
0046 % under the terms of the GNU General Public License as published by the
0047 % Free Software Foundation; either version 2, or (at your option) any
0048 % later version.
0049 %
0050 % Uvi_Wave is distributed in the hope that it will be useful, but WITHOUT
0051 % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0052 % FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
0053 % for more details.
0054 %
0055 % You should have received a copy of the GNU General Public License
0056 % along with Uvi_Wave; see the file COPYING.  If not, write to the Free
0057 % Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
0058 %
0059 %      Authors: Sergio J. Garcia Galan
0060 %               Cristina Sanchez Cabanelas
0061 %       e-mail: Uvi_Wave@tsc.uvigo.es
0062 %--------------------------------------------------------
0063 
0064 if nargin < 3
0065   error('Need data to transform and two filters');
0066 end
0067 if nargin < 4
0068   scales = [];
0069 end
0070 if nargin < 5
0071   del1 = [];
0072 end
0073 if nargin < 6
0074   del2 = [];
0075 end
0076 
0077 sz = size(x);
0078 n_dims = length(sz);
0079 p_dims = zeros(1, n_dims);
0080 if sz(2) > 1
0081   p_dims(2) = 1;
0082 else 
0083   p_dims(1) = 1; 
0084 end
0085   
0086 if n_dims > 2
0087   warning('wt does a 1D transform; use wtnd for N-D transforms');
0088 end
0089 y = wtnd(x, h, g, scales, del1, del2, p_dims);

Generated on Wed 06-Jul-2005 18:07:21 by m2html © 2003