International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org, editorijaiem@gmail.com Volume 2, Issue 9, September 2013 ISSN 2319 - 4847 A GUI Based Iteration Approach for Easy and Reliable Speech Codec Detection and Decoding Parthraj Tripathi 1, Dr.K.Padma Raju 2 , ManikantaSwamyJoka 3 1 Scientist, Defence Electronics Research Laboratory, DRDO, Govt. of India 2 Principal, University College of Engineering, JNTUK, Kakinada, India 3 Electronics and communication Department, University College of Engineering, JNTUK, Kakinada, India Abstract In digital communication sub-systems which are required for classification of bit stream of unknown voice codecs, it has to first detect the type of (codec) bitstream correctly. Moreover, possibilities are there of loss or corruption of bits due to channel impairments. We have considered the bit stream originated from any of the codecs out of given ensemble, i.e. type of bitstream is unclassified, but sure to have originated from some codec out of given ensemble. A GUI based decision sub-system is presented here for detection of codec type. The minimum number of bits required for detection of codec type depends on codec itself. GUI based iterations were performed to set this threshold easily. Also, the overall threshold (minimum number of bits required for detection of a codec bitstream out of given ensemble) setting was possible, thanks to GUI iterations. For decoding to be done correctly, overall synchronization is essential. GUI based bit iterations were once again useful to get the correct bit order. Considered here are the cases of classification of log-PCM and Adaptive Differential PCM (40-, 32-, 24-, 16 kbps). The GUI is realized using MFC framework. Keywords: GUI, PCM, ADPCM, Bit iteration, Signal Analysis, Universal Receiver design. 1. INTRODUCTION Digital technology plays key role in communication field because of its advantages such as high S/N ratio, less sensitivity to changes in environmental conditions, easy signaling, high data transfer rates and easy multiplexing which lead to reliable communication [13]. Notably, in multiplexing of signals of same kind or/and different, such as realized in voice and data integration (as in T1-E1 systems) [10], [17]. In voice-data integrated receiver sub-systems, onus is on demultiplexer for correctly identifying the signal type (voice/data) in least time. Further, digital techniques along with properties of the above mentioned signals are explored to realize it faster and to do sub-classification of the signal. Popular voice encoding techniques includes log-PCM, ADPCM and Linear Prediction [8], [1], [2]. These techniques are used for variety of reasons namely to achieve less codec rates, high multiplexing efficiency, less complex receiver design, low delay, protection against channel errors, etc. The digital data is usually in the form of a stream of binary bits, i.e., a sequence of 0s and 1s. Regardless of whether data is inherently digital or the result of analog-to-digital conversion of an analog source, the goal is to reliably transmit bitstream to the destination by using the given communication channel. Depending on the nature of the communication channel, bitstream can suffer from one or more channel impairments including noise, attenuation, distortion, fading, and interference [14]. Due to these impairments, the transmitted bitstream may get corrupt or loss in some bits or packets [16]. At the receiver an algorithm is required not only to determine the encoding type, but also to be capable of decoding even in case of bit losses. In this paper, an algorithm is presented which caters the solution with the aid of Graphical User Interface. A simulator program which is an ensemble of ITU-T standard voice encoders is also written for verification of the title [5], [1]. Here, a Graphical User Interface (GUI) is designed and developed to handle loading of just sufficient number of (minimum) bits for reliable codec detection and sufficiently large number of bits (maximum) in order to hear decoded signals. The minimum bits required for threshold setting for detection sub-system is dependent on two parameters namely codec type and the value of maximum of such values in a given ensemble, which may vary ensemble to ensemble shown in the Figure 1, i.e. the maximum of the minimum bits required is the threshold in order to cater for all the codecs in a given ensemble. Thus threshold is subjected to be set after sufficient experimentations. In this paper the threshold of 20k bits was set after so many experimentations which we could easily control through GUI [3]. Here GUI provides immediate and visual feedback about effect of each iteration. GUI approach here is justified as the threshold values vary ensemble to ensemble. In addition, GUIs allow users to take full advantage of the multitasking. Contribution in this paper can be summarized as follows: GUI development for detection of type of received bitstream. Storage, pre-processing and conditioning of received bitstream. Volume 2, Issue 9, September 2013 Page 303 International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org, editorijaiem@gmail.com Volume 2, Issue 9, September 2013 ISSN 2319 - 4847 Bit iteration algorithm and decoding based on it. Comparison of results. 2. DETECTION AND BIT ITERATION BASED DECODING USING GUI: The input to the GUI is a bitstream or samples, received after removing non payload bits like header, footer, CRC, etc [4]. The outer structure of GUI as shown in Figure 2. In this GUI several controls (Buttons and Textboxes) are used for displaying various results [15]. Figure 1: Classification Confidence (%) Vs Bits Figure 2: Bit iteration using GUI Explanation of controls in a GUI: In GUI, UPLOAD Button is used to select from specific memory location in the storage computer through a pop-up window. The input data file may be in text or in any other file extension. This data file is in general extracted/captured from various sections of a communication system say, de-multiplexer and the content is stored in a hard disk, channel wise. The "File Path Textbox" shows the path of the selected file. Received Signal Textbox shows the received bitstream or byte steams. The content in this textbox is editable so as to mimic the bit change and bit loss due to channel impairments. COUNT is used to count and ensure minimum number of bits for analysis. Here the number of bits required for analysis is 20k bits. Misclassification may happen on violation of this condition. BIN is used to convert samples to bitstream in case the signal in byte form. The analysis program which runs at background of GUI is designed to operate on binary values. SAVE Button is used to save the contents in the memory location to which analysis algorithms will be subjected to. Click on ANALYSIS displays encoding type identified, based on sliding window method amalgamated with values of Autocorrelation (ACS), Central Second Order Moment (CSOM), Fourier Transform (FT) and Binary Ratio (BR) obtained [6], [7], [9]. The values obtained of the parameters mentioned are compared with values mention in the Table 1. The possible values of the parameters mention in the table and, are required for classification, resulted from number of experiments. In case of non-concurrence of values of above parameters, bitstream may not be classified for any codec in the ensemble. For advance analysis all the above values may also made to be shown. To arrive at a decision for a given classification the values of all the parameters should be in concurrence with the Table 1. PCM µ-law PCM A-law ADPCM 16kbps ADPCM 24kbps ADPCM 32kbps ADPCM 40kbps Table 1: Decision making table ACS CSOM 19500-26100 0.14-0.25 24500-35500 0.21-0.35 22800-24500 0.48-0.56 32900-38000 0.14-0.19 26900-31500 0.23-0.29 26400-32900 0.27-0.33 FT 8 7 8 8 8 8 BR 0.47-0.82 0.76-1.12 1.00-1.09 0.45-0.57 0.60-0.76 0.58-0.80 Here, GUI based iteration played crucial role for setting the threshold (minimum number of bits required) for a codec bitstream to be classified. Also, we were able to set overall threshold for a given ensemble which is in this particular problem is 20000 bits. DECODE & PLAY is to decode signal made of bitstream. To get the audio, input stream first converted to samples and then given to corresponding decoder as indicated by analysis. Important to say, care must be taken to build a sample correctly i.e. the start bit should be known. Audio is observed sometimes after multiple bit iterations. This was made easy using GUI based bit iteration. However, large data is required to get sufficient duration of audio. The advantage doing analysis first is have less loading of GUI for smooth functioning as analysis requires very less data as compared to decoding. The ensemble consists of G.711/ G.726, ITU-T recommendation. 3. BIT ITERATION: Volume 2, Issue 9, September 2013 Page 304 International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org, editorijaiem@gmail.com Volume 2, Issue 9, September 2013 ISSN 2319 - 4847 Even if the received bits are lost or corrupted, the GUI identifies the encoding technique reliably. But the decoder will not be able to decode correctly in absence of synchronization. In order to get the audio, it is needed to find the start bit of the sample. This can be achieved by the Bit iteration technique, mentioned above and as define as: Where, i=1, 9, 17, 25…….and, n=iteration bits for PCM: 0, 1, 2, 3, 4, 5, 6, 7 ADPCM 16kbps: 0, 1 ADPCM 24kbps: 0, 1, 2 ADPCM 32kbps: 0, 1, 2, 3 ADPCM 40kbps: 0, 1, 2, 3, 4 4. RESULTS: This GUI is tested for functionality with reliability using extensive experimentation. In Figure 3, compared are; original speech and truthfully decoded (ADPCM 32Kbps, in this case) stream with correct synchronization i.e. correct bit iteration [11]. Figure 4, shows that the input speech and output speech almost similar. Figure 3: zoomed version of input and output voice with correct bit iteration. Figure 5: zoomed version input and output voice without synchronization. Figure 4: GUI showing bit iteration of 2 Figure 6: zoomed version input and output voice with synchronization. In Figure 4, the same input file with first 2 bits removed from the file, still it gets identified as ADPCM 32kpbs stream. But, no sensible audio is observed with the bit iteration set as 0, 1, 3, but not 2. Input speech and output speech are distinct as shown in Figure 5. When the bit iteration is set as 2 then sensible audio is observed. Input and output speeches are very similar as shown Figure 6. In this way we can extract the audio even in cases of singular/multiple bit losses at starting or from anywhere in the space of bitstream. Volume 2, Issue 9, September 2013 Page 305 International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org, editorijaiem@gmail.com Volume 2, Issue 9, September 2013 ISSN 2319 - 4847 5. CONCLUSION AND FUTURE SCOPE: In this paper, the ensemble consists of total of six codecs namely log-PCM (A/µ-law), ADPCM -40/32/24/16kbps and the algorithm with the help of iterations performed on GUI controls is validated. The type of encoding technique is correctly identified and decoded. As an extension to this work different ensembles are which may comprise of various codecs and numbers. Further, a robust decision sub-system may be realized for selection of the parameters which ultimately classifies the codec bitstream type. Signals other than of voice codecs, i.e. image, video and telecom may also be validated. REFERNCES: [1] CCITT. Recommendation “G.726 5-, 4-, 3- And 2-BitsSample Embedded Adaptive Differential Pulse Code Modulation (ADPCM)”. [2] “64kbit /s Audio Signal Transmission Approaches Using 32 kbit/s ADPCM Channel Banks.” by MasahiroIwadare, TakyoNishitani. [3] “A graphical environment for user-interface design and development” by John DeSoi, Mark Lease, William Lively, Sallie Sheppard and Tom Slade. [4] “Formal Specification and Verification of Graphical User Interfaces”, by Gene L. Fisher, Deborah A. Frincke. [5] “Backward Adaptive Reencoding: A Technique for Reducing the Bit Rate of µ-Law PCM Transmissions”. by JeanPierre A. Aboul. [6] A thesis on “ A Novel Techinque for Classification of Digital Voice Speech”, by ParthrajTripathi, Dr.K.PadmaRaju, N. Satish Kumar [7] A thesis on “Speech/Data discrimination in communication system”, by ParthrajTripathi, Dr.K.PadmaRaju, Ashok Kumar Ginni. [8] ITU-T Recommendation “G. 711 Pulse Code Modulation (PCM) of Voice Frequencies”. [9] “Signal Classification in Digital Telephone Networks”, by J. S. Sewall and B. E Cockbum. [10] “A Decomposition Approximation for the Analysis of Voice/Data Integration”, by Sayeed Ghani and Mischa Schwartz. [11] “Efficient Implementation of ADPCM Codec”, by Anil Sharma, C.P. Ravikumar. [12] “Laws and theory of unified communication”, by VashatkarYadav, Controller: Communication Control Chamber. [13] A text book of “Communication Systems Engineering”, by J Proakis and M. Salehi,.Prentice-Hall, 2nd edition, 2002. [14] A text book of “Communication Systems”, by S. Haykin,.John Wiley & Sons, 3rd edition, 1994. [15] A text book of “MFC Internals (Inside the Microsoft Fundamental Class Architecture, by Shepherd Wingo. [16] “A Failure Detection Method for Integrated Voice/Data Packet Networks”, by SeyhanCivanlar. [17] “Voice Communication in Integrated Digital Voice and Data Networks”, by TheodoreBailly,Alan J. McLauglin, Clifford J. Weinsein. [18] www.google.co.in, en.wikipedia.org. AUTHOR Parthraj Tripathi has obtained BE in Electronics and Communication Engineering from RGPV Bhopal, MP, India in the year 2003. He joined Hindustan Aeronautics Ltd and had 4 years extensive experience in not only in Avionics but also in various Aircraft-systems. In 2008, he joined DLRL, DRDO and working in EW related research. His area of interests are EW, strategic communication, intuitive Analysis, Signal processing. He is a budding defence analyst and has published number of articles related to defence systems around world. Dr K Padma Raju obtained B.Tech in Electronics and Communication Engineering, Nagarjuna University in the year 1989, M.Tech in Electronic Instrumentation, National Institute of Technology Warangal in the year 1992. He received the Doctoral degree from Andhra University in the area of Microwave Antennas in the year 2003. Currently he is the principal and senior professor in Electronics and Communication Engineering in J.N.T. University, Kakinada, A.P, India. Manikanta Swamy Joka received B.Tech degree in Electronics and Communication Engineering from Pragati Engineering College, JNTUK University, A.P. India in the year 2008. Currently pursuing his master’s degree program in computers and communication engineering in J.N.T. University Kakinada, A.P, India. Volume 2, Issue 9, September 2013 Page 306