Digital Signal Processing Reference
In-Depth Information
The results are returned in a one-dimensional, third-octave approximation A, and
three detail signals D (D(1,:), D(2,:), and D(3,:)). The variable input recon will
be a one-dimensional reconstruction of the original signal x. It should be an exact
copy of x, which we verify in the nal statement. Aside from some precision error,
the dierence between the two signals is zero. The actual output follows.
error =
4.3289e-09
The random signal used above works well to test out the code, but we will run
it again with a real signal for x. As the code below shows, we make x a sum of
sinusoids, then apply the \DWT undo" function. When we do, we see that we get
the results as shown in Figures 10.2 and 10.3.
t = 0:0.001:0.1;
x = cos(2*pi*100*t) + 1.5*cos(2*pi*110*t + pi/6);
[A, D] = DWT_undo(x, db4, 3);
Figure 10.2 plots the original signal in the top, and the \undone" third-level ap-
proximation in the bottom. We see that the signals are the same size, which comes
from the \DWT undo" function. The approximation signal is not the compact,
one-eighth size approximation, but instead the contribution from the approxima-
tion channel, ready to be added to the detail contributions sample by sample to
reconstruct the original. Keep in mind that we are not after compactness here, but
we want to see how the original signal breaks down into subsignals. Looking at the
three \undone" detail signals in Figure 10.3, we may notice the scale of the details
grows according to the octave. The rst octave's detail signal contains many small
variations, while the second octave's detail signal has larger variations but fewer of
them. The second octave's details would be half the number of the rst octave's,
resulting in fewer variations. The larger magnitudes show that the approximation
at octave 1 becomes the detail at octave 2. In other words, our idea of \detail"
varies (gets larger) with each succeeding octave.
As the details get larger in magnitude from octave 1 to octave 2, so they do
between octaves 2 and 3. The details at octave 3 contain an interesting feature; we
see the magnitudes get smaller around sample 40 and larger afterwards, just like in
the original signal. In fact, examining the third-octave approximation (bottom plot
of Figure 10.2) reveals that before sample 85, the approximation could very easily
be 0. The three detail signals actually contain the salient signal information, at
least before the last few samples.
Search WWH ::




Custom Search