Mercurial > hg > smallbox
comparison util/Rice Wavelet Toolbox/mrdwt.mhelp @ 78:f69ae88b8be5
added Rice Wavelet Toolbox with my modification, so it can be compiled on newer systems.
author | Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk> |
---|---|
date | Fri, 25 Mar 2011 15:27:33 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
76:d052ec5b742f | 78:f69ae88b8be5 |
---|---|
1 function [yl,yh,L] = mrdwt(x,h,L); | |
2 % [yl,yh,L] = mrdwt(x,h,L); | |
3 % | |
4 % Function computes the redundant discrete wavelet transform y | |
5 % for a 1D or 2D input signal. (Redundant means here that the | |
6 % sub-sampling after each stage is omitted.) yl contains the | |
7 % lowpass and yh the highpass components. In the case of a 2D | |
8 % signal, the ordering in yh is | |
9 % [lh hl hh lh hl ... ] (first letter refers to row, second to | |
10 % column filtering). | |
11 % | |
12 % Input: | |
13 % x : finite length 1D or 2D signal (implicitly periodized) | |
14 % h : scaling filter | |
15 % L : number of levels. In the case of a 1D | |
16 % length(x) must be divisible by 2^L; | |
17 % in the case of a 2D signal, the row and the | |
18 % column dimension must be divisible by 2^L. | |
19 % If no argument is | |
20 % specified, a full DWT is returned for maximal possible L. | |
21 % | |
22 % Output: | |
23 % yl : lowpass component | |
24 % yh : highpass components | |
25 % L : number of levels | |
26 % | |
27 % HERE'S AN EASY WAY TO RUN THE EXAMPLES: | |
28 % Cut-and-paste the example you want to run to a new file | |
29 % called ex.m, for example. Delete out the % at the beginning | |
30 % of each line in ex.m (Can use search-and-replace in your editor | |
31 % to replace it with a space). Type 'ex' in matlab and hit return. | |
32 % | |
33 % | |
34 % Example 1:: | |
35 % x = makesig('Leopold',8); | |
36 % h = daubcqf(4,'min'); | |
37 % L = 1; | |
38 % [yl,yh,L] = mrdwt(x,h,L) | |
39 % yl = 0.8365 0.4830 0 0 0 0 -0.1294 0.2241 | |
40 % yh = -0.2241 -0.1294 0 0 0 0 -0.4830 0.8365 | |
41 % L = 1 | |
42 % Example 2: | |
43 % load lena; | |
44 % h = daubcqf(4,'min'); | |
45 % L = 2; | |
46 % [ll_lev2,yh,L] = mrdwt(lena,h,L); % lena is a 256x256 matrix | |
47 % N = 256; | |
48 % lh_lev1 = yh(:,1:N); | |
49 % hl_lev1 = yh(:,N+1:2*N); | |
50 % hh_lev1 = yh(:,2*N+1:3*N); | |
51 % lh_lev2 = yh(:,3*N+1:4*N); | |
52 % hl_lev2 = yh(:,4*N+1:5*N); | |
53 % hh_lev2 = yh(:,5*N+1:6*N); | |
54 % figure; colormap(gray); imagesc(lena); title('Original Image'); | |
55 % figure; colormap(gray); imagesc(ll_lev2); title('LL Level 2'); | |
56 % figure; colormap(gray); imagesc(hh_lev2); title('HH Level 2'); | |
57 % figure; colormap(gray); imagesc(hl_lev2); title('HL Level 2'); | |
58 % figure; colormap(gray); imagesc(lh_lev2); title('LH Level 2'); | |
59 % figure; colormap(gray); imagesc(hh_lev1); title('HH Level 1'); | |
60 % figure; colormap(gray); imagesc(hl_lev2); title('HL Level 1'); | |
61 % figure; colormap(gray); imagesc(lh_lev2); title('LH Level 1'); | |
62 % | |
63 % See also: mdwt, midwt, mirdwt | |
64 % | |
65 % Warning! min(size(x))/2^L should be greater than length(h) | |
66 % | |
67 | |
68 %File Name: mrdwt.m | |
69 %Last Modification Date: 08/07/95 15:14:47 | |
70 %Current Version: mrdwt.m 2.4 | |
71 %File Creation Date: Wed Oct 19 10:51:58 1994 | |
72 %Author: Markus Lang <lang@jazz.rice.edu> | |
73 % | |
74 %Copyright (c) 2000 RICE UNIVERSITY. All rights reserved. | |
75 %Created by Markus Lang, Department of ECE, Rice University. | |
76 % | |
77 %This software is distributed and licensed to you on a non-exclusive | |
78 %basis, free-of-charge. Redistribution and use in source and binary forms, | |
79 %with or without modification, are permitted provided that the following | |
80 %conditions are met: | |
81 % | |
82 %1. Redistribution of source code must retain the above copyright notice, | |
83 % this list of conditions and the following disclaimer. | |
84 %2. Redistribution in binary form must reproduce the above copyright notice, | |
85 % this list of conditions and the following disclaimer in the | |
86 % documentation and/or other materials provided with the distribution. | |
87 %3. All advertising materials mentioning features or use of this software | |
88 % must display the following acknowledgment: This product includes | |
89 % software developed by Rice University, Houston, Texas and its contributors. | |
90 %4. Neither the name of the University nor the names of its contributors | |
91 % may be used to endorse or promote products derived from this software | |
92 % without specific prior written permission. | |
93 % | |
94 %THIS SOFTWARE IS PROVIDED BY WILLIAM MARSH RICE UNIVERSITY, HOUSTON, TEXAS, | |
95 %AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | |
96 %BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | |
97 %FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RICE UNIVERSITY | |
98 %OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |
99 %EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
100 %PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
101 %OR BUSINESS INTERRUPTIONS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
102 %WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |
103 %OTHERWISE), PRODUCT LIABILITY, OR OTHERWISE ARISING IN ANY WAY OUT OF THE | |
104 %USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
105 % | |
106 %For information on commercial licenses, contact Rice University's Office of | |
107 %Technology Transfer at techtran@rice.edu or (713) 348-6173 | |
108 % | |
109 %Change History: | |
110 % | |
111 %Modification #1 | |
112 %Mon Aug 7 14:26:26 CDT 1995 | |
113 %Rebecca Hindman <hindman@ece.rice.edu> | |
114 %Added L to function line so that it can be displayed as an output | |
115 % | |
116 %Thursday Mar 2 2000 | |
117 % Added Example 2 | |
118 % Felix Fernandes <felixf@rice.edu> | |
119 | |
120 |