AUDIO CODER USING PERCEPTUAL LINEAR PREDICTIVE CODING Pratik R. Bhatt B.E., C.U. Shah College of Engineering and Technology

Total Page:16

File Type:pdf, Size:1020Kb

AUDIO CODER USING PERCEPTUAL LINEAR PREDICTIVE CODING Pratik R. Bhatt B.E., C.U. Shah College of Engineering and Technology AUDIO CODER USING PERCEPTUAL LINEAR PREDICTIVE CODING Pratik R. Bhatt B.E., C.U. Shah College of Engineering and Technology, India, 2006 PROJECT Submitted in partial satisfaction of the requirements for the degree of MASTER OF SCIENCE in ELECTRICAL AND ELECTRONIC ENGINEERING at CALIFORNIA STATE UNIVERSITY, SACRAMENTO FALL 2010 AUDIO CODER USING PERCEPTUAL LINEAR PREDICTIVE CODING A Project by Pratik R. Bhatt Approved by: __________________________________, Committee Chair Jing Pang, Ph.D. __________________________________, Second Reader Preetham Kumar, Ph.D. ____________________________ Date ii Student: Pratik R. Bhatt I certify that this student has met the requirements for format contained in the University format manual, and that this project is suitable for shelving in the Library and credit is to be awarded for the project. , Graduate Coordinator Preetham Kumar, Ph.D. Date Department of Electrical and Electronic Engineering iii Abstract of AUDIO CODER USING PERCEPTUAL LINEAR PREDICTIVE CODING by Pratik R. Bhatt Audio coder using perceptual linear predictive coding is a new technique for compressing and decompressing audio signal. This technique codes only the information of an audio signal, which is audible to the human ear, all other information is discarded during coding. Audio signal is given to a psychoacoustic model to generate information to control the linear prediction filter. At the encoder side, a signal is passed through a prediction filter, and then the filtered signal contains less information as it is coded according to perceptual criteria. At the decoder side, an encoded signal is decoded using a linear prediction filter, which is the inverse of the filter used at the encoder side. The decoded signal is similar to the original signal. Since information from the audio signal relative to the human hear is coded so the signal contains less data and has a high signal to noise ratio. iv This project is about designing and implementing the MATLAB code for an audio coder using perceptual linear predictive coding. The following tasks were performed in this project. (i) Process the audio signal according to a perceptual model. (ii) Encode and decode the signal using the linear predictor. (iii) Check simulation results for the original audio signal as well as the retrieved audio signal after signal processing. (iv) Listen to the wave file of the original as well as the reconstructed signal. , Committee Chair Jing Pang, Ph.D. ____________________________ Date v ACKNOWLEDGMENTS I would like to thank my project adviser, Dr. Jing Pang, for giving me an opportunity to implement the Audio coder based on perceptual linear predictive coding. I have learned many concepts of signal processing during the implementation of this project. Dr. Pang provided great support and guidance throughout the development of this project. She has been a great listener and problem solver throughout the implementation. Her valuable research experience has helped me to develop fundamental research skills. I would also like to thank Dr. Preetham Kumar for his valuable guidance and support in writing this project report. In addition, I would like to thank Dr. Suresh Vadhva, Chair of the Electrical and Electronic Engineering Department, for his support in completing the requirements for a Master’s degree at California State University, Sacramento. vi TABLE OF CONTENTS Page Acknowledgments ....................................................................................................................... vi List of Tables ............................................................................................................................... ix List of Figures ............................................................................................................................... x Chapter 1. INTRODUCTION .......................................................................................................... 1 1.1 Background ....................................................................................................... 1 1.2 Types of Audio Coding .................................................................................... 1 1.3 Concept ............................................................................................................. 3 1.4 Overview of Design .......................................................................................... 4 2. PSYCHOACOUSTIC MODEL .................................................................................... 6 2.1 Threshold of Hearing ........................................................................................ 6 2.2 Critical Bands.................................................................................................... 8 2.3 Simultaneous Masking .................................................................................... 11 2.3.1 Noise Masking Tone .............................................................................. 12 2.3.2 Tone Masking Noise .............................................................................. 13 2.4 Non-simultaneous Masking ............................................................................ 14 2.5 Calculate Overall Masking Threshold ............................................................ 15 3. LINEAR PREDICTIVE CODING .............................................................................. 18 3.1 Linear Prediction ............................................................................................. 18 vii 3.2 Linear FIR Predictor as Pre-filter ................................................................... 19 3.3 Linear IIR Predictor as Post-filter ................................................................... 21 3.4 Calculation of LPC Filter Coefficients ........................................................... 22 4. MATLAB IMPLEMENTATION ................................................................................ 27 5. SIMULATION RESULTS ........................................................................................... 31 6. CONCLUSION ............................................................................................................ 37 6.1 Future Improvements ...................................................................................... 37 Appendix ........................................................................................................................... 39 References ......................................................................................................................... 49 viii LIST OF TABLES Page 1. Table 1 List of critical bands ................................................................................... 11 ix LIST OF FIGURES Page 1. Figure 1 Audio coder using perceptual linear predictive coding ............................... 4 2. Figure 2 Threshold of hearing for average human ..................................................... 7 3. Figure 3 Frequency to place transformation along the basilar membrane ................. 8 4. Figure 4 Narrow band noise sources masked by two tones ....................................... 9 5. Figure 5 Decrease in threshold after critical bandwidth ............................................ 9 6. Figure 6 Noise masking tone ................................................................................... 12 7. Figure 7 Tone masking noise ................................................................................... 13 8. Figure 8 Non-simultaneous masking properties of human ear ................................ 14 9. Figure 9 Steps to calculate masking threshold of signal .......................................... 16 10. Figure 10 FIR linear predictor structure .................................................................. 19 11. Figure 11 IIR linear predictor structure ................................................................... 21 12. Figure 12 Determination of linear predictor coefficients ........................................ 23 13. Figure 13 Input signal .............................................................................................. 31 14. Figure 14 Pre-filtered signal .................................................................................... 32 15. Figure 15 Reconstructed signal from post-filter ...................................................... 33 16. Figure 16 Spectrogram for masking threshold of input signal ................................ 34 17. Figure 17 Spectrogram for estimated masking threshold ........................................ 35 18. Figure 18 Masking threshold and LPC response for frame of signal ...................... 36 x 1 Chapter 1 INTRODUCTION 1.1 Background In our day-to-day lives, we use various kinds of audio equipment, such as Cell phones, music players and wireless radio receivers. These devices process audio signals in different ways. The basic form of audio signals is analog. It is easier to process a digital signal form rather than an analog signal form. The process of converting an analog signal into a digital representation is described as audio coding. Moreover, audio processing has become significantly highly digitized in recent years. The general procedure of audio processing is as follows. An analog signal is sampled at regular intervals and sampled data is encoded with a coding scheme. At the decoder side, data is converted back to the original form. Therefore, as we increase the sampling rate of the audio signal, the bandwidth required by that
Recommended publications
  • Digital Speech Processing— Lecture 17
    Digital Speech Processing— Lecture 17 Speech Coding Methods Based on Speech Models 1 Waveform Coding versus Block Processing • Waveform coding – sample-by-sample matching of waveforms – coding quality measured using SNR • Source modeling (block processing) – block processing of signal => vector of outputs every block – overlapped blocks Block 1 Block 2 Block 3 2 Model-Based Speech Coding • we’ve carried waveform coding based on optimizing and maximizing SNR about as far as possible – achieved bit rate reductions on the order of 4:1 (i.e., from 128 Kbps PCM to 32 Kbps ADPCM) at the same time achieving toll quality SNR for telephone-bandwidth speech • to lower bit rate further without reducing speech quality, we need to exploit features of the speech production model, including: – source modeling – spectrum modeling – use of codebook methods for coding efficiency • we also need a new way of comparing performance of different waveform and model-based coding methods – an objective measure, like SNR, isn’t an appropriate measure for model- based coders since they operate on blocks of speech and don’t follow the waveform on a sample-by-sample basis – new subjective measures need to be used that measure user-perceived quality, intelligibility, and robustness to multiple factors 3 Topics Covered in this Lecture • Enhancements for ADPCM Coders – pitch prediction – noise shaping • Analysis-by-Synthesis Speech Coders – multipulse linear prediction coder (MPLPC) – code-excited linear prediction (CELP) • Open-Loop Speech Coders – two-state excitation
    [Show full text]
  • Mpeg Vbr Slice Layer Model Using Linear Predictive Coding and Generalized Periodic Markov Chains
    MPEG VBR SLICE LAYER MODEL USING LINEAR PREDICTIVE CODING AND GENERALIZED PERIODIC MARKOV CHAINS Michael R. Izquierdo* and Douglas S. Reeves** *Network Hardware Division IBM Corporation Research Triangle Park, NC 27709 [email protected] **Electrical and Computer Engineering North Carolina State University Raleigh, North Carolina 27695 [email protected] ABSTRACT The ATM Network has gained much attention as an effective means to transfer voice, video and data information We present an MPEG slice layer model for VBR over computer networks. ATM provides an excellent vehicle encoded video using Linear Predictive Coding (LPC) and for video transport since it provides low latency with mini- Generalized Periodic Markov Chains. Each slice position mal delay jitter when compared to traditional packet net- within an MPEG frame is modeled using an LPC autoregres- works [11]. As a consequence, there has been much research sive function. The selection of the particular LPC function is in the area of the transmission and multiplexing of com- governed by a Generalized Periodic Markov Chain; one pressed video data streams over ATM. chain is defined for each I, P, and B frame type. The model is Compressed video differs greatly from classical packet sufficiently modular in that sequences which exclude B data sources in that it is inherently quite bursty. This is due to frames can eliminate the corresponding Markov Chain. We both temporal and spatial content variations, bounded by a show that the model matches the pseudo-periodic autocorre- fixed picture display rate. Rate control techniques, such as lation function quite well. We present simulation results of CBR (Constant Bit Rate), were developed in order to reduce an Asynchronous Transfer Mode (ATM) video transmitter the burstiness of a video stream.
    [Show full text]
  • Speech Compression
    information Review Speech Compression Jerry D. Gibson Department of Electrical and Computer Engineering, University of California, Santa Barbara, CA 93118, USA; [email protected]; Tel.: +1-805-893-6187 Academic Editor: Khalid Sayood Received: 22 April 2016; Accepted: 30 May 2016; Published: 3 June 2016 Abstract: Speech compression is a key technology underlying digital cellular communications, VoIP, voicemail, and voice response systems. We trace the evolution of speech coding based on the linear prediction model, highlight the key milestones in speech coding, and outline the structures of the most important speech coding standards. Current challenges, future research directions, fundamental limits on performance, and the critical open problem of speech coding for emergency first responders are all discussed. Keywords: speech coding; voice coding; speech coding standards; speech coding performance; linear prediction of speech 1. Introduction Speech coding is a critical technology for digital cellular communications, voice over Internet protocol (VoIP), voice response applications, and videoconferencing systems. In this paper, we present an abridged history of speech compression, a development of the dominant speech compression techniques, and a discussion of selected speech coding standards and their performance. We also discuss the future evolution of speech compression and speech compression research. We specifically develop the connection between rate distortion theory and speech compression, including rate distortion bounds for speech codecs. We use the terms speech compression, speech coding, and voice coding interchangeably in this paper. The voice signal contains not only what is said but also the vocal and aural characteristics of the speaker. As a consequence, it is usually desired to reproduce the voice signal, since we are interested in not only knowing what was said, but also in being able to identify the speaker.
    [Show full text]
  • Advanced Speech Compression VIA Voice Excited Linear Predictive Coding Using Discrete Cosine Transform (DCT)
    International Journal of Innovative Technology and Exploring Engineering (IJITEE) ISSN: 2278-3075, Volume-2 Issue-3, February 2013 Advanced Speech Compression VIA Voice Excited Linear Predictive Coding using Discrete Cosine Transform (DCT) Nikhil Sharma, Niharika Mehta Abstract: One of the most powerful speech analysis techniques LPC makes coding at low bit rates possible. For LPC-10, the is the method of linear predictive analysis. This method has bit rate is about 2.4 kbps. Even though this method results in become the predominant technique for representing speech for an artificial sounding speech, it is intelligible. This method low bit rate transmission or storage. The importance of this has found extensive use in military applications, where a method lies both in its ability to provide extremely accurate high quality speech is not as important as a low bit rate to estimates of the speech parameters and in its relative speed of computation. The basic idea behind linear predictive analysis is allow for heavy encryptions of secret data. However, since a that the speech sample can be approximated as a linear high quality sounding speech is required in the commercial combination of past samples. The linear predictor model provides market, engineers are faced with using other techniques that a robust, reliable and accurate method for estimating parameters normally use higher bit rates and result in higher quality that characterize the linear, time varying system. In this project, output. In LPC-10 vocal tract is represented as a time- we implement a voice excited LPC vocoder for low bit rate speech varying filter and speech is windowed about every 30ms.
    [Show full text]
  • Source Coding Basics and Speech Coding
    Source Coding Basics and Speech Coding Yao Wang Polytechnic University, Brooklyn, NY11201 http://eeweb.poly.edu/~yao Outline • Why do we need to compress speech signals • Basic components in a source coding system • Variable length binary encoding: Huffman coding • Speech coding overview • Predictive coding: DPCM, ADPCM • Vocoder • Hybrid coding • Speech coding standards ©Yao Wang, 2006 EE3414: Speech Coding 2 Why do we need to compress? • Raw PCM speech (sampled at 8 kbps, represented with 8 bit/sample) has data rate of 64 kbps • Speech coding refers to a process that reduces the bit rate of a speech file • Speech coding enables a telephone company to carry more voice calls in a single fiber or cable • Speech coding is necessary for cellular phones, which has limited data rate for each user (<=16 kbps is desired!). • For the same mobile user, the lower the bit rate for a voice call, the more other services (data/image/video) can be accommodated. • Speech coding is also necessary for voice-over-IP, audio-visual teleconferencing, etc, to reduce the bandwidth consumption over the Internet ©Yao Wang, 2006 EE3414: Speech Coding 3 Basic Components in a Source Coding System Input Transformed Quantized Binary Samples parameters parameters bitstreams Transfor- Quanti- Binary mation zation Encoding Lossy Lossless Prediction Scalar Q Fixed length Transforms Vector Q Variable length Model fitting (Huffman, …... arithmetic, LZW) • Motivation for transformation --- To yield a more efficient representation of the original samples. ©Yao Wang, 2006 EE3414:
    [Show full text]
  • Linear Predictive Coding Is All-Pole Resonance Modeling
    Linear Predictive Coding is All-Pole Resonance Modeling Hyung-Suk Kim Center for Computer Research in Music and Acoustics, Stanford University 1 Why another article on LPC? Linear predictive coding (LPC) is a widely used technique in audio signal pro- cessing, especially in speech signal processing. It has found particular use in voice signal compression, allowing for very high compression rates. As widely adopted as it is, LPC is covered in many textbooks and is taught in most ad- vanced audio signal processing courses. So why another article on LPC? Despite covering LPC during my undergraduate coursework in electrical en- gineering, it wasn't until implementing LPC for my own research project that I understood what the goals of LPC were and what it was doing mathematically to meet those goals. A great part of the confusion stemmed from the some- what cryptic name, Linear-Predictive-Coding. \Linear" made sense, however \Predictive" and \Coding", sounded baffling, at least to the undergraduate me. What is it trying to predict? And coding? What does that mean? As we will find in the following sections, the name LPC does make sense. However, it is one catered to a specific use, speech signal transmission, possibly obscuring other applications, such as cross-synthesis. It takes a moment to understand the exclamation, \I used linear predictive coding to cross-synthesize my voice with a creaking ship!". Thus the purpose of this article is to explain LPC from a general perspective, one that makes sense to me and hopefully to others trying to grasp what LPC is.
    [Show full text]
  • Hybrid Compression Technique Using Linear Predictive Coding for Electrocardiogram Signals
    International Journal of Engineering Technology Science and Research IJETSR www.ijetsr.com ISSN 2394 – 3386 Volume 4, Issue 6 June 2017 Hybrid Compression Technique Using Linear Predictive Coding for Electrocardiogram Signals K. S Surekha B. P. Patil Research Scholar, Sinhgad College of Engg. Pune Principal (Assoc. Professor, AIT, Pune) AIT,Pune ABSTRACT Linear Predictive Coding (LPC) is used for analysis and compression of speech signals. Whereas Huffman coding is used forElectrocardiogram (ECG) signal compression. This paper presents a hybrid compression technique for ECG signal using modifiedHuffman encoding andLPC.The aim of this paper is to apply the linear prediction coding and modified Huffman coding for analysis, compression and prediction of ECG signals. The ECG signal is transformed through discrete wavelet transform. MIT-BIH database is used for testing the compression algorithm. The performance measure used to validate the results are the Compression ratio (CR) and Percent Root mean square difference (PRD).The improved CR and PRD obtained in this research prove the quality of the reconstructed signal. Key words Huffman encoding, Linear Predictive Coding, Compression 1. INTRODUCTION ECG gives clear indication about heart diseases and arrhythmias. It is necessary to monitor and store the ECG signal of subjects continuously for diagnosis purpose. Due to this, the data storage size keeps on increasing. In such situations, it is necessary to compress the ECG signal for storage and transmission. The important factor for consideration is to obtain maximum data compression. That must also ensure that the signal retain the clinically important features. Fig. 1 shows the ECG signal with different peaks. Fig.
    [Show full text]
  • Embedded Lossless Audio Coding Using Linear Prediction and Cascade
    University of Wollongong Research Online Faculty of Engineering and Information Faculty of Informatics - Papers (Archive) Sciences 2005 Embedded lossless audio coding using linear prediction and cascade Kevin Adistambha University of Wollongong, [email protected] Christian Ritz University of Wollongong, [email protected] Jason Lukasiak [email protected] Follow this and additional works at: https://ro.uow.edu.au/infopapers Part of the Physical Sciences and Mathematics Commons Recommended Citation Adistambha, Kevin; Ritz, Christian; and Lukasiak, Jason: Embedded lossless audio coding using linear prediction and cascade 2005. https://ro.uow.edu.au/infopapers/2793 Research Online is the open access institutional repository for the University of Wollongong. For further information contact the UOW Library: [email protected] Embedded lossless audio coding using linear prediction and cascade Abstract Embedded lossless audio coding is a technique for embedding a perceptual audio coding bitstream within a lossless audio coding bitstream. This paper provides an investigation into a lossless embedded audio coder based on the AAC coder and utilising both backward Linear Predictive Coding (LPC) and cascade coding. Cascade coding is a technique for entropy coding of large dynamic range integer sequences that has the advantage of simple implementation and low complexity. Results show that employing LPC in an embedded architecture achieves approximately an 8% decrease in the coding rate. The overall compression performance of cascade coding closely follows Rice coding, a popular entropy coding method for lossless audio. It is also shown that performance can be further improved by incorporating a start of the art lossless coder into the proposed embedded coder.
    [Show full text]
  • Speech Compression Using LPC-10 and VELPC Based on DCT Technique Compression
    International Journal of Science and Research (IJSR) ISSN: 2319-7064 ResearchGate Impact Factor (2018): 0.28 | SJIF (2018): 7.426 Speech Compression Using LPC-10 and VELPC Based on DCT Technique Compression Aditi Kar1, Rasmi Ranjan Samantray2 1M Tech Scholar, CCEM Kabir Nagar Raipur, Affiliated to CSVTU, Bhilai, Chhattisgarh, India 2Assistant Professor, CCEM, Raipur, CCEM Kabir Nagar Raipur, Affiliated to CSVTU, Bhilai, Chhattisgarh, India Abstract: In this paper, we have presented the speech compression techniques i.e. Linear Predictive Coding and its modified version Voice Excited Linear Predictive Coding. Output of LPC-10 is compared with output of VELPC. Here instead of using plain VELPC we are using modified VELPC or we can say that VELPC based on Discrete Cosine Transform technique. The result shown here was obvious since VELPC is modified version of LPC and so its output quality is better as compared to output quality of LPC. LPC is one of the most powerful speech coding techniques and it is widely used for encoding speech signal at a very low bit rate. Pitch period estimation is the weakest link in the LPC method so this drawback is eliminated in VELPC technique. Thus, the bit rate however is somewhat increased in VELPC technique. Therefore Discrete Cosine Transform is used to compress the innovation signal in case of VELPC in order to reduce bit rate to some extent. Keywords: Speech signal, Discrete Cosine Transform (DCT), Linear Prediction Coding (LPC), Voice Excited Linear Prediction Coding (VELPC), Bit rate 1. Introduction these voices are shaped or articulated in the vocal tract. These articulations along with the gain are considered as the Linear Predictive Coding is based on Linear Prediction innovation signal.
    [Show full text]
  • Linear Predictive Coding
    Copyright 2004 – Oregon State University 1 of 1 Lab 5 – Linear Predictive Coding Idea When plain speech audio is recorded and needs to be transmitted over a channel with limited bandwidth it is often necessary to either compress or encode the audio data to meet the bandwidth specs. In this lab you will look at how Linear Predictive Coding works and how it can be used to compress speech audio. Objectives • Speech encoding • Speech synthesis Read the LPC.pdf document for background information on Linear Predictive Coding Procedure There are two major steps involved in this lab. In real life the first step would represent the side where the audio is recorded and encoded for transmission. The second step would represent the receiving side where that data is used to regenerate the audio through synthesis. In this lab you will be doing both the encoding/transmitting and receiving/synthesis parts. When you are done, you should have at least 4 separate MATLAB files. Two of these, the main file and the levinson function, are given to you. The LPC coding function and the Synthesis function are the files that you have to write. Below is an overview list of steps for this lab. 1. Read the *.wav file into MATLAB and pass the data to the LPC coding function 2. The LPC coding function will do the following: a. Divide the data into 30mSec frames b. For every frame, find the data necessary to reproduce the audio (voiced/unvoiced, gain, pitch, filter coefficients) c. The LPC coding function will return these data vectors 3.
    [Show full text]
  • M-Ary Predictive Coding: a Nonlinear Model for Speech
    M-ARY PREDICTIVE CODING: A NONLINEAR MODEL FOR SPEECH M.Vandana Final Year B.E(ECE) PSG College of Technology Coimbatore-641004. [email protected] ABSTRACT 2. INTRODUCTION Speech Coding is pivotal in the Speech is a very special signal for a ability of networks to support multimedia variety of reasons. The most preliminary of services. The technique currently used for these is the fact that speech is a non- speech coding is Linear Prediction. It stationary signal. This makes speech a models the throat as an all-pole filter i.e. rather tough signal to analyze and model. using a linear difference equation. However, the physical nature of the The second reason, is that factors throat is itself a clue to its nonlinear like the intelligibility, the coherence and nature. Developing a nonlinear model is other such ‘human’ characteristics play a difficult as in the solution of nonlinear vital role in speech analysis as against equations and the verification of statistical parameters like Mean Square nonlinear schemes. Error. In this paper, two nonlinear The third reason is from a models– Quadratic Predictive Coding and communications point of view. The M-ary Predictive Coding- have been number of discrete values required to proposed. The equations for the models describe one second of speech amounts to were developed and the coefficients 8000 (at the minimum). Due to concerns of solved for. MATLAB was used for bandwidth, compression is desirable. implementation and testing. This paper gives the equations and preliminary 2.1. Linear Predictive Coding results. The proposed enhancements to MPC are also discussed in brief.
    [Show full text]
  • Speech Coding Methods, Standards, and Applications Jerry D. Gibson
    Speech Coding Methods, Standards, and Applications Jerry D. Gibson Department of Electrical & Computer Engineering University of California, Santa Barbara Santa Barbara, CA 93106-6065 [email protected] I. Introduction Speech coding is fundamental to the operation of the public switched telephone network (PSTN), videoconferencing systems, digital cellular communications, and emerging voice over Internet protocol (VoIP) applications. The goal of speech coding is to represent speech in digital form with as few bits as possible while maintaining the intelligibility and quality required for the particular application. Interest in speech coding is motivated by the evolution to digital communications and the requirement to minimize bit rate, and hence, conserve bandwidth. There is always a tradeoff between lowering the bit rate and maintaining the delivered voice quality and intelligibility; however, depending on the application, many other constraints also must be considered, such as complexity, delay, and performance with bit errors or packet losses [1]. Two networks that have been developed primarily with voice communications in mind are the public switched telephone network (PSTN) and digital cellular networks. Additionally, with the pervasiveness of the Internet, voice over the Internet Protocol (VoIP) is growing rapidly and is expected to do so for the near future. A new and powerful development for data communications is the emergence of wireless local area networks (WLANs) in the embodiment of the 802.11 a, b, g standards, and the next generation, 802.11n, collectively referred to as Wi-Fi, and the on-going development of the IEEE 802.16 family of standards for wireless metropolitan area networks (WMAN), often referred to as WiMax.
    [Show full text]