Digital Signal Processing Reference
In-Depth Information
100
0
-100
0
0.02
0.04
0.06
0.08
0.1
0.12
100
0
-100
0
0.02
0.04
0.06
0.08
0.1
0.12
100
0
-100
0
0.02
0.04
0.06
0.08
0.1
0.12
100
0
-100
0
0.02
0.04
0.06
0.08
0.1
0.12
100
0
-100
0
0.02
0.04
0.06
0.08
0.1
0.12
Time (s ec . )
FIGURE 13.42
Reconstructed signal at various compression ratios.
sp ¼ x((i-1)*1024 þ 1:i*1024);
w ¼ dwt(h0,sp,10);
% Quantization
wmax
¼
round(max(abs(w)));
wcode
¼
round(2^15*w/wmax); % 16-bit code for storage
w
wcode*wmax/2^15; % Recovered wavelet coefficients
w(513:1024)
¼
¼
zeros(1,512); % 2:1 compression ratio
sig_rec2t1
¼
idwt(h0,w,10);
];
w(257:1024) ¼ 0; % 4:1 compression ratio
sig_rec4t1 ¼ idwt(h0,w,10);
rec_sig4t1 ¼ [rec_sig4t1 sig_rec4t1 ' ];
w(129:1024) ¼ 0; % 8:1 compression ratio
sig_rec8t1 ¼ idwt(h0,w,10);
rec_sig8t1 ¼ [rec_sig8t1 sig_rec8t1 ' ];
w(65:1024) ¼ 0; % 16:1 compression ratio
sig_rec16t1 ¼ idwt(h0,w,10);
rec_sig16t1 ¼ [rec_sig16t1 sig_rec16t1 ' ];
end
subplot(5,1,1),plot(t,x, ' k ' ); axis([0 0.12 -120 120]);ylabel( ' x(n) ' );
subplot(5,1,2),plot(t,rec_sig2t1, ' k ' ); axis([0 0.12 -120 120]);ylabel( ' 2:1 ' );
subplot(5,1,3),plot(t,rec_sig4t1, ' k ' ); axis([0 0.12 -120 120]);ylabel(4:1);
rec_sig2t1
¼
[rec_sig2t1 sig_rec2t1
'
 
Search WWH ::




Custom Search