The double-density DWT is implemented by recursively applying the 3-channel analysis filter bank (described in the previous section) to the lowpass subband. This process is illustrated in the figure below. Conversely, the inverse double-density DWT is obtained by iteratively applying the synthesis filter bank.

The MATLAB function double_f1D.m computes the foward double-density DWT, w, of an input signal x, for any J number of scales.
Matlab Function - double_f1D.m
function w = double_f1D(x, J, af)
% Forward Double-Density Discrete 1-D Wavelet Transform
%
% USAGE:
% w = double_f1D(x, J, af)
% INPUT:
% x - N-point vector, where
% 1) N is divisible by 2^J
% 2) N >= 2^(J-1)*length(af)
% J - number of stages
% af - analysis filters
% af(:, 1) - lowpass filter (even length)
% af(:, 2) - first highpass filter (even length)
% af(:, 3) - second highpass filter (even length)
% OUTPUT:
% w{j}, j = 1...J+1 - double-density DWT coefficients
for k = 1:J
[x w{k}] = afb3(x, af);
end
w{J+1} = x;
As you can see, we store the subband signals such that for each scale, w{scale}{1} is the first high frequency subband signal, w{scale}{2} is the second high frequency subband signal, and w{total number of scales+1} is the low frequency subband signal produced at that scale.
The inverse double-density DWT is computed with the double_i1D.m MATLAB function. To verify the perfect reconstruction condition, we write another small piece of MATLAB code (as seen below) similar to the one in the previous section.
EXAMPLE (VERIFY PERFECT RECONSTRUCTION OF DOUBLE-DENSITY DWT)
>> [af, sf] = filters1; % analysis and synthesis filters >> x = rand(1,64); % create generic signal >> w = double_f1D(x, 3, af); % analysis filter bank (3 stages) >> y = double_i1D(w, 3, sf); % synthesis filter bank (3 stages) >> err = x - y; % compute error signal >> max(abs(err)) % verify that error is zero ans = 1.5293e-014 >> [af, sf] = filters2; % analysis and synthesis filters >> x = rand(1,64); % create generic signal >> w = double_f1D(x, 3, af); % analysis filter bank (3 stages) >> y = double_i1D(w, 3, sf); % synthesis filter bank (3 stages) >> err = x - y; % compute error signal >> max(abs(err)) % verify that error is zero ans = 3.1497e-013
First, we generate a random 1-D input signal x of length 64. The analysis and synthesis filter banks are then computed first from the filters1.m function, and later from the filters2.m filter bank. The 3-scale forward double-density DWT is computed with the double_f1D.m program to generate a function w. We then apply the inverse double-density DWT to w using the double_i1D.m MATLAB function. To ensure that the perfect reconstruction condition has been met, we then find the difference between the input signal x and the output signal y. As you can see, the differences found here are again significantly close to zero, and can actually be considered as zero.
The double-density DWT is characterized by one scaling function and two distinct wavelets, which are specifically designed to be offset from one another by one half such that:
By having more wavelets than necessary, there is a closer spacing between adjacent wavelets within the same scale. This creates a nearly shift invariant transform, which outperforms the critically sampled DWT in terms of denoising (as stated in [1]).
We can plot the wavelets associated with a certain filter bank by using the following MATLAB code fragment. Here, we set all of the wavelet coefficients to zero, with the exception of one wavelet coefficient, which is set to one. We then take the inverse transform of the entire set of coefficients and plot the resulting function.
COMPUTING THE WAVELETS ASSOCIATED WITH FILTERS1.M
>> [af, sf] = filters1; % analysis and synthesis filters
>> x=zeros(1,256); % create zero signal
>> w = double_f1D(x,5,af); % analysis filter bank (5 stages)
>> w{5}{1}(5)=1; % set single coefficient to 1
>> y = double_i1D(w,5,sf); % synthesis filter bank (5 stages)
>> figure(1)
>> plot(0:255,y); % plot the first wavelet
>> axis([0 255 -0.5 0.5]);
>> title('First Double Density 1-D Wavelet')
>> xlabel('t');
>> ylabel('\psi_1(t)');
>> x=zeros(1,256); % recreate zero signal
>> w = double_f1D(x,5,af); % analysis filter bank (5 stages)
>> figure(2)
>> w{5}{2}(5)=1; % set single coefficient to 1
>> y = double_i1D(w,5,sf); % synthesis filter bank (5 stages)
>> plot(0:255,y); % plot the second wavelet
>> axis([0 255 -0.5 0.5]);
>> title('Second Double Density 1-D Wavelet')
>> xlabel('t');
>> ylabel('\psi_2(t)');
This code fragment results in the following plots:
The second set of wavelet filters (filters2.m) will result in a different set of wavelets. By using the same MATLAB code fragment (with the exception of replacing "filters1" with "filters2"), we get the following two plots:
Summary of Programs:
- filters1.m - First set of perfect reconstruction filters
- filters2.m - Second set of perfect reconstruction filters
- afb3.m - Analysis filter bank
- sfb3.m - Synthesis filter bank
- double_f1D.m - Forward 1-D double-density wavelet transform
- double_i1D.m - Inverse 1-D double-density wavelet transform
- cshift.m - Circular shift
Download all framelet programs here. |