Demo2: Display subbands

This program displays the subband of the rational-dilation wavelet transform. The test signal is taken from single row of a photographic image. This function sets s = 1 and p = q - 1. Therefore, the the Q-factor of the transform is low and the redundancy is equal to q. (Don't confuse q with the Q-factor.)

Contents

Load test signal

x = load('data/signal_1.txt');

figure(1)
clf
plot(x)
box off
title('TEST SIGNAL')

% Add path to wavelet functions
addpath radwt_functions_v2          % or use 'radwt_functions_v1'
addpath extra_functions

Compute wavelet transform of signal

N = length(x);
p = 4;
q = 5;
s = 1;
J = 11;

red = 1/s * 1/(1-p/q);              % Redundancy
w = radwt(x, J, p, q, s);           % Compute wavelet transform

Verify Parseval's property

The energy in the wavelet domain equals the signal energy.

% Compute signal energy
SE = sum(x.^2);

% Computer energy in wavelet domain
WE = 0;
for j = 1:J+1
    WE = WE + sum(abs(w{j}).^2);
end

fprintf('Energy in wavelet domain = %.3f\n',WE);
fprintf('Energy in signal domain  = %.3f\n',SE);
% They are the same; this verify Parseval's property
Energy in wavelet domain = 299.596
Energy in signal domain  = 299.596

Display wavelet representation of the test signal

figure(2)
clf
PlotSubbands(x,w,p,q,s,1,J+1,1)
axis off
title('RATIONAL-DILATION WAVELET TRANSFORM OF A SIGNAL')
orient landscape
print('-dpdf','figures/demo2');