Audio Compression Method Based on Slantlet Transform

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "Audio Compression Method Based on Slantlet Transform"

Transcription

1 Al- Mustansryah J. Sc. Vol. 24, No 5, 2013 Audo Compresson Method Based on Slantlet Transform Dha Alzubayd and Znah Sadeq Abdul Jabbar Unversty of Al-Mustansryah, College of Scence, Computer Scence Department, Baghdad-Iraq Receved 16/3/2013 Accepted 15/9/2013 الخالصه ان التقدم السريع في مجال االنترنيت وتكنلوجيا الوسائط المتعدده ادى الى زيادة البيانات والن الصوت احد اهم الوسائط المنتقله لذا هناك حاجه ضروريه الستخدام عمليات الضغط لزيادة كفاءة االنتقال.ان التقنيه المقترحه " طريقة ضغط البيانات السمعيه باستخدام تحويل المويل" يهدف الى تطوير عملية الضغط القابله للضياع لبيانات ملفات الصوت من نوع Fles) (Stereo Wave وتعتمد على التشابه الكبير مابين قناتي ملف الصوت باستخدام تحويل المويل لغرض التحويل وباستخدام التشفير الحسابي في مرحلة التشفير. تبعا للنتائج التجريبيه تراوحت نسبة الضغط مابين )21 12( وتراوحت ذروة نسبة االشاره الى الضوضاء ما بين) دسبل(. لقد تم تحسين )21 22( من زمن الترميز والزمن المستغرق في عملية فتح الترميز باستخدام الترميز الحسابي من نوع (Adaptve). ABSTRACT The development of nternet and multmeda technologes that grow rapdly, resultng n amount of nformaton managed by computer s necessary. Audo s the most mportant medum be transmtted and for successfully transmsson, there s a need for compresson. A proposed Audo compresson method based on Slantlet transform s a lossy audo compresson. It explots the hgh smlarty between the channels of stereo audo Wave fle, usng Slantlet transform for transformaton and Arthmetc codng n codng step. The expermental results show that compresson rato ranges (12-24) and PSNR results ranges (51-58 db), encodng and decodng tme mproved (12-14) tmes by usng programmed Adaptve Arthmetc codng. 1. INTRODUCTION Data compresson s one of the most mportant felds and tools n modern computng; t provdes a comprehensve reference for the many dfferent types and methods of compresson [1]. Compresson s the process of re-encodng dgtal data to reduce fle sze; a specalzed program called a codec, for COmpressor/DECompressor, changes the orgnal fle to the smaller verson and then decompresses t to agan present the data n a usable form [2]. Audo s used n multmeda, and especally when t s delvered over the nternet, there s a need for compresson [3]. Audo compresson s the technology of convertng human speech nto an effcently encode representaton that can later be decoded to produce a close approxmaton of the orgnal sgnal [4]. To manpulate wth audo, frst t must be convert to a dgtal format, the samples can be processed, transmtted, and converted back to analog format. Any compresson technque belongs to ether lossy compresson or lossless compresson; the goal of lossless compresson s to encode the data n a way such that the matchng decoder s able to reconstruct an exact copy of the orgnal sgnals that are nput to the encoder [5].Lossless 415

2 Audo Compresson Method Based on Slantlet Transform Dha and Znah compresson s used when t s mportant that the orgnal and the decompressed data be dentcal, for example, t s used n popular ZIP fle format, other examples are executable programs and source code. Lossy compresson technque nvolve some loss of nformaton, and data that have been compressed usng lossy technques generally cannot be reconstructed exactly [6]. In dgtal audo codng, a lossy codec s also called a perceptual codec because the desgn prncple of a lossy audo codec s to remove the perceptually rrelevant or unmportant nformaton as much as possble [5]. Codng was done by usng arthmetc codng. In statc arthmetc codng, the model may assgn a predetermned probablty to each symbol n the alphabet. Alternatvely, n adaptve models the probabltes are updated whenever a symbol s encoded. 2. Slantlet Transform The dscrete wavelet transform (DWT) s usually carred out by flter bank teraton, for a fxed number of zero moments; ths does not yeld a dscrete tme bass that s optmal wth respect to tme localzaton [7].Slantlet transform (SLT) s an orthogonal DWT, wth two zero moments and wth mproved tme localzaton. The bass s not based on flter bank teraton; nstead, dfferent flters are used for each scale [7]. In general the algorthm to obtan l -scales Slantlet flter banks s as follows: The L scale flter bank has 2l channels. The low pass flter s to be called h l (n). The adjacent to the low pass flter s to be called f l (n). Both h l (n) and f l (n) are to be followed by down samplng 2l. The remanng 2l -2 channels are fltered by g (n) and ts shfted tme-reverse g ((2+1-1)-n) for =1, l -1, each s to be followed by down samplng 2+1 [7]. In the Slantlet flter bank, each flter g (n) appears together wth ts tme reverse. Whle h (n) does not appear wth ts tme reverse, t always appears pared wth the flter f (n). Fg (1) llustrates a threescale Slantlet flter bank. 416

3 Al- Mustansryah J. Sc. Vol. 24, No 5, 2013 H3(z) 8 F3(z) 8 G2(z) 8 z -7 G2(1/z) 8 G1(z) 4 z -3 G1(1/z) 4 Fgure -1: Three-scale Slantlet flter bank [7] The transfer functons g (n), h(n) and f(n) for l-scale Slantlet are calculated usng the followng expressons and the parameters [7][8]: a0,0 a0,1n, for n 0, g ( n) (1) 1 a ( 2 ), 2,...,2 1 1,0 a1,1 n for n Where m=2 s 1 = 6 m/((m 2 1)(4m 2 1)) s 0 = s 1. (m 1)/2 t 1 = 2 3/(m. (m 2 1)) t 0 = ((m + 1). s 1 3 mt 1 )(m 1) (2m) a 0,0 = (s 0 + t 0 ) 2 a 0,1 = (s 1 + t 1 ) 2 a 1,0 = (s 0 t 0 ) 2 a 1,1 = (s 1 t 1 ) 2 Note that the parameters a 0,0,a 0,1,a 1,0 and a 1,1 depend on,the same approach works for f (n) and h (n). Usng, agan, a pecewse lnear form f(n) and h(n) can be wrtten n terms of eght unknown parameters b 0,0,b 0,1,b 1,0 b 1,1, c 0,0,c 0,1,c 1,0 and c 1,1 b 0,0 b0,1n, for n 0, h ( n) (2) 1 b1,0 b1,1 ( n 2 ), for n 2,...,

4 Audo Compresson Method Based on Slantlet Transform Dha and Znah c 0,0 c0,1n, for n 0, f ( n) 1 c1,0 c1,1 ( n 2 ), for n 2,...,2 1 Where m=2 u = 1 m v = (2m 2 + 1) 3 q = 3 (m(m 2 1)) m b 0,0 = u. (v + 1) (2m) b 1,0 = u b 0,0 b 0,1 = u m b 1,1 = b 0,1 c 0,1 = q. (v m) c 1,1 = q. (v + m) c 1,0 = c 1,1. (v + 1 2m) 2 c 0,0 = c 0,1. (v + 1) 2 (3) 3. Proposed System A demonstraton for suggest system "audo compresson usng Slantlet transform" used for compresson stereo audo fle wll be presented usng the followng steps: 1. Loadng audo fle n buffer. 2. Splt left from rght channel. 3. (Blockng) Each channel s dvded nto small blocks and paddng wth zero f requred. 4. (Transformaton) Each block s transformed separately usng Slantlet transform to transform t from tme doman nto frequency doman. 5. (Flterng) Fnd adaptve threshold for flterng coeffcents and to solate the mportant from less mportant coeffcents, and save only the mportant coeffcents wth ther locatons. In ths step for each channel we have two arrays, one for coeffcents and the other for locaton. 6. (Choose only one channel) Graphcal representaton of audo raw data, left channel and rght channel are shown n fgures (2), (3.a) and (3.b) respectvely. Due to the hgh smlarty of the two channels, whch s the property of all stereo audo wave fle, can be exploted by choosng only one channel for processng and duplcated ths channel n decodng unt. The choosng process s done by fndng the channel wth hgher energy, the compresson rato wll be ncreased by ths step as well as the encodng and decodng tmes wll be decreased. Ths step does not affect the qualty of reconstructed fle. 7. (Quantzaton and Dfferencng) 418

5 Al- Mustansryah J. Sc. Vol. 24, No 5, 2013 Slantlet transform coeffcents Quantzed to approprate step, ths process sharply ncreases the compresson rato. Dfferencng process wll be performed to locaton array; ths step wll decrease the number of symbols before the codng step and thus ncrease the compresson rato. 8. (Codng) Codng was done usng arthmetc codng; two arrays wll be nput nto arthmetc codng and storng the output n the compresson fle. The steps for mplementaton encodng algorthm are shown n fgure (4). Decodng unt s an nverse steps of encodng unt. Fgure-2:Graphcal Representaton of Stereo Audo Wave Fle Fgure-3:a) Left Channel b) Rght Channel 419

6 Audo Compresson Method Based on Slantlet Transform Dha and Znah Load Wave fle Channel spltter Left channel Rght channel Blockng Blockng B1 Bn B1 Bn Slantlet transform Slantlet transform SLT coeffcents Flterng Flterng SLT coeffcents Loc(L) Coeff(L) Coeff(R) Loc(R) Choose Channel Loc(ch) Coeff(ch) Dfferencng Quantzaton Dff(Loc) Quan(ch) Arthmetc encodng En(Loc) En(ch) Buffer arthmetc codng structure Compressed fle Fgure-4: Block Dagram of Encodng Unt 420

7 Al- Mustansryah J. Sc. Vol. 24, No 5, RESULTS AND DISCUSSIONS To test the performance of our proposed coder, a test set ncludng fve fles wth dfferent sze (stereo and 16 bt per sample) wth dfferent samplng rate. For evaluaton the objectve qualty measures (such as the Mean Square Error (MSE) and the Peak Sgnal to Nose Rato (PSNR) were utlzed. Several parameters were taken to study the performance of the suggested audo compresson system, these parameters are: Block sze and quantzaton step. The adopted parameters are the compresson rato (CR), encodng tme (ET), decodng tme (DT) and fdelty crtera (MSE and PSNR).Table (1) descrbes the data fles used. Table-1: Data Fle Descrpton Fle name Duraton (Sec) Samplng rate(fs) Thr(L) Thr(R) Fle(1) Fle(2) Fle(3) Fle(4) Fle(5) Where (FS) denotng the number of samples per second and Thr(L), Thr(R) are the adaptve thresholds for left and rght channel respectvely. Each channel n audo fle s further dvded nto a number of blocks wth approprate sze (2 n ); the length of channel s made to accommodate a number of blocks, by paddng t wth zero f requred. Table (2) presents the effect of dfferent block sze. Table-2: Use of Dfferent Block Sze Block Sze=512 Fle name CR MSE PSNR db ET (Sec) DT (Sec) Fle(1) Fle(2) Fle(3) Fle(4) Fle(5) Block Sze=1024 Fle(1) Fle(2) Fle(3) Fle(4) Fle(5) Two types of quantzaton: unform quantzaton and non-unform quantzaton, n a proposed system unform quantzaton wll be used. The coeffcents are unformly quantzes usng the general equaton: Slantlet Quantzed output =Round ( ) QS 421

8 Audo Compresson Method Based on Slantlet Transform Dha and Znah Where QS s step sze parameter and can be adjusted to gve the requred results. Table-3: Use of Dfferent Quantzaton Step Quantzaton Step=300 Fle name CR MSE PSNR db ET(Sec) DT(Sec) Fle(1) Fle(2) Fle(3) Fle(4) Fle(5) Quantzaton Step=400 Fle(1) Fle(2) Fle(3) Fle(4) Fle(5) Quantzaton Step=500 Fle(1) Fle(2) Fle(3) Fle(4) Fle(5) Tables (4), (5) and (6) present the effects of dfferent types of Arthmetc codng on encodng and decodng tme. Table -4:Programmed Adaptve Arthmetc codng Fle Name CR MSE PSNR db ET (Sec) DT (sec) Fle(1) Fle(2) Fle(3) Fle(4) Fle(5) Table-5: Programmed Statc Arthmetc codng Fle Name CR MSE PSNR db ET (Sec) DT(Sec) Fle(1) Fle(2) Fle(3) Fle(4) Fle(5) Table-6:MATLAB Arthmetc codng Fle Name CR MSE PSNR db ET (Sec) DT (Sec) Fle(1) Fle(2) Fle(3) Fle(4) Fle(5)

9 Al- Mustansryah J. Sc. Vol. 24, No 5, CONCLUSIONS From the above results whch were done on some selected samples, a number of concluson remarks were drawn: 1. Compresson rato s proportonal wth Block Sze and Quantzaton Step as shown n fgures (5) and (6) respectvely. Fgure-5:The Effect of Block Sze on CR Fgure-6:The Effect of QS on CR PSNR s nversely proportonal wth Block Sze and Quantzaton Step as shown n fgures (7) and (8) respectvely. Fgure-7:The Effect of Block Sze on PSNR Fgure-8:The Effect of QS on PSNR 2. MSE s proportonal wth Block sze and Quantzaton Step as shown n fgures (9) and (10) respectvely. 423

10 Audo Compresson Method Based on Slantlet Transform Dha and Znah Fgure-9:The Effect of Block Sze on MSE Fgure-10:The Effect of QS on MSE 3. Encodng and decodng tme affected by the type of Arthmetc codng, best results n encodng and decodng tme when usng a programmed Adaptve arthmetc codng, where n adaptve models the probabltes are updated whenever a symbol s encoded. Programmed Statc Arthmetc codng, the model may assgn a predetermned probablty to each symbol n the alphabet, present result better than MATLAB Arthmetc codng. REFERENCES 1. D.Salomon,"Data Compresson the Complete Referance", Sprnger- Verlag London Lmted, T.M.SAVAGE, K.E.VOGEL, "An Introducton To Dgtal Multmeda", by Jones and Bartlett Publshers, LLc, Ngel Chapman and Jenny Chapman, "Dgtal Multmeda", John Wley & Sons Ltd, England, D.Naveen, "Implementaton of Psychoacoustc model n Audo Compresson usng Munch and Gammachrp Wavelets", Internatonal Journal of Engneerng Scence and Technology, Vol.2 (5), Da Tracy Yang, Chrs Kyrakaks, and C.-C. Jay Kuo, "Hgh Fdelty Multchannel Audo codng",hndaw Publshng Corporaton, Khald Sayood, "Introducton to Data Compresson", Elsever Inc, Selesnck I. W., "The Slantlet Transform", IEEE Transactons on Sgnal Processng, Vol. 47, No. 5, pp , May Hkmat N. Abdullah, Safa'a A. Al, "Implementaton of 8-Pont Slantlet Transform Based Polynomal Cancellaton Codng-OFDM System Usng FPGA", IEEE System Sgnals and Devces (SSD), 7th Internatonal Mult-Conference on Systems, June