ebook img

Digital control of a class-D audio amplifier PDF

189 Pages·2012·8.36 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Digital control of a class-D audio amplifier

Digital Control of a Class-D Audio Amplifier by Jason Quibell Thesis submitted in fulfilment of the requirements for the degree Master of Technology: Electrical Engineering in the Faculty of Engineering at the Cape Peninsula University of Technology Supervisor: Prof. R.H. Wilkinson Co-supervisor: Prof. H. du T. Mouton Cape Town, South Africa November 2011 Declaration I, Jason Quibell, declare that the contents of this thesis represent my own unaided work, and that the thesis has not previously been submitted for aca- demic examination towards any qualification. Furthermore, it represents my own opinions and not necessarily those of the Cape Peninsula University of Technology. Signature: ........................... 23 November 2011 Date: ............................... Copyright © 2012 Cape Peninsula University of Technology All rights reserved. i Abstract Modern technologies have led to extensive digital music reproduction and dis- tribution. It is fitting then that digital audio be amplified directly from its source rather than being converted to an analogue waveform before amplifi- cation. The benefits of using a digital controller for audio processing include being able to easily reconfigure the system and to add additional functions at a later stage. Digital audio is primarily stored as Pulse Code Modulation (PCM) while Pulse Width Modulation (PWM) is the most popular scheme used to drive a class-D amplifier. The class-D amplifier is selected in many applications due to its very high energy efficiency. Conventional PCM to PWM conversion is inherently nonlinear. Various interpolation schemes are presented in this research project which help to address the nonlinearity. Digitally generated PWM has a limited resolution which is constrained by the system clock. This thesis presents noise shaping techniques which increase the effective resolution of the PWM process without having to use an excessively high systemclock. Noise shaping allows a lowresolution modulator to be used to reproduce high resolution audio. ii Acknowledgements I would like to express my sincere gratitude to the following people and organ- isations: National Research Foundation (NRF) Cape Peninsula University of Technology (CPUT) Centre for Instrumentation Research (CIR) French South African Institute of Technology (F’SATI) Professor Richardt Wilkinson for his guidance Professor Toit Mouton for his generosity of knowledge Mr Robert Neilson for his insightful suggestions Professor Gerhart de Jager for his years of wisdom Charl Jooste for his camaraderie The financial assistance of the National Research Foundation and the Cape Peninsula University of Technology towards this research is acknowledged. Opinions expressed in this thesis and the conclusions arrived at, are those of theauthor,andarenotnecessarilytobeattributedtotherespectivementioned establishments. iii Dedications To Mom, Dad, Bonnie, Tyrus, Keegan, Oliver and Gaby for their unwavering support iv Contents Declaration i Abstract ii Acknowledgements iii Dedications iv Contents v List of Figures viii List of Tables xii Nomenclature xiii 1 Introduction 1 1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Problem statement . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.3 Objectives of the research . . . . . . . . . . . . . . . . . . . . . 3 1.4 Structure of the thesis . . . . . . . . . . . . . . . . . . . . . . . 4 2 Digital signal processing 6 2.1 DSP applications . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.2 Signal sampling and quantisation . . . . . . . . . . . . . . . . . 7 2.3 Hardware for signal processing . . . . . . . . . . . . . . . . . . . 9 2.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3 Pulse width modulation 13 3.1 Theory of operation . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.2 Natural and uniform sampling . . . . . . . . . . . . . . . . . . . 15 3.3 Harmonic distortion . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4 Interpolation 18 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 v CONTENTS vi 4.2 Sample rate conversion . . . . . . . . . . . . . . . . . . . . . . . 19 4.3 Finite impulse response interpolation filter . . . . . . . . . . . . 22 4.4 Polyphase interpolation filter . . . . . . . . . . . . . . . . . . . . 25 4.5 Cascaded integrator comb filter . . . . . . . . . . . . . . . . . . 29 4.6 Polynomial interpolation . . . . . . . . . . . . . . . . . . . . . . 34 4.7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 5 Noise shaping 40 5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 5.2 General noise shaping . . . . . . . . . . . . . . . . . . . . . . . . 41 5.3 Digital noise shaping loop filter . . . . . . . . . . . . . . . . . . 45 5.4 Ripple compensation . . . . . . . . . . . . . . . . . . . . . . . . 60 5.5 Ripple compensation verification . . . . . . . . . . . . . . . . . . 62 5.6 Loop filter implementation . . . . . . . . . . . . . . . . . . . . . 67 5.7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 6 VHDL Implementation 78 6.1 Hardware interconnections . . . . . . . . . . . . . . . . . . . . . 79 6.2 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 6.3 Receive audio data . . . . . . . . . . . . . . . . . . . . . . . . . 84 6.4 Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 6.5 Noise shaping . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 6.6 Pulse width modulation and feedback . . . . . . . . . . . . . . . 90 6.7 Synchronisation . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 6.8 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 7 Test and verification 92 7.1 Initial testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 7.2 System redesign . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 7.3 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 8 Results 97 8.1 Hardware setup . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 8.2 Simulation verification . . . . . . . . . . . . . . . . . . . . . . . 98 8.3 Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 8.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 9 Conclusion 108 9.1 Overview of project objectives . . . . . . . . . . . . . . . . . . . 108 9.2 Objectives achieved . . . . . . . . . . . . . . . . . . . . . . . . . 108 9.3 Problems encountered . . . . . . . . . . . . . . . . . . . . . . . 109 9.4 Future research and recommendations . . . . . . . . . . . . . . . 110 List of References 111 CONTENTS vii Appendices 114 A Noise shaper filter coefficients 115 A.1 Classic noise shaper coefficient design . . . . . . . . . . . . . . . 115 B VHDL source code 117 B.1 Main program source code . . . . . . . . . . . . . . . . . . . . . 117 B.2 SPI source code . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 B.3 Receive audio data source code . . . . . . . . . . . . . . . . . . 127 B.4 Interpolation source code . . . . . . . . . . . . . . . . . . . . . . 131 B.5 Noise shaper source code . . . . . . . . . . . . . . . . . . . . . . 139 B.6 Pulse Width Modulation source code . . . . . . . . . . . . . . . 146 C Matlab source code 149 C.1 Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 C.2 Polynomial interpolation . . . . . . . . . . . . . . . . . . . . . . 156 C.3 Noise shaper filter coefficient calculator . . . . . . . . . . . . . . 158 C.4 Modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 C.5 Spectral content . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 D Data sheets 165 D.1 SRC4392 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 D.2 Altera Cyclone III (EP3C25) . . . . . . . . . . . . . . . . . . . . 171 List of Figures 2.1 CorrectsamplingwhichwillnotresultinaliasingadaptedfromTan (2008) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2 Incorrect sampling which leads to aliasing adapted from Tan (2008) 9 2.3 Floating point format adapted from Tan (2008) . . . . . . . . . . . 11 2.4 Q-15 (fixed point) format adapted from Tan (2008) . . . . . . . . . 12 3.1 Archetype pulse width modulator . . . . . . . . . . . . . . . . . . . 13 3.2 Uniformly sampled pulse width modulator adapted from Goldberg & Sandler (1991a) . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.3 UPWM and NPWM producing different PWM waveforms adapted from Nielsen (1998) and Jacobs (2006) . . . . . . . . . . . . . . . . 15 4.1 Upsampler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 4.2 Sine wave before and after upsampling . . . . . . . . . . . . . . . . 20 4.3 1 kHz sine wave spectrum before and after upsampling . . . . . . . 21 4.4 Upsampler with low-pass filter . . . . . . . . . . . . . . . . . . . . . 22 4.5 FIR filter magnitude and phase response . . . . . . . . . . . . . . . 24 4.6 1 kHz sine wave spectrum before and after being filtered . . . . . . 24 4.7 Direct interpolation filter . . . . . . . . . . . . . . . . . . . . . . . . 25 4.8 Polyphase filter implementation adapted from Tan (2008) . . . . . . 26 4.9 Commutative model for the polyphase interpolation filter adapted from Tan (2008) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4.10 Impulse response of the original FIR filter . . . . . . . . . . . . . . 27 4.11 Impulse response of the first polyphase filter . . . . . . . . . . . . . 28 4.12 Impulse response of the second polyphase filter . . . . . . . . . . . 28 4.13 CIC filter block diagram adapted from Hogenauer (1981) . . . . . . 30 4.14 CIC filter magnitude response . . . . . . . . . . . . . . . . . . . . . 32 4.15 CIC compensation filter block diagram . . . . . . . . . . . . . . . . 32 4.16 CIC compensator filter magnitude response . . . . . . . . . . . . . 33 4.17 Magnitude response of a CIC filter cascaded with a CIC compensator 33 4.18 Curve constructed from discrete data points . . . . . . . . . . . . . 35 4.19 Unstable curve constructed from 11 data points . . . . . . . . . . . 38 5.1 Shaped and unshaped noise adapted from Craven (1993) . . . . . . 41 viii LIST OF FIGURES ix 5.2 NoiseshaperconfigurationadaptedfromGoldberg& Sandler(1991a) 42 5.3 Noise shaping filter when calculated for different orders adapted from Hawksford (1989a) and Jacobs (2006) . . . . . . . . . . . . . . 43 5.4 Magnitude response of a fifth order filter using calculated coefficients 44 5.5 Noise shaper Simulink model . . . . . . . . . . . . . . . . . . . . . 45 5.6 Cascade compensation adapted from Wescott (2006) . . . . . . . . 46 5.7 Feedforward compensation adapted from Wescott (2006) . . . . . . 46 5.8 Feedback compensation adapted from Wescott (2006) . . . . . . . . 47 5.9 Open loop bode plot for a first order filter . . . . . . . . . . . . . . 48 5.10 Open loop bode plot of a third order filter . . . . . . . . . . . . . . 49 5.11 Open loop bode plot of a fifth order filter . . . . . . . . . . . . . . . 50 5.12 NTF bode plot of a third order filter . . . . . . . . . . . . . . . . . 51 5.13 NTF bode plot of a fifth order filter . . . . . . . . . . . . . . . . . . 51 5.14 Simulink model for a pulse width modulator . . . . . . . . . . . . . 53 5.15 Spectral content of a 7-bit PWM waveform . . . . . . . . . . . . . . 54 5.16 Zoomed view of the audio band of Figure 5.15 . . . . . . . . . . . . 54 5.17 Simulink model for a pulse width modulator and loop filter . . . . . 55 5.18 Spectral content of a 7-bit PWM waveform with a first order filter . 56 5.19 Zoomed view of the audio band of Figure 5.18 . . . . . . . . . . . . 56 5.20 Spectral content of a 7-bit PWM waveform with a third order loop filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.21 Spectral content of a 7-bit PWM waveform with a fifth order loop filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.22 Zoomed view of the audio band of Figure 5.20 . . . . . . . . . . . . 58 5.23 Zoomed view of the audio band of Figure 5.21 . . . . . . . . . . . . 58 5.24 Implementation of ripple compensation adapted from Mouton & Putzeys (2009) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 5.25 Ripple compensation waveforms adapted from Mouton & Putzeys (2009) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 5.26 Simulink model for a pulse width modulator and loop filter includ- ing ripple compensation . . . . . . . . . . . . . . . . . . . . . . . . 64 5.27 Spectral content of a 7-bit PWM waveform with a third order loop filter and ripple compensation . . . . . . . . . . . . . . . . . . . . . 65 5.28 Zoomed view of the audio band of Figure 5.27 . . . . . . . . . . . . 65 5.29 Spectral content of a 7-bit PWM waveform with a fifth order loop filter and ripple compensation . . . . . . . . . . . . . . . . . . . . . 66 5.30 Zoomed view of the audio band of Figure 5.29 . . . . . . . . . . . . 66 5.31 Delayed output integrator . . . . . . . . . . . . . . . . . . . . . . . 67 5.32 Non-delayed output integrator . . . . . . . . . . . . . . . . . . . . . 68 5.33 CascadeofintegratorswithfeedbacksummationadaptedfromSchreier & Temes (2005) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 5.34 Resonator for a loop filter adapted from Norsworthy et al. (1997) . 69 5.35 CascadedresonatorwithfeedbacksummationadaptedfromSchreier & Temes (2005) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

Description:
Digital Control of a Class-D Audio Amplifier by. Jason Quibell. Thesis submitted in fulfilment of the requirements for the degree. Master of Technology: Electrical Engineering in the Faculty of Engineering at the Cape Peninsula University of Technology. Supervisor: Prof. R.H. Wilkinson. Co-supervis
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.