New Algorithm for Speech Compression Based on Discrete Hartley Transform
Total Page:16
File Type:pdf, Size:1020Kb
156 The International Arab Journal of Information Technology, Vol. 16, No. 1, January 2019 New Algorithm for Speech Compression Based on Discrete Hartley Transform Noureddine Aloui1, Souha Bousselmi2, and Adnane Cherif 2 1Centre for Research on Microelectronics and Nanotechnology, Sousse Technology Park, Tunisia 2Innov’Com Laboratory, Sciences Faculty of Tunis, University of Tunis El-Manar, Tunisia Abstract: This paper presents an algorithm for speech signal compression based on the discrete Hartley transform. The developed algorithm presents the advantages to ensure low bit rate and to achieve high speech compression efficiency, while preserving the quality of the reconstructed signal. The numerical results included in this paper show that the developed algorithm is more effective than the discrete wavelet transform for speech signal compression. Keywords: Speech signal compression, discrete hartley transform, discrete wavelet transform. Received April 13, 2015; accepted May 2, 2016 1. Introduction transform, introduced by Hartley [9]. The Hartley transform resembles the Fourier transform, but it Speech signal compression is an important field of presents some advantages. digital signal processing. It has two main objectives; It allows transforming a real functions to another reduces storage and bandwidth requirements of digital real functions (it is not necessary to require complex speech signals before storage or transmission via numbers). The discrete Hartley transform is applied in communication channels. In fact, the speech many fields of signal processing such as audio and compression methods allow to represent speech data image [11, 14]. using the minimum number of bits possible, while The remaining of this paper is divided into three preserving the perceptual quality. Therefore, speech sections; section 2 covers the Hartley transform compression has many practical applications such as theory. Section 3, discusses the principal methodology mobile telephony, voice over IP and storage [7, 17]. of speech compression based on the discrete Hartley In the past few decades the discrete transformations transform. Then, the performance evaluation of the have emerged as a new tool for signal analysis, such as developed algorithm is carried out in section 4. compression [18, 19], denoising [1, 20], digital Finally, section 5 dedicated to the conclusion and filtering [4, 5] and recognition [12, 21]. In the field of some remarks. speech compression, the discrete transforms provide an important compression ratio and preserve the quality of 2. Signal Processing Based Using Discrete the decompressed speech signal compared to others existed techniques. In fact, the discrete cosine Hartley Transform transform introduced by Ahmed et al. [2], especially its This section describes the principle of signal modified version [6] has been used by the International processing using discrete Hartley transform. The first Organization for Standardization (ISO) and the and the second subsection present the Hartley International Electrotechnical Commission (CEI) transform theory. The third subsection gives the standard to compress speech signal MP3 format implementation methodology of the discrete Hartley (Moving Picture Experts Group: (MPEG1) layer 3). transform followed by an example of signal This later has become an industry standard for audio processing using discrete Hartley transform. compression. Thus, the discrete wavelet transform(introduced by Grossman and Morlet. [10] 2.1. Continuous Hartley Transform gives better compression performances compared to the Global System Mobile (GSM), the Linear The Continuous Hartley Transform (CHT) of a real waveform x(t) is defined as [9]: Predictive Coding (LPC) [16] and the Code Excited -1 + Linear Prediction (CELP) [15]. Due to the ψ ω = 2π 2 x(t) cos(ωt)+sin(ωt) dt (1) effectiveness of the discrete transforms for signal - compression, in this paper the Hartley transform is The Inverse Continuous Hartley Transform (ICHT) is particularly exploited to compress speech signals. This obtained using the following equation: transformation has been introduced by Bracewell [4]. It presents the discrete version of the continuous Hartley New Algorithm for Speech Compression Based on Discrete Hartley Transform 157 -1 2 + x t = 2π ψ(ω) cos(ωt)+sin(ωt) dω (2) Example: Let x(n) the original signal (MATLAB - sample data “leleccum.dat”) analyzed by frames of 64 samples and HN,N the square Hartley matrix of 2.2. Discrete Hartley Transform order 64. The DHT is the discrete version of the continuous After performing the forward and inverse DHT the Hartley transform. quality of the reconstructed signals is evaluated in Let {x(n), n=0,1,…,N-1} a real valued sequence, the term of Root Mean Square Error (RMSE) using the DHT is obtained by [4]: following Equation: N-1 1 N-1 ν k =N-1 x(n) cos(2πkn/N)+sin(2πkn/N) (3) RMSE= x(n)-y(n) (9) n=0 N n=0 The Inverse Discrete Hartley Transform (IDHT) is where y(n) is the reconstructed signal. obtained using the following Equation: The following Figure illustrates a typical plot of the N-1 original signal “leleccum.dat”, the transformed (Figure x(n)= ν(k) cos(2πkn/N)+sin(2πkn/N) (4) k=0 2-a) and the reconstructed (Figure 2-b) versions. The calculated RMSE between the original and the 2.3. Signal Processing using DHT reconstructed signals is equal to 5.09×10-15. Hence, it is clear that the DHT can allow analyzing signals with Using Equation (3) the DHT can be written in matrix near perfect reconstruction. form as follows: 1 ν(0) h0,0 h 0,1 ... h 0,N-1 x(0) 0.9 ν(1)1 h h ... h x(1) =*1,0 1,1 1,N-1 ... N ... ... ... ... ... (5) 0.8 ν(N-1) hN-1,0 ... ... h N-1,N-1 x(N-1) 0.7 1 0.6 HxNNN, * N 0.5 0.4 Where HN,N is square Hartley matrix of order N: 0.3 h =cos(2πkn N)+sin(2πkn N) 0.2 k,n (6) 0 500 1000 1500 2000 2500 3000 3500 4000 4500 a) Original signal “leleccum.dat”. where k and n are integers from 0 to N-1. 1.2 As the Hartley matrix is invertible, the IDHT can be 1 obtained by computing the inverse Hartley matrix: 0.8 -1 xN =H N,N ×ν N (7) 0.6 0.4 The achieved inversion error Er of Hartley matrix can be calculated as follows: 0.2 0 -1 Er = H N,N ×H N,N - I N,N (8) -0.2 0 500 1000 1500 2000 2500 3000 3500 4000 4500 b) Transformed signal “leleccum” using DHT. Where I N,N is a square identity matrix of order N. Figure 1 illustrates the inversion error of Hartley 1 matrix for different sizes. Here, the inverse matrix is 0.9 computed using the function “Inv” of MATLAB. As 0.8 observed, the inversion error of Hartley matrix for 0.7 different sizes is about 10-13. These values can be 0.6 reduced by using small matrix sizes. 0.5 0.4 -13 x 10 Inversion Error via Hartley Martix Size 0.3 2 1.8 0.2 0 500 1000 1500 2000 2500 3000 3500 4000 4500 1.6 c) Reconstructed signal “leleccum” using DHT. 1.4 1.2 Figure 2. Original transformed and reconstructed “leleccum.wav” 1 signal using DHT. 0.8 0.6 0.4 3. Speech Signal Compression using DHT 0.2 0 The basic idea behind speech signal compression 0 500 1000 1500 2000 2500 using DHT is linked to the representation of a signal Figure 1. Inversion error variation vs hartley matrix size. after applying the DHT. So, after performing the DHT 158 The International Arab Journal of Information Technology, Vol. 16, No. 1, January 2019 to the speech signal, the most of the obtained (insignificant data), while keeping a good quality of coefficients have a negligible or zero magnitudes. the reconstructed signal. For that, the speech compression is achieved by The Figure below illustrates the different steps truncating the small values of coefficients involved in speech signal compression using DHT. HN N: square Hartley matrix of order N h0,1 h0,2 … h0,N-1 h1,0 h1,1 … … … … … … hN-1,0 … … hN-1,N-1 x0 Compressed Original x1 Thresholding Encoding Quantization and speech speech signal … coefficients entropy encoding signal x(n) xN-1 H 1 : inverse square Hartley matrix of order NN, h 0,1 h0,2 … h0,N-1 h1,0 h1,1 … … … … … … hN-1,0 … … hN-1,N-1 x’0 xr0 Reconstructed Compressed speech Disquantization and Dencoding x’1 xr1 speech signal x (n) signal entropy decoding coefficients … … r x’N-1 xrN-1 Figure 3. The flowchart of the speech compression algorithm using DHT. Step 1: In this step, the Hartley matrix order (N) is Step 4: In this step, quantization followed by chosen and the DHT is performed on the original entropy coding are applied to the encoded vector of speech signal frames. Here, the Hartley matrix order coefficients. There are many methods to quantize must be equal to the frame length. coefficients such as vector, scalar and uniform 1 quantization. The entropy coding can be performed ν = H (n)*x (10) NN N,N N using Huffman or arithmetic methods. In this work, uniform quantization and entropy coding are applied N is integer from 0to N-1. to compress speech signal using DHT. Step 2: After performing the DHT, a manual thresholding is applied to the obtained coefficient 4. Results and Discussions vectors (vN). It consists in truncating coefficients below a fixed threshold (T) using the following This section evaluates the speech compression Equation: methodology based on DHT previously discussed. Two tests were performed to demonstrate the ν(n) if |ν(n)| T νnew (n)= 0 otherwise (11) effectiveness of the developed algorithm.