21065L Audio Tutorial
Total Page:16
File Type:pdf, Size:1020Kb
a Using The Low-Cost, High Performance ADSP-21065L Digital Signal Processor For Digital Audio Applications Revision 1.0 - 12/4/98 dB +12 0 -12 Left Right Left EQ Right EQ Pan L R L R L R L R L R L R L R L R 1 2 3 4 5 6 7 8 Mic High Line L R Mid Play Back Bass CNTR 0 0 3 4 Input Gain P F R Master Vol. 1 2 3 4 5 6 7 8 Authors: John Tomarakos Dan Ledger Analog Devices DSP Applications 1 Using The Low Cost, High Performance ADSP-21065L Digital Signal Processor For Digital Audio Applications Dan Ledger and John Tomarakos DSP Applications Group, Analog Devices, Norwood, MA 02062, USA This document examines desirable DSP features to consider for implementation of real time audio applications, and also offers programming techniques to create DSP algorithms found in today's professional and consumer audio equipment. Part One will begin with a discussion of important audio processor-specific characteristics such as speed, cost, data word length, floating-point vs. fixed-point arithmetic, double-precision vs. single-precision data, I/O capabilities, and dynamic range/SNR capabilities. Comparisions between DSP's and audio decoders that are targeted for consumer/professional audio applications will be shown. Part Two will cover example algorithmic building blocks that can be used to implement many DSP audio algorithms using the ADSP-21065L including: Basic audio signal manipulation, filtering/digital parametric equalization, digital audio effects and sound synthesis techniques. TABLE OF CONTENTS 0. INTRODUCTION ................................................................................................................................................................4 1. SELECTING AN AUDIO SIGNAL PROCESSOR...........................................................................................................5 1.1 GENERAL PURPOSE DIGITAL SIGNAL PROCESSORS AND DECODERS FOR AUDIO .......................................................5 1.2 PRICE ..........................................................................................................................ERROR! BOOKMARK NOT DEFINED. 1.3 PROCESSOR SPEED ..........................................................................................................................................................5 1.4 ON-CHIP MEMORY..........................................................................................................................................................7 1.5 I/O CAPABILITIES AND INTERFACES FOR PROCESSING OF AUDIO SAMPLES ..............................................................7 1.5.1 DMA (Direct Memory Access) Controllers..............................................................................................................7 1.5.2 Serial Interface to Audio Converters and other Digital Audio Devices..................................................................7 1.6 DSP NUMERIC DATA FORMATS : FIXED/FLOATING POINT ARITHMETIC....................................................................9 1.6.1 1.6.0 16/24/32-Bit Fixed-Point Arithmetic ............................................................................................................10 1.6.2 Floating-Point Arithmetic ......................................................................................................................................10 1.7 DOUBLE-PRECISION FIXED POINT ARITHMETIC VERSUS SINGLE-PRECISION ARITHMETIC....................................11 1.8 THE IMPORTANCE OF DYNAMIC RANGE IN DSP-AUDIO PROCESSING ......................................................................11 2 2. USEFUL DSP HARDWARE/SOFTWARE BUILDING BLOCKS FOR AUDIO.......................................................18 2.1 BASIC ARITHMETIC OPERATIONS ................................................................................................................................18 2.2 IMPLEMENTING CONVOLUTION WITH ZERO-OVERHEAD LOOPING, MULTIPLY/ACCUMULATE INSTRUCTIONS (MAC), AND DUAL MEMORY FETCHES .............................................................................................................................18 2.3 HARDWARE CIRCULAR BUFFERING FOR EFFICIENT STORAGE/RETRIEVAL OF AUDIO SAMPLES ...........................19 2.4 ZERO-OVERHEAD LOOPING..........................................................................................................................................20 2.5 BLOCK PROCESSING VS. SAMPLE PROCESSING ...........................................................................................................20 2.6 DELAY-LINES.................................................................................................................................................................20 2.7 SIGNAL GENERATION WITH LOOK-UP TABLES ..........................................................................................................21 3. IMPLEMENTING DSP AUDIO ALGORITHMS..........................................................................................................23 3.1 BASIC AUDIO SIGNAL MANIPULATION.........................................................................................................................23 3.1.1 Volume Control ......................................................................................................................................................24 3.1.2 Mixing Multiple Audio Signal Channels...............................................................................................................24 3.1.3 Amplitude Panning of Signals to a Left or Right Stereo Field .............................................................................25 3.2 FILTERING TECHNIQUES AND APPLICATIONS..............................................................................................................29 3.2.1 The FIR Filter ........................................................................................................................................................29 3.2.2 The IIR Filter .........................................................................................................................................................30 3.2.3 Parametric Filters...................................................................................................................................................31 3.2.4 Graphic Equalizers.................................................................................................................................................33 3.2.5 Comb Filters ...........................................................................................................................................................35 3.2.6 Scaling to Prevent Overflow...................................................................................................................................36 3.3 TIME-DELAY DIGITAL AUDIO EFFECTS.......................................................................................................................37 3.3.1 Digital Delay - (Echo, Single Delay, Multi-tap Delays and ADT) ........................................................................37 3.3.2 Delay Modulation Effects.......................................................................................................................................44 3.3.2.1 Flanger Effect .................................................................................................................................................................... 45 3.3.2.2 Chorus Effect ..................................................................................................................................................................... 48 3.3.2.3 Vibrato................................................................................................................................................................................ 54 3.3.2.4 Pitch Shifter ....................................................................................................................................................................... 54 3.3.2.5 Detune Effect...................................................................................................................................................................... 55 3.3.3 Digital Reverberation Algorithms for Simulation of Large Acoustic Spaces.......................................................55 3.4 AMPLITUDE-BASED AUDIO EFFECTS............................................................................................................................61 3.4.1 Tremolo - Digital Stereo Panning Effect...............................................................................................................61 3.4.2 Signal Level Measurement.....................................................................................................................................62 3.4.3 Dynamics Processing..............................................................................................................................................63 3.4.3.1 Compressors and Limiters ................................................................................................................................................ 63 3.4.3.2 Noise Gate/Downward Expander ..................................................................................................................................... 66 3.4.3.3 Expanders..........................................................................................................................................................................