[62fbef]: wavelets / waveletfb.m  Maximize  Restore  History

Download this file

151 lines (124 with data), 3.6 kB

  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
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
function [w, a] = waveletfb(wname,varargin)
%WAVELETFB Wavelet Filterbank
%
%
% `w=waveletfb(name,...)` produces structure describing one level perfect
% reconstruction wavelet-type filterbank analysis and synthesis parts.
%
if nargin<1
error('%s: Too few input parameters.',upper(mfilename));
end;
if ~ischar(wname)
error(['%s: First agument must be a string denoting the type of ' ...
'wavelet.'],upper(mfilename));
end;
switch(wname)
case('db')
ord = 1;
definput.keyvals.J=[];
definput.import = {'fwt'};
[flags,kv,J]=ltfatarghelper({'J'},definput,{varargin{2:end}});
if(isempty(J)) J=1; end
if(~isempty(varargin)) ord = varargin{1}; end;
[w.h, w.g, a] = wfilt_db(ord,J);
if(flags.do_type_null)
w.type = 'dec';
else
w.type = flags.type;
end
if(flags.do_ext_null)
w.ext = 'per';
else
w.ext = flags.ext;
end
case('dden')
no = 1;
definput.import = {'fwt'};
[flags,kv]=ltfatarghelper({},definput,{varargin{2:end}});
if(~isempty(varargin)) no = varargin{1}; end;
[w.h, w.g, a] = wfilt_dden(no);
if(flags.do_type_null)
w.type = 'dec';
else
w.type = flags.type;
end
if(flags.do_ext_null)
w.ext = 'per';
else
w.ext = flags.ext;
end
case('dgrid')
no = 1;
definput.import = {'fwt'};
[flags,kv]=ltfatarghelper({},definput,{varargin{2:end}});
if(~isempty(varargin)) no = varargin{1}; end;
[w.h, w.g, a] = wfilt_dgrid(no);
if(flags.do_type_null)
w.type = 'dec';
else
w.type = flags.type;
end
if(flags.do_ext_null)
w.ext = 'per';
else
w.ext = flags.ext;
end
case('dtree')
no = 1;
definput.import = {'fwt'};
[flags,kv]=ltfatarghelper({},definput,{varargin{:}});
if(~isempty(varargin)) no = varargin{1}; end;
[w.h, w.g, a] = wfilt_dtree;
w.type = 'dtdwt';
if(flags.do_ext_null)
w.ext = 'per';
else
w.ext = flags.ext;
end
case('hden')
no = 1;
definput.import = {'fwt'};
[flags,kv]=ltfatarghelper({},definput,{varargin{2:end}});
if(~isempty(varargin)) no = varargin{1}; end;
[w.h, w.g, a] = wfilt_hden(no);
w.type = 'hddwt';
if(flags.do_ext_null)
w.ext = 'per';
else
w.ext = flags.ext;
end
case('optfs')
no = 1;
definput.import = {'fwt'};
[flags,kv]=ltfatarghelper({},definput,{varargin{2:end}});
if(~isempty(varargin)) no = varargin{1}; end;
[w.h, w.g, a] = wfilt_optfs(no);
if(flags.do_type_null)
w.type = 'dec';
else
w.type = flags.type;
end
if(flags.do_ext_null)
w.ext = 'per';
else
w.ext = flags.ext;
end
case('symds')
no = 1;
definput.import = {'fwt'};
[flags,kv]=ltfatarghelper({},definput,{varargin{2:end}});
if(~isempty(varargin)) no = varargin{1}; end;
[w.h, w.g, a] = wfilt_symds(no);
if(flags.do_type_null)
w.type = 'dec';
else
w.type = flags.type;
end
if(flags.do_ext_null)
w.ext = 'per';
else
w.ext = flags.ext;
end
otherwise
error('%s: Unknown wavelet type: %s',upper(mfilename),name);
end;