Digital Signal Processing Reference
In-Depth Information
subplot(5,1,5),plot(t,rec_sig16t1, ' k ' ); axis([0 0.12 -120 120]);ylabel( ' 16:1 ' );
xlabel( ' Time (sec.) ' )
NN ¼ min(length(x),length(rec_sig2t1)); axis([0 0.12 -120 120]);
err ¼ rec_sig2t1(1:NN)-x(1:NN);
SNR ¼ sum(x.*x)/sum(err.*err);
disp( ' PR reconstruction SNR dB ¼ > ' );
SNR ¼ 10*log10(SNR)
Figure 13.43 shows the wavelet compression for 16-bit speech data sampled at 8 kHz. The original
speech data is divided into speech segments, each with 1,024 samples. After applying the DWT to each
segment, the coefficients, which correspond to high frequency components indexed from 513 to 1,024,
are discarded in order to achieve coding efficiency. The reconstructed speech data has a compression
ratio 2:1 with SNR ¼ 22 dB. The MATLAB program is given in Program 13.3.
Program 13.3. Wavelet data compression for speech segments.
close all; clear all;clc
load orig.dat ; % Load speech data
h0
¼
[0.230377813308896 0.714846570552915 0.630880767929859
.
-0.027983769416859 -0.187034811719092 0.030841381835561
.
.
0.032883011666885 -0.010597401785069];
N
length(orig);
nofseg
¼
¼
ceil(N/1024);
speech
¼
zeros(1,nofseg*1024);
2 x 10 4
1
0
-1
-2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
x 10 4
2 x 10 4
1
0
-1
-2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
x 10 4
Sample number
FIGURE13.43
 
Search WWH ::




Custom Search