[95fe2b]: / wavelets / wfilt_optfs.m  Maximize  Restore  History

Download this file

138 lines (136 with data), 2.7 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
function [h,g,a] = wfilt_optfs(N)
%WFILT_OPTFS Improved frequency separation filters
% Usage: [h,g,a] = wfilt_optfs(N);
%
% `[h,g,a]=wfilt_optfs(N)` returns wavelet filters with better frequency
% band sepparation (compared to Daubeschies filters of the same length)
% having at least two vanishing moments.
%
% References: paiva2012opt
%
% Examples:
% ---------
%
% Frequency responses of the analysis filters:::
%
% w = fwtinit({'optfs',7});
% wtfftfreqz(w.h);
%
a = [2,2];
h = cell(2,1);
switch(N)
case 1
h{1}=[0.3452
0.7549
0.5039
-0.0636
-0.2117
0.0476
0.0697
-0.0319];
case 2
h{1}=[0.2657
0.7055
0.5955
0.0292
-0.2416
-0.0248
0.1238
-0.0165
-0.0363
0.0137];
case 3
h{1}=[0.2670
0.6761
0.6096
0.0688
-0.2564
-0.0577
0.1334
0.0297
-0.0792
0.0031
0.0327
-0.0129];
case 4
h{1}=[0.2183
0.6298
0.6509
0.1535
-0.2487
-0.1174
0.1317
0.0687
-0.0788
-0.0345
0.0534
0.0002
-0.0197
0.0068];
case 5
h{1}=[0.2181
0.6109
0.6541
0.1797
-0.2430
-0.1420
0.1249
0.0959
-0.0806
-0.0552
0.0531
0.0286
-0.0378
-0.0043
0.0184
-0.0066];
case 6
h{1}=[0.1847
0.5703
0.6728
0.2491
-0.2185
-0.1849
0.1026
0.1253
-0.0624
-0.0823
0.0455
0.0486
-0.0329
-0.0265
0.0273
0.0036
-0.0120
0.0039];
case 7
h{1}=[0.1838
0.5566
0.6719
0.2682
-0.2071
-0.2012
0.0905
0.1406
-0.0529
-0.0958
0.0359
0.0657
-0.0301
-0.0400
0.0240
0.0220
-0.0203
-0.0052
0.0114
-0.0038];
otherwise
error('%s: No such optimized orthonormal wavelet filter.',upper(mfilename));
end;
flen = length(h{1});
h{2} = (-1).^(1:flen).'.*h{1}(end:-1:1);
if(nargout>1)
g = cell(2,1);
g{1} = h{1}(end:-1:1);
g{2} = -(-1).^(1:flen).'.*h{1};
end