File: FWT2D.cat

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (86 lines) | stat: -rw-r--r-- 4,448 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

FWT2D(2)                       Scilab Function                       FWT2D(2)
NAME
  FWT2D - 2D Forward Disrete Wavelet Transform

  Author: Bertrand Guiheneuf

  This routine computes discrete wavelet transforms of a 2D real signal. Two
  transforms are possible : Orthogonal and Biorthogonal

Usage
  [wt,index,length]=FWT2D(Input,NbIter,f1,[f2])

Input parameters
       o Input : real matrix [m,n] Contains the signal to be decomposed.
       o NbIter : real positive scalar Number of decomposition Levels
       o f1 : Analysis filter
       o f2 : real unidimensional matrix [m,n] Synthesis filter
Output parameters
       o wt : real matrix Wavelet transform. Contains all the datas of the
         decomposition.
       o index : real matrix [NbIter,4] Contains the indexes (in wt) of the
         projection of the signal on the multiresolution subspaces
       o length : real matrix [NbIter,2] Contains the dimensions of each pro-
         jection

Description

Introduction
  The 2D discrete wavelet transform of Input is a projection on 2D multireso-
  lution Spaces.  The number of scales NbIter tells how many convolutions are
  computed. Each convolution is followed by a downsampling of the signal in
  both direction. For example, if the original matrix is (256,512), a result-
  ing projection after the first iteration  is (128,256). In 2D, there are 4
  projections for each iteration corresponding to 2 projections in the row
  directions and 2 in the column direction. In each direction, the 2 projec-
  tions are obtained through the convolutions with a low-pass filter and its
  associated high-pass filter. The projections are then HL HH LH LL where the
  first letter represents the filter used for the row filtering and the
  second letter is the filter used for column filtering. H is High-Pass
  filter and L Low-pass filter. Except for the last level where the four con-
  volutions are kept, the LL output is always used as the input of the fol-
  lowing iteration.  Two types of filters are available : Quadrature Mirror
  Filters (Orthogonal) or Conjugate Quadrature Filters (Biorthogonal). Each
  one allows perfect reconstruction of the signal but only CQF pairs can be
  symetric. The advantage of QMF is that synthesis and reconstruction filters
  are the same.

Parameters
  Input must be a real matrix. All dimensions are allowed but for a 1D vec-
  tor, FWT is best suited.  NbIter is the number of scales computed. It must
  be a positive integer greater than one and should be smaller then
  log2(max(size(Input))) but this is not necessary. f1 is the linear FIR
  filter used for the analysis and might be  obtained with MakeQMF() or
  MakeCQF() f2 is the linear FIR filter to use for the reconstruction. It is
  only necessary if f1 has been obtained with MakeCQF(). wt is the wavelet
  decomposition structure. The next two parametres must be used to read the
  wavelet coefficients.  index contains the indexes of the first coefficient
  of each output. At each scale Scale, the output indexes are: index(Scale,1)
  : HL index(Scale,2) : LH index(Scale,3) : HH index(Scale,4) : LL on the
  last scale and 0 otherwise length contains the dimensions (height, width)
  of each output at a given Iteration.

Algorithm details
  Convolutions are computed through discrete linear convolutions in time
  domain. No FFT is used. The signal is mirrored at its boundaries. The
  wavelet structure (wt) is a vector and NOT a 2D matrix. It contains all the
  informatiosn for the reconstruction: wt(1) : height of the original signal
  wt(2) : width of the original signal wt(3) : Number of iterations wt(4) :
  Number of causal coefficients of the synthesis filter wt(5) : Number of
  anticausal coefficients of the synthesis filter then the Synthesis filter
  coefficients and finaly the wavelet coefficient are stored .

Examples
  a=rand(256,256); q=MakeQMF('daubechies',4); wt,wti,wtl = FWT2D(a,3,q);
  V=WT2Dext(wt,1,2); viewmat(V); Then to suppress the Lowest Frequency com-
  ponent and then reconstruction: index=0; for i=1:wtl(3,1), for
  j=1:wtl(3,2), wt(wti(3,4)+index)=0; end; end; result=IWT2D(wt);

References
  Meyer Y. : Wavelets, Algorithms & Applications, SIAM.  Meyer Y. :
  Ondelettes et Operateurs (I) : Hermann, Paris Daubechies I. : Ten Lectures
  on Wavelets, CBMS-NSF Regional conference series in applied mathematics.

See Also
  IWT2D, MakeQMF, MakeCQF, WT2Dext, WT2DVisu, WT2DStruct