ivan@78: function [x,L] = mirdwt(yl,yh,h,L); ivan@78: % function [x,L] = mirdwt(yl,yh,h,L); ivan@78: % ivan@78: % Function computes the inverse redundant discrete wavelet ivan@78: % transform x for a 1D or 2D input signal. (Redundant means here ivan@78: % that the sub-sampling after each stage of the forward transform ivan@78: % has been omitted.) yl contains the lowpass and yl the highpass ivan@78: % components as computed, e.g., by mrdwt. In the case of a 2D ivan@78: % signal, the ordering in ivan@78: % yh is [lh hl hh lh hl ... ] (first letter refers to row, second ivan@78: % to column filtering). ivan@78: % ivan@78: % Input: ivan@78: % yl : lowpass component ivan@78: % yh : highpass components ivan@78: % h : scaling filter ivan@78: % L : number of levels. In the case of a 1D signal, ivan@78: % length(yl) must be divisible by 2^L; ivan@78: % in the case of a 2D signal, the row and ivan@78: % the column dimension must be divisible by 2^L. ivan@78: % ivan@78: % Output: ivan@78: % x : finite length 1D or 2D signal ivan@78: % L : number of levels ivan@78: % ivan@78: % HERE'S AN EASY WAY TO RUN THE EXAMPLES: ivan@78: % Cut-and-paste the example you want to run to a new file ivan@78: % called ex.m, for example. Delete out the % at the beginning ivan@78: % of each line in ex.m (Can use search-and-replace in your editor ivan@78: % to replace it with a space). Type 'ex' in matlab and hit return. ivan@78: % ivan@78: % ivan@78: % Example 1: ivan@78: % xin = makesig('Leopold',8); ivan@78: % h = daubcqf(4,'min'); ivan@78: % L = 1; ivan@78: % [yl,yh,L] = mrdwt(xin,h,L); ivan@78: % [x,L] = mirdwt(yl,yh,h,L) ivan@78: % x = 0.0000 1.0000 0.0000 -0.0000 0 0 0 -0.0000 ivan@78: % L = 1 ivan@78: % ivan@78: % Example 2: ivan@78: % load lena; ivan@78: % h = daubcqf(4,'min'); ivan@78: % L = 2; ivan@78: % [ll_lev2,yh,L] = mrdwt(lena,h,L); % lena is a 256x256 matrix ivan@78: % N = 256; ivan@78: % lh_lev1 = yh(:,1:N); ivan@78: % hl_lev1 = yh(:,N+1:2*N); ivan@78: % hh_lev1 = yh(:,2*N+1:3*N); ivan@78: % lh_lev2 = yh(:,3*N+1:4*N); ivan@78: % hl_lev2 = yh(:,4*N+1:5*N); ivan@78: % hh_lev2 = yh(:,5*N+1:6*N); ivan@78: % figure; colormap(gray); imagesc(lena); title('Original Image'); ivan@78: % figure; colormap(gray); imagesc(ll_lev2); title('LL Level 2'); ivan@78: % figure; colormap(gray); imagesc(hh_lev2); title('HH Level 2'); ivan@78: % figure; colormap(gray); imagesc(hl_lev2); title('HL Level 2'); ivan@78: % figure; colormap(gray); imagesc(lh_lev2); title('LH Level 2'); ivan@78: % figure; colormap(gray); imagesc(hh_lev1); title('HH Level 1'); ivan@78: % figure; colormap(gray); imagesc(hl_lev2); title('HL Level 1'); ivan@78: % figure; colormap(gray); imagesc(lh_lev2); title('LH Level 1'); ivan@78: % [lena_Hat,L] = mirdwt(ll_lev2,yh,h,L); ivan@78: % figure; colormap(gray); imagesc(lena_Hat); ivan@78: % title('Reconstructed Image'); ivan@78: % ivan@78: % See also: mdwt, midwt, mrdwt ivan@78: % ivan@78: % Warning! min(size(yl))/2^L should be greater than length(h) ivan@78: % ivan@78: ivan@78: %File Name: mirdwt.m ivan@78: %Last Modification Date: 08/07/95 15:14:21 ivan@78: %Current Version: mirdwt.m 2.4 ivan@78: %File Creation Date: Wed Oct 19 10:51:58 1994 ivan@78: %Author: Markus Lang ivan@78: % ivan@78: %Copyright (c) 2000 RICE UNIVERSITY. All rights reserved. ivan@78: %Created by Markus Lang, Department of ECE, Rice University. ivan@78: % ivan@78: %This software is distributed and licensed to you on a non-exclusive ivan@78: %basis, free-of-charge. Redistribution and use in source and binary forms, ivan@78: %with or without modification, are permitted provided that the following ivan@78: %conditions are met: ivan@78: % ivan@78: %1. Redistribution of source code must retain the above copyright notice, ivan@78: % this list of conditions and the following disclaimer. ivan@78: %2. Redistribution in binary form must reproduce the above copyright notice, ivan@78: % this list of conditions and the following disclaimer in the ivan@78: % documentation and/or other materials provided with the distribution. ivan@78: %3. All advertising materials mentioning features or use of this software ivan@78: % must display the following acknowledgment: This product includes ivan@78: % software developed by Rice University, Houston, Texas and its contributors. ivan@78: %4. Neither the name of the University nor the names of its contributors ivan@78: % may be used to endorse or promote products derived from this software ivan@78: % without specific prior written permission. ivan@78: % ivan@78: %THIS SOFTWARE IS PROVIDED BY WILLIAM MARSH RICE UNIVERSITY, HOUSTON, TEXAS, ivan@78: %AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, ivan@78: %BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ivan@78: %FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RICE UNIVERSITY ivan@78: %OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ivan@78: %EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ivan@78: %PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; ivan@78: %OR BUSINESS INTERRUPTIONS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ivan@78: %WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR ivan@78: %OTHERWISE), PRODUCT LIABILITY, OR OTHERWISE ARISING IN ANY WAY OUT OF THE ivan@78: %USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ivan@78: % ivan@78: %For information on commercial licenses, contact Rice University's Office of ivan@78: %Technology Transfer at techtran@rice.edu or (713) 348-6173 ivan@78: % ivan@78: %Change History: ivan@78: % ivan@78: %Modification #1 ivan@78: %Mon Aug 7 15:09:51 CDT 1995 ivan@78: %Rebecca Hindman ivan@78: %Added L to function line so that it can be displayed as an output ivan@78: % ivan@78: %Modification #2 ivan@78: %Thursday Mar 2 2000 ivan@78: % Added Example 2 ivan@78: % Felix Fernandes ivan@78: ivan@78: ivan@78: ivan@78: ivan@78: ivan@78: ivan@78: ivan@78: ivan@78: ivan@78: ivan@78: ivan@78: ivan@78: ivan@78: ivan@78: ivan@78: