dblift.m
上传用户:haiyisale
上传日期:2013-01-09
资源大小:3246k
文件大小:14k
源码类别:

波变换

开发平台:

Matlab

  1. function LS = dblift(wname)
  2. %DBLIFT Daubechies lifting schemes.
  3. %   LS = DBLIFT(WNAME) returns the lifting scheme specified by WNAME.
  4. %
  5. %   A lifting scheme LS is a N x 3 cell array such that:
  6. %     for k = 1:N-1
  7. %       | LS{k,1} is the lifting "type" 'p' (primal) or 'd' (dual).
  8. %       | LS{k,2} is the corresponding lifting filter.
  9. %       | LS{k,3} is the higher degree of the Laurent polynomial
  10. %       |         corresponding to the previous filter LS{k,2}.
  11. %     LS{N,1} is the primal normalization.
  12. %     LS{N,2} is the dual normalization.
  13. %     LS{N,3} is not used.
  14. %
  15. %   For more information about lifting schemes type: lsinfo.
  16. %
  17. %   The valid values for WNAME are:
  18. %      'haar', 'db1', 'db2', 'db3', 'db4', 'db5', 'db6', 'db7', 'db8'
  19. %   M. Misiti, Y. Misiti, G. Oppenheim, J.M. Poggi 09-Feb-2000.
  20. %   Last Revision: 30-Jun-2003.
  21. %   Copyright 1995-2004 The MathWorks, Inc.
  22. %   $Revision: 1.1.6.2 $ $Date: 2004/03/15 22:40:03 $ 
  23. wname = lower(wname);
  24. if isequal(wname,'haar')
  25.     Num = 1;
  26. elseif isequal(wname,'db1int')
  27.     Num = 1.2;
  28. else
  29.     Num = wstr2num(wname(3:end));
  30. end
  31. switch Num
  32.     %== db1 ============================================================%
  33.     case 1          
  34.         LS = {...
  35.             'd',[-1],0; ...
  36.             'p',[1/2],0 ...
  37.             };
  38.         LS(end+1,:) = {sqrt(2),sqrt(2)/2,[]};
  39.         
  40.     case 1.1          
  41.         LS = {...
  42.             'd',[-1],1; ...
  43.             'p',[1/2],-1 ...
  44.             };
  45.         LS(end+1,:) = {sqrt(2),sqrt(2)/2,[]};
  46.     case 1.2          
  47.         LS = {...
  48.             'd',[-1],0; ...
  49.             'p',[1/2],0 ...
  50.             };
  51.         LS(end+1,:) = {1,1/2,['I']};
  52.     %== db2 ============================================================%
  53.     case 2
  54.         LS = {...
  55.                 'd',[-sqrt(3)],0; ...
  56.                 'p',[sqrt(3)-2 sqrt(3)]/4,1; ...
  57.                 'd',[1],-1 ...
  58.             };
  59.         LS(end+1,:) = {(sqrt(3)+1)/sqrt(2),(sqrt(3)-1)/sqrt(2),[]};
  60. % %--------------------  Num LS = 1  ----------------------% 
  61. % LSB = {...                                                                 
  62. % 'd'                     [ -1.7320508075722079]                      [0]   
  63. % 'p'                     [ -0.0669872981075236  0.4330127018915160]  [1]   
  64. % 'd'                     [  0.9999999999994959]                      [-1]  
  65. % [  1.9318516525804916]  [  0.5176380902044105]                      []    
  66. % }; 
  67.     case 2.1
  68. %--------------------  Num LS = 2  ----------------------% 
  69. LS = {...                                                                
  70. 'd'                     [ -0.5773502691885155]                      [1]  
  71. 'p'                     [  0.2009618943233436  0.4330127018926641]  [0]  
  72. 'd'                     [ -0.3333333333327671]                      [0]  
  73. [  1.1153550716496254]  [  0.8965754721686846]                      []   
  74. };
  75.     case 2.2        
  76. %--------------------  Num LS = 3  ----------------------% 
  77. LS = {...                                                                
  78. 'd'                     [  0.5773502691900463]                      [0]  
  79. 'p'                     [ -0.4330127018915159  2.7990381056783082]  [0]  
  80. 'd'                     [ -0.3333333333332407]                      [1]  
  81. [  0.2988584907223872]  [  3.3460652149545598]                      []   
  82. };
  83.     case 2.3                
  84. %--------------------  Num LS = 4  ----------------------% 
  85. LS = {...                                                                 
  86. 'd'                     [  1.7320508075676158]                      [1]   
  87. 'p'                     [ -0.4330127018926641 -0.9330127018941287]  [-1]  
  88. 'd'                     [  0.9999999999980750]                      [2]   
  89. [ -0.5176380902041495]  [ -1.9318516525814655]                      []    
  90. };                                                                        
  91.         
  92.     %== db3 ============================================================%
  93.     case 3
  94. %--------------------  Num LS = 7  ----------------------% 
  95. % Pow MAX = 0 - diff POW = 0
  96. %---+----+----+----+----+---%
  97. LS = {...                                                                 
  98. 'd'                     [ -2.4254972439123361]                      [0]   
  99. 'p'                     [ -0.0793394561587384  0.3523876576801823]  [1]   
  100. 'd'                     [  2.8953474543648969 -0.5614149091879961]  [-1]  
  101. 'p'                     [  0.0197505292372931]                      [2]   
  102. [  2.3154580432421348]  [  0.4318799914853075]                      []    
  103. };                                                                        
  104.     case 3.01        
  105. %--------------------  Num LS = 4  ----------------------% 
  106. LS = {...                                                                
  107. 'd'                     [  0.4122865950085308]                      [0]  
  108. 'p'                     [ -0.3523876576801823  1.5651362801993258]  [0]  
  109. 'd'                     [ -0.4921518447467098 -0.0284590895616518]  [1]  
  110. 'p'                     [  0.3896203901445617]                      [0]  
  111. [  0.5213212719156450]  [  1.9182029467652528]                      []   
  112. };                                                                              
  113.     case 3.1
  114. %--------------------  Num LS = 2  ----------------------% 
  115. LS = {...                                                                
  116. 'd'                     [ -0.4122865950517414]                      [1]  
  117. 'p'                     [  0.4667569466389586  0.3523876576432496]  [0]  
  118. 'd'                     [ -0.4921518449249469  0.0954294390155849]  [0]  
  119. 'p'                     [ -0.1161930919191620]                      [1]  
  120. [  0.9546323126334674]  [  1.0475237290484967]                      []   
  121. }; 
  122.     case 3.2
  123. %--------------------  Num LS = 5  ----------------------% 
  124. LS = {...                                                                 
  125. 'd'                     [ -0.4122865950517414]                      [1]   
  126. 'p'                     [ -1.5651362796324981  0.3523876576432496]  [0]   
  127. 'd'                     [ -2.5381416988469603  0.4921518449249469]  [1]   
  128. 'p'                     [  0.3896203899372190]                      [-1]  
  129. [  4.9232611941772104]  [  0.2031173973021602]                      []    
  130. };
  131.     case 3.3
  132. %--------------------  Num LS = 6  ----------------------% 
  133. LS = {...                                                                 
  134. 'd'                     [  2.4254972441665452]                      [1]   
  135. 'p'                     [ -0.3523876576432495 -0.2660422349436360]  [-1]  
  136. 'd'                     [  2.8953474539232271  0.1674258735039567]  [2]   
  137. 'p'                     [ -0.0662277660392190]                      [-1]  
  138. [ -1.2644633083567955]  [ -0.7908493614571760]                      []    
  139. };                                                                        
  140.         
  141.     %== db4 ============================================================%
  142.     case 4
  143. %--------------------  Num LS = 4  ----------------------% 
  144. LS = {...                                                                                    
  145. 'd'                     [ -0.3222758879971411]                                          [1]  
  146. 'p'                     [ -1.1171236051605939 -0.3001422587485443]                      [0]  
  147. 'd'                     [ -0.0188083527262439  0.1176480867984784]                      [2]  
  148. 'p'                     [  2.1318167127552199  0.6364282711906594]                      [0]  
  149. 'd'                     [ -0.4690834789110281  0.1400392377326117 -0.0247912381571950]  [0]  
  150. [  0.7341245276832514]  [  1.3621667200737697]                                          []   
  151. };                                                                                           
  152.     case 4.1  
  153. %--------------------  Num LS = 3  ----------------------% 
  154. LS = {...                                                                 
  155. 'd'                     [ -0.3222758879971411]                      [1]   
  156. 'p'                     [  0.7346312579222475  0.2919531260038340]  [0]   
  157. 'd'                     [ -0.5400282834063568  0.1726731008597592]  [0]   
  158. 'p'                     [  0.0647242393202307 -0.3648383438736335]  [2]   
  159. 'd'                     [ -0.0326236494591675]                      [-2]  
  160. [  0.8421450430836753]  [  1.1874439067388065]                      []    
  161. };                                                                        
  162.     case 4.2  
  163. %--------------------  Num LS = 5  ----------------------% 
  164. LS = {...                                                                 
  165. 'd'                     [  0.3222758880003921]                      [0]   
  166. 'p'                     [ -0.2919531260008889  1.1171236051160263]  [0]   
  167. 'd'                     [ -0.5400282834279011 -0.1135514966410223]  [1]   
  168. 'p'                     [ -0.0984234944920643  0.5547946967916940]  [1]   
  169. 'd'                     [  0.0214536265550236]                      [-1]  
  170. [  0.6829218120474427]  [  1.4642964719517990]                      []    
  171. };                                                                        
  172.     %== db5 ============================================================%
  173.     case 5
  174. %--------------------  Num LS = 3  ----------------------% 
  175. LS = {...                                                                 
  176. 'd'                     [ -0.2651451428113514]                      [1]   
  177. 'p'                     [  0.9940591341382633  0.2477292913288009]  [0]   
  178. 'd'                     [ -0.5341246460905558  0.2132742982207803]  [0]   
  179. 'p'                     [  0.2247352231444452 -0.7168557197126235]  [2]   
  180. 'd'                     [ -0.0775533344610336  0.0121321866213973]  [-2]  
  181. 'p'                     [ -0.0357649246294110]                      [3]   
  182. [  0.7632513182465389]  [  1.3101844387211246]                      []    
  183. };                                                                        
  184.     case 5.1
  185.         %--------------------  Num LS = 8  ----------------------% 
  186.         LS = {...                                                                 
  187.         'd'                     [  0.2651451427754539]                      [0]   
  188.         'p'                     [ -0.2477292913623405  0.8781630286393748]  [0]   
  189.         'd'                     [ -0.5341246459806663 -0.2414213048251172]  [1]   
  190.         'p'                     [ -0.1985336258386243  0.6332784120192370]  [1]   
  191.         'd'                     [  0.0877884834474499 -0.0137333394082371]  [-1]  
  192.         'p'                     [  0.0315951369981596]                      [2]   
  193.         [  0.8120562227775144]  [  1.2314418287192634]                      []    
  194.         };  
  195.     case 6
  196. %--------------------  Num LS = 1  ----------------------% 
  197. % Pow MAX = 0 - diff POW = 0
  198. %---+----+----+----+----+---%
  199. LS = {...                                                                 
  200. 'd'                     [ -4.4344683000391223]                      [0]   
  201. 'p'                     [ -0.0633131925095066  0.2145934499409130]  [1]   
  202. 'd'                     [  9.9700156175718320 -4.4931131753641633]  [-1]  
  203. 'p'                     [ -0.0236634936395882  0.0574139367993266]  [3]   
  204. 'd'                     [  2.3564970162896977 -0.6787843541162683]  [-3]  
  205. 'p'                     [ -0.0009911655293238  0.0071835631074942]  [5]   
  206. 'd'                     [  0.0941066741175849]                      [-5]  
  207. [  3.1214647228121661]  [  0.3203624223883869]                      []    
  208. };                                                                        
  209.         
  210.     case 7
  211. %--------------------  Num LS = 1  ----------------------% 
  212. % Pow MAX = 0 - diff POW = 0
  213. %---+----+----+----+----+---%
  214. LS = {...                                                                 
  215. 'p'                     [  5.0934984843051252]                      [0]   
  216. 'd'                     [ -0.1890420920712265  0.0573987259882762]  [0]   
  217. 'p'                     [  5.9592087615113751-12.2854449956285200]  [2]   
  218. 'd'                     [ -0.0604278631256078  0.0291354832685777]  [-2]  
  219. 'p'                     [  1.5604402591648248 -3.9707106658519669]  [4]   
  220. 'd'                     [ -0.0126913773028362  0.0033065734202625]  [-4]  
  221. 'p'                     [  0.0508158836098717 -0.4141984501693177]  [6]   
  222. 'd'                     [ -0.0004062144890730]                      [-6]  
  223. [  0.2990107076865977]  [  3.3443618381992222]                      []    
  224. };                                                                        
  225.         
  226.     case 8
  227. %--------------------  Num LS = 2  ----------------------% 
  228. % Pow MAX = 0 - diff POW = 0
  229. %---+----+----+----+----+---%
  230. LS = {...                                                                                     
  231. 'd'                     [ -5.7496416141714990]                                          [0]   
  232. 'p'                     [ -0.0522692017330962  0.1688172436569421]                      [1]   
  233. 'd'                     [ 14.5428210043618850 -7.4021068366100549]                      [-1]  
  234. 'p'                     [ -0.0324020739512596  0.0609092564633227]                      [3]   
  235. 'd'                     [  5.8187164907231610 -2.7556987881059287]                      [-3]  
  236. 'p'                     [  0.9452952681157910  0.2420216844324576]                      [5]   
  237. 'd'                     [  0.0001888402536823 -0.0018038158742157]                      [-3]  
  238. 'p'                     [ -0.9526138318957663 -0.2241381624167550]                      [5]   
  239. 'd'                     [  1.0497432943790195 -0.2469917331775993  0.0271973973533717]  [-5]  
  240. [  3.5493622541356347]  [  0.2817407546481972]                                          []    
  241. }; 
  242.         
  243.     otherwise
  244.         error('Invalid wavelet number.')
  245.         
  246. end