Digital Signal Processing Reference
In-Depth Information
1024
c
Level-0
10
512
512
c
d
Level-1
9
256
256
512
c
d
d
Level-2
8
9
128
256
512
c
d
d
d
d
Level-10
0
7
8
9
FIGURE 13.41
DWT coefficient layout.
EXAMPLE 13.10
Consider a 40-Hz sinusoidal signal plus random noise sampled at 8,000 Hz with 1,024 samples:
xðnÞ¼100 cos ð2p 40nTÞþ10 randn
where T ¼ 1=8;000 seconds and randn is a random noise generator with a unit power and Gaussian distribution.
Use a 16-bit code for each wavelet coefficient and write a MATLAB program to perform data compression for each
of the following ratios: 2:1, 4:1, 8:1, and 16:1. Plot the reconstructed waveforms.
Solution:
We use the 8-tap Daubechies filter as listed in Table 13.2 . We achieve the data compression by dropping the high
subband coefficients for each level consecutively and coding each wavelet coefficient in the lower subband using
16 bits. For example, we achieve the 2:1 compression ratio by omitting 512 high frequency coefficients at the first
level, 4:1 by omitting 512 high frequency coefficients at the first level, and 256 high frequency coefficients at the
second level, and so on. The recovered signals are plotted in Figure 13.42 . SNR ¼ 21 dB is achieved for the 2:1
compression ratio. As we can see, when more and more higher frequency coefficients are dropped, the recon-
structed signal contains less and less details. The recovered signal with 16:1 compression presents the least
details but shows the smoothest signal. On the other hand, omitting the high frequency wavelet coefficients can be
very useful for a signal denoising application, in which the high frequency noise contaminating the clean signal is
removed. A complete MATLAB program is given in Program 13.2.
Program 13.2. Wavelet data compression.
close all; clear all;clc
t ¼ 0:1:1023;t ¼ t/8000;
x ¼ 100*cos(40*2*pi*t) þ 10*randn(1,1024);
h0 ¼ [0.230377813308896 0.714846570552915 0.630880767929859 .
-0.027983769416859 -0.187034811719092 0.030841381835561 . .
0.032883011666885 -0.010597401785069];
N ¼ 1024; nofseg ¼ 1
rec_sig ¼ []; rec_sig2t1 ¼ []; rec_sig4t1 ¼ []; rec_sig8t1 ¼ []; rec_sig16t1 ¼ [];
for i ¼ 1:nofseg
 
Search WWH ::




Custom Search