CDF 9/7 Wavelet Transform

2-D image decomposition and reconstruction with cdf 9/7 wavelet proposed in jpeg2000
8.9K Downloads
Updated 7 Aug 2006

No License

WAVECDF97: Multi-level discrete 2-D wavelet transform with the Cohen-Daubechies-Feauveau (CDF) 9/7 wavelet.

c = wavecdf97(x, nlevel) does the follows according to the value of
nlevel:
nlevel > 0: decomposes 2-dimension matrix x up to nlevel level;
nlevel < 0: does the inverse transform to nlevel level;
nlevel = 0: sets c equal to x;
omitted: does the same as nlevel=5.

The boundary handling method is symmetric extension.

x may be of any size; it need not have size divisible by 2^L.
For example, if x has length 9, one stage of decomposition produces a lowpass subband of length 5 and a highpass subband of length 4. Transforms of any length have perfect reconstruction (exact inversion).
NOTE: the 5 lines above are quoted directly form [3].

If nlevel is so large that the approximation coefficients become a 1-D array, any further decomposition will be performed as for 1-D decomposition until the approximation coefficients be a scale number.

Lifting algorithm is not used here; we use subband filters directly.
Lifting algorithm and spline 5/3 wavelets and other jpeg2000 related codes will be available soon.

Example:
Y = wavecdf97(X, 5); Decompose image X up to 5 level
R = wavecdf97(Y, -5); Reconstruct from Y

You can test wavecdf97.m with the following lines:
% get a 2-D uint8 image
x=imread('E:\study\jpeg2000\images\lena.tif');
% decompose
y=wavecdf97(x,2);
% show decomposed result
figure;imshow(mat2gray(y));
% reconstruct without change of anything
ix=wavecdf97(y,-2);
% show and compare the original and reconstructed images
figure;subplot(1,2,1);imshow(x);subplot(1,2,2);imshow(uint8(ix));
% look at the MSE difference
sum(sum((double(x)-ix).^2))/numel(x)

Reference:
[1] D.S.Taubman et al., JPEC2000 Image Compression: F. S. & P.,
Chinese Edition, formula 10.6-10.9 in section 10.3.1
and formula 10.13 in section 10.4.1.
[2] R.C.Gonzalez et al., Digital Image Processing Using MATLAB,
Chinese Edition, function wavefast in section 7.2.2.
[3] Pascal Getreuer, waveletcdf97.m from Matlab file Exchange website
[4] Matlab files: biorwavf.m, wavdec2.m, wawrec2.m, etc.

Contact information:
Email/MSN messenger: wangthth@hotmail.com

Tianhui Wang at Beijing, China, July, 2006
Last Revision: Aug 5, 2006

Cite As

Wang Tianhui (2026). CDF 9/7 Wavelet Transform (https://www.mathworks.com/matlabcentral/fileexchange/11846-cdf-9-7-wavelet-transform), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.0.0.0

corrected some spelling mistakes and added some comments