888
 Introduction to Sound Recording GeoMartin, B.Mus., M.Mus., Ph.D. August 2, 2004

Audio Textbook

Embed Size (px)

Citation preview

Introduction to Sound RecordingGeoMartin,B.Mus.,M.Mus.,Ph.D.August2,20042ContentsOpeningmaterials xvii0.1 Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii0.2 Thanks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix0.3 Autobiography . . . . . . . . . . . . . . . . . . . . . . . . . . xx0.4 Recommended Reading . . . . . . . . . . . . . . . . . . . . . xxi0.4.1 General Information . . . . . . . . . . . . . . . . . . . xxi0.4.2 Sound Recording . . . . . . . . . . . . . . . . . . . . . xxi0.4.3 Analog Electronics . . . . . . . . . . . . . . . . . . . . xxi0.4.4 Psychoacoustics . . . . . . . . . . . . . . . . . . . . . . xxi0.4.5 Acoustics . . . . . . . . . . . . . . . . . . . . . . . . . xxii0.4.6 Digital Audio and DSP . . . . . . . . . . . . . . . . . xxii0.4.7 Electroacoustic Measurements . . . . . . . . . . . . . . xxii0.5 Why is this book free? . . . . . . . . . . . . . . . . . . . . . . xxiii1 IntroductoryMaterials 11.1 Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1.1 Right Triangles . . . . . . . . . . . . . . . . . . . . . . 11.1.2 Slope . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Exponents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.3 Logarithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.3.1 Warning. . . . . . . . . . . . . . . . . . . . . . . . . . 61.4 Trigonometric Functions . . . . . . . . . . . . . . . . . . . . . 81.4.1 Radians . . . . . . . . . . . . . . . . . . . . . . . . . . 151.4.2 Phase vs. Addition. . . . . . . . . . . . . . . . . . . . 161.5 Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . 191.5.1 Whole Numbers and Integers . . . . . . . . . . . . . . 191.5.2 Rational Numbers . . . . . . . . . . . . . . . . . . . . 191.5.3 Irrational Numbers. . . . . . . . . . . . . . . . . . . . 191.5.4 Real Numbers . . . . . . . . . . . . . . . . . . . . . . . 20iCONTENTS ii1.5.5 Imaginary Numbers . . . . . . . . . . . . . . . . . . . 201.5.6 Complex numbers . . . . . . . . . . . . . . . . . . . . 211.5.7 Complex Math Part 1 Addition . . . . . . . . . . . . 211.5.8 Complex Math Part 2 Multiplication . . . . . . . . . 221.5.9 Complex Math Part 3 Some Identity Rules . . . . . 221.5.10 Complex Math Part 4 Inverse Rules . . . . . . . . . 241.5.11 Complex Conjugates . . . . . . . . . . . . . . . . . . . 251.5.12 Absolute Value (also known as the Modulus) . . . . . 261.5.13 Complex notation or... Who cares? . . . . . . . . . . . 271.6 Eulers Identity. . . . . . . . . . . . . . . . . . . . . . . . . . 311.6.1 Who cares? . . . . . . . . . . . . . . . . . . . . . . . . 321.7 Binary, Decimal and Hexadecimal . . . . . . . . . . . . . . . . 341.7.1 Decimal (Base 10) . . . . . . . . . . . . . . . . . . . . 341.7.2 Binary (Base 2) . . . . . . . . . . . . . . . . . . . . . . 351.7.3 Hexadecimal (Base 16) . . . . . . . . . . . . . . . . . . 371.7.4 Other Bases . . . . . . . . . . . . . . . . . . . . . . . . 401.8 Intuitive Calculus . . . . . . . . . . . . . . . . . . . . . . . . . 411.8.1 Function . . . . . . . . . . . . . . . . . . . . . . . . . . 411.8.2 Limit . . . . . . . . . . . . . . . . . . . . . . . . . . . 411.8.3 Derivation and Slope . . . . . . . . . . . . . . . . . . . 431.8.4 Sigma - . . . . . . . . . . . . . . . . . . . . . . . . . 481.8.5 Delta - . . . . . . . . . . . . . . . . . . . . . . . . . 481.8.6 Integration and Area. . . . . . . . . . . . . . . . . . . 481.8.7 Suggested Reading List . . . . . . . . . . . . . . . . . 532 AnalogElectronics 552.1 Basic Electrical Concepts . . . . . . . . . . . . . . . . . . . . 552.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 552.1.2 Current and EMF (Voltage) . . . . . . . . . . . . . . . 562.1.3 Resistance and Ohms Law . . . . . . . . . . . . . . . 582.1.4 Power and Watts Law. . . . . . . . . . . . . . . . . . 602.1.5 Alternating vs. Direct Current . . . . . . . . . . . . . 612.1.6 RMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622.1.7 Suggested Reading List . . . . . . . . . . . . . . . . . 682.2 The Decibel . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692.2.1 Gain. . . . . . . . . . . . . . . . . . . . . . . . . . . . 692.2.2 Power and Bels . . . . . . . . . . . . . . . . . . . . . 692.2.3 dBspl . . . . . . . . . . . . . . . . . . . . . . . . . . . 722.2.4 dBm. . . . . . . . . . . . . . . . . . . . . . . . . . . . 732.2.5 dBV. . . . . . . . . . . . . . . . . . . . . . . . . . . . 73CONTENTS iii2.2.6 dBu . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742.2.7 dB FS. . . . . . . . . . . . . . . . . . . . . . . . . . . 752.2.8 Addendum: Professional vs. Consumer Levels . . 752.2.9 The Summary . . . . . . . . . . . . . . . . . . . . . . 752.3 Basic Circuits / Series vs. Parallel . . . . . . . . . . . . . . . 772.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 772.3.2 Series circuits from the point of view of the current . 772.3.3 Series circuits from the point of view of the voltage 782.3.4 Parallel circuits from the point of view of the voltage 792.3.5 Parallel circuits from the point of view of the current 802.3.6 Suggested Reading List . . . . . . . . . . . . . . . . . 812.4 Capacitors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 822.4.1 Suggested Reading List . . . . . . . . . . . . . . . . . 882.5 Passive RC Filters . . . . . . . . . . . . . . . . . . . . . . . . 892.5.1 Another way to consider this... . . . . . . . . . . . . . 942.5.2 Suggested Reading List . . . . . . . . . . . . . . . . . 952.6 Electromagnetism . . . . . . . . . . . . . . . . . . . . . . . . . 962.6.1 Suggested Reading List . . . . . . . . . . . . . . . . . 992.7 Inductors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1002.7.1 Impedance . . . . . . . . . . . . . . . . . . . . . . . . 1062.7.2 RL Filters. . . . . . . . . . . . . . . . . . . . . . . . . 1072.7.3 Inductors in Series and Parallel . . . . . . . . . . . . . 1082.7.4 Inductors vs. Capacitors . . . . . . . . . . . . . . . . . 1082.7.5 Suggested Reading List . . . . . . . . . . . . . . . . . 1082.8 Transformers . . . . . . . . . . . . . . . . . . . . . . . . . . . 1092.8.1 Suggested Reading List . . . . . . . . . . . . . . . . . 1102.9 Diodes and Semiconductors . . . . . . . . . . . . . . . . . . . 1112.9.1 The geeky stu: . . . . . . . . . . . . . . . . . . . . . 1192.9.2 Zener Diodes . . . . . . . . . . . . . . . . . . . . . . . 1212.9.3 Suggested Reading List . . . . . . . . . . . . . . . . . 1232.10Rectiers and Power Supplies . . . . . . . . . . . . . . . . . . 1242.11Transistors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1312.11.1 Suggested Reading List . . . . . . . . . . . . . . . . . 1312.12Basic Transistor Circuits . . . . . . . . . . . . . . . . . . . . . 1322.12.1 Suggested Reading List . . . . . . . . . . . . . . . . . 1322.13Operational Ampliers. . . . . . . . . . . . . . . . . . . . . . 1332.13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 1332.13.2 Comparators . . . . . . . . . . . . . . . . . . . . . . . 1332.13.3 Inverting Amplier. . . . . . . . . . . . . . . . . . . . 1352.13.4 Non-Inverting Amplier . . . . . . . . . . . . . . . . . 137CONTENTS iv2.13.5 Voltage Follower . . . . . . . . . . . . . . . . . . . . . 1382.13.6 Leftovers . . . . . . . . . . . . . . . . . . . . . . . . . 1392.13.7 Mixing Amplier . . . . . . . . . . . . . . . . . . . . . 1392.13.8 Dierential Amplier . . . . . . . . . . . . . . . . . . . 1402.13.9 Suggested Reading List . . . . . . . . . . . . . . . . . 1402.14Op Amp Characteristics and Specications . . . . . . . . . . 1422.14.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 1422.14.2 Maximum Supply Voltage . . . . . . . . . . . . . . . . 1422.14.3 Maximum Dierential Input Voltage . . . . . . . . . . 1422.14.4 Output Short-Circuit Duration . . . . . . . . . . . . . 1422.14.5 Input Resistance . . . . . . . . . . . . . . . . . . . . . 1422.14.6 Common Mode Rejection Ratio (CMRR) . . . . . . . 1432.14.7 Input Voltage Range (Operating Common-Mode Range)1432.14.8 Output Voltage Swing . . . . . . . . . . . . . . . . . . 1432.14.9 Output Resistance . . . . . . . . . . . . . . . . . . . . 1432.14.10Open Loop Voltage Gain . . . . . . . . . . . . . . . . 1442.14.11Gain Bandwidth Product (GBP) . . . . . . . . . . . . 1442.14.12Slew Rate . . . . . . . . . . . . . . . . . . . . . . . . . 1442.14.13Suggested Reading List . . . . . . . . . . . . . . . . . 1452.15Practical Op Amp Applications . . . . . . . . . . . . . . . . . 1462.15.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 1462.15.2 Active Filters . . . . . . . . . . . . . . . . . . . . . . . 1462.15.3 Higher-order lters . . . . . . . . . . . . . . . . . . . . 1492.15.4 Bandpass lters . . . . . . . . . . . . . . . . . . . . . . 1502.15.5 Suggested Reading List . . . . . . . . . . . . . . . . . 1503 Acoustics 1513.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1513.1.1 Pressure. . . . . . . . . . . . . . . . . . . . . . . . . . 1513.1.2 Simple Harmonic Motion . . . . . . . . . . . . . . . . 1543.1.3 Damping . . . . . . . . . . . . . . . . . . . . . . . . . 1543.1.4 Harmonics . . . . . . . . . . . . . . . . . . . . . . . . . 1553.1.5 Overtones . . . . . . . . . . . . . . . . . . . . . . . . . 1573.1.6 Longitudinal vs. Transverse Waves . . . . . . . . . . . 1573.1.7 Displacement vs. Velocity . . . . . . . . . . . . . . . . 1593.1.8 Amplitude . . . . . . . . . . . . . . . . . . . . . . . . . 1603.1.9 Frequency and Period . . . . . . . . . . . . . . . . . . 1613.1.10 Angular frequency . . . . . . . . . . . . . . . . . . . . 1623.1.11 Negative Frequency . . . . . . . . . . . . . . . . . . . 1633.1.12 Speed of Sound. . . . . . . . . . . . . . . . . . . . . . 163CONTENTS v3.1.13 Wavelength . . . . . . . . . . . . . . . . . . . . . . . . 1643.1.14 Acoustic Wavenumber . . . . . . . . . . . . . . . . . . 1653.1.15 Wave Addition and Subtraction . . . . . . . . . . . . . 1653.1.16 Time vs. Frequency . . . . . . . . . . . . . . . . . . . 1693.1.17 Noise Spectra. . . . . . . . . . . . . . . . . . . . . . . 1703.1.18 Amplitude vs. Distance . . . . . . . . . . . . . . . . . 1723.1.19 Free Field. . . . . . . . . . . . . . . . . . . . . . . . . 1733.1.20 Diuse Field . . . . . . . . . . . . . . . . . . . . . . . 1743.1.21 Acoustic Impedance . . . . . . . . . . . . . . . . . . . 1753.1.22 Power . . . . . . . . . . . . . . . . . . . . . . . . . . . 1773.1.23 Intensity . . . . . . . . . . . . . . . . . . . . . . . . . . 1793.2 Acoustic Reection and Absorption . . . . . . . . . . . . . . . 1813.2.1 Acoustic Impedance . . . . . . . . . . . . . . . . . . . 1813.2.2 Reection and Transmission Coecients. . . . . . . . 1863.2.3 Absorption Coecient . . . . . . . . . . . . . . . . . . 1873.2.4 Comb Filtering Caused by a Specular Reection . . . 1883.2.5 Huygens Wave Theory . . . . . . . . . . . . . . . . . 1883.3 Specular and Diused Reections. . . . . . . . . . . . . . . . 1903.3.1 Specular Reections . . . . . . . . . . . . . . . . . . . 1903.3.2 Diused Reections . . . . . . . . . . . . . . . . . . . 1923.3.3 Reading List . . . . . . . . . . . . . . . . . . . . . . . 1993.4 Diraction of Sound Waves . . . . . . . . . . . . . . . . . . . 2003.4.1 Reading List . . . . . . . . . . . . . . . . . . . . . . . 2003.5 Struck and Plucked Strings . . . . . . . . . . . . . . . . . . . 2013.5.1 Travelling waves and reections. . . . . . . . . . . . . 2013.5.2 Standing waves (aka Resonant Frequencies) . . . . . . 2023.5.3 Impulse Response vs. Resonance . . . . . . . . . . . . 2063.5.4 Tuning the string . . . . . . . . . . . . . . . . . . . . . 2093.5.5 Harmonics in the real-world. . . . . . . . . . . . . . . 2113.5.6 Reading List . . . . . . . . . . . . . . . . . . . . . . . 2123.6 Waves in a Tube (Woodwind Instruments) . . . . . . . . . . . 2133.6.1 Waveguides . . . . . . . . . . . . . . . . . . . . . . . . 2133.6.2 Resonance in a closed pipe . . . . . . . . . . . . . . . 2133.6.3 Open Pipes . . . . . . . . . . . . . . . . . . . . . . . . 2193.6.4 Reading List . . . . . . . . . . . . . . . . . . . . . . . 2213.7 Helmholtz Resonators . . . . . . . . . . . . . . . . . . . . . . 2223.7.1 Reading List . . . . . . . . . . . . . . . . . . . . . . . 2253.8 Characteristics of a Vibrating Surface . . . . . . . . . . . . . 2263.8.1 Reading List . . . . . . . . . . . . . . . . . . . . . . . 2263.9 Woodwind Instruments . . . . . . . . . . . . . . . . . . . . . 228CONTENTS vi3.9.1 Reading List . . . . . . . . . . . . . . . . . . . . . . . 2283.10Brass Instruments . . . . . . . . . . . . . . . . . . . . . . . . 2293.10.1 Reading List . . . . . . . . . . . . . . . . . . . . . . . 2293.11Bowed Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . 2303.11.1 Reading List . . . . . . . . . . . . . . . . . . . . . . . 2323.12Percussion Instruments . . . . . . . . . . . . . . . . . . . . . . 2333.12.1 Reading List . . . . . . . . . . . . . . . . . . . . . . . 2333.13Vocal Sound Production. . . . . . . . . . . . . . . . . . . . . 2343.13.1 Reading List . . . . . . . . . . . . . . . . . . . . . . . 2343.14Directional Characteristics of Instruments . . . . . . . . . . . 2353.14.1 Reading List . . . . . . . . . . . . . . . . . . . . . . . 2353.15Pitch and Tuning Systems. . . . . . . . . . . . . . . . . . . . 2363.15.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 2363.15.2 Pythagorean Temperament . . . . . . . . . . . . . . . 2373.15.3 Just Temperament . . . . . . . . . . . . . . . . . . . . 2393.15.4 Meantone Temperaments . . . . . . . . . . . . . . . . 2413.15.5 Equal Temperament . . . . . . . . . . . . . . . . . . . 2413.15.6 Cents . . . . . . . . . . . . . . . . . . . . . . . . . . . 2423.15.7 Suggested Reading List . . . . . . . . . . . . . . . . . 2433.16Room Acoustics Reections, Resonance and Reverberation 2443.16.1 Early Reections . . . . . . . . . . . . . . . . . . . . . 2443.16.2 Reverberation . . . . . . . . . . . . . . . . . . . . . . . 2473.16.3 Resonance and Room Modes . . . . . . . . . . . . . . 2503.16.4 Schroeder frequency . . . . . . . . . . . . . . . . . . . 2533.16.5 Room Radius (aka Critical Distance) . . . . . . . . . . 2533.16.6 Reading List . . . . . . . . . . . . . . . . . . . . . . . 2543.17Sound Transmission . . . . . . . . . . . . . . . . . . . . . . . 2553.17.1 Airborne sound. . . . . . . . . . . . . . . . . . . . . . 2553.17.2 Impact noise . . . . . . . . . . . . . . . . . . . . . . . 2553.17.3 Reading List . . . . . . . . . . . . . . . . . . . . . . . 2553.18Desirable Characteristics of Rooms and Halls . . . . . . . . . 2563.18.1 Reading List . . . . . . . . . . . . . . . . . . . . . . . 2564 Physiologicalacoustics,psychoacousticsandperception 2574.1 Whats the dierence? . . . . . . . . . . . . . . . . . . . . . . 2574.2 How your ears work . . . . . . . . . . . . . . . . . . . . . . . 2594.2.1 Head Related Transfer Functions (HRTFs) . . . . . . 2624.2.2 Suggested Reading List . . . . . . . . . . . . . . . . . 2644.3 Human Response Characteristics . . . . . . . . . . . . . . . . 2654.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 265CONTENTS vii4.3.2 Frequency Range. . . . . . . . . . . . . . . . . . . . . 2654.3.3 Dynamic Range . . . . . . . . . . . . . . . . . . . . . . 2654.4 Loudness, Part 1 . . . . . . . . . . . . . . . . . . . . . . . . . 2674.4.1 Threshold of Hearing . . . . . . . . . . . . . . . . . . . 2674.4.2 Phons . . . . . . . . . . . . . . . . . . . . . . . . . . . 2694.5 Weighting Curves . . . . . . . . . . . . . . . . . . . . . . . . . 2704.6 Masking and Critical Bands . . . . . . . . . . . . . . . . . . . 2724.7 Loudness, Part 2 . . . . . . . . . . . . . . . . . . . . . . . . . 2764.7.1 Sones . . . . . . . . . . . . . . . . . . . . . . . . . . . 2764.8 Localization. . . . . . . . . . . . . . . . . . . . . . . . . . . . 2774.8.1 Cone of Confusion . . . . . . . . . . . . . . . . . . . . 2784.8.2 Suggested Reading List . . . . . . . . . . . . . . . . . 2784.9 Precedence Eect. . . . . . . . . . . . . . . . . . . . . . . . . 2794.10Distance Perception . . . . . . . . . . . . . . . . . . . . . . . 2804.10.1 Reection patterns . . . . . . . . . . . . . . . . . . . . 2804.10.2 Direct-to-reverberant ratio . . . . . . . . . . . . . . . 2804.10.3 Sound pressure level . . . . . . . . . . . . . . . . . . . 2814.10.4 High-frequency content . . . . . . . . . . . . . . . . . 2814.10.5 Suggested Reading List . . . . . . . . . . . . . . . . . 2814.11Perception of sound qualities . . . . . . . . . . . . . . . . . . 2824.11.1 Suggested Reading List . . . . . . . . . . . . . . . . . 2824.12Listening tests . . . . . . . . . . . . . . . . . . . . . . . . . . 2844.12.1 A short mis-informed history . . . . . . . . . . . . . . 2844.12.2 Filter model . . . . . . . . . . . . . . . . . . . . . . . . 2854.12.3 Variables . . . . . . . . . . . . . . . . . . . . . . . . . 2874.12.4 Psychometric function . . . . . . . . . . . . . . . . . . 2874.12.5 Scaling methods . . . . . . . . . . . . . . . . . . . . . 2874.12.6 Hedonic tests . . . . . . . . . . . . . . . . . . . . . . . 2884.12.7 Non-hedonic tests . . . . . . . . . . . . . . . . . . . . 2894.12.8 Types of subjects . . . . . . . . . . . . . . . . . . . . . 2894.12.9 The standard test types . . . . . . . . . . . . . . . . . 2904.12.10Testing for stimulus attributes . . . . . . . . . . . . . 2984.12.11Randomization . . . . . . . . . . . . . . . . . . . . . . 3024.12.12Analysis. . . . . . . . . . . . . . . . . . . . . . . . . . 3024.12.13Common pitfalls . . . . . . . . . . . . . . . . . . . . . 3034.12.14Suggested Reading List . . . . . . . . . . . . . . . . . 303CONTENTS viii5 Electroacoustics 3055.1 Filters and Equalizers . . . . . . . . . . . . . . . . . . . . . . 3055.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 3055.1.2 Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . 3065.1.3 Equalizers. . . . . . . . . . . . . . . . . . . . . . . . . 3125.1.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . 3225.1.5 Phase response . . . . . . . . . . . . . . . . . . . . . . 3225.1.6 Applications . . . . . . . . . . . . . . . . . . . . . . . 3265.1.7 Spectral sculpting . . . . . . . . . . . . . . . . . . . . 3265.1.8 Loudness . . . . . . . . . . . . . . . . . . . . . . . . . 3285.1.9 Noise Reduction . . . . . . . . . . . . . . . . . . . . . 3295.1.10 Dynamic Equalization . . . . . . . . . . . . . . . . . . 3305.1.11 Further reading. . . . . . . . . . . . . . . . . . . . . . 3315.2 Compressors, Limiters, Expanders and Gates . . . . . . . . . 3325.2.1 What a compressor does. . . . . . . . . . . . . . . . . 3325.2.2 How compressors compress . . . . . . . . . . . . . . . 3505.2.3 Suggested Reading List . . . . . . . . . . . . . . . . . 3595.3 Analog Tape . . . . . . . . . . . . . . . . . . . . . . . . . . . 3605.3.1 Suggested Reading List . . . . . . . . . . . . . . . . . 3605.4 Noise Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . 3615.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 3615.4.2 EMI Transmission . . . . . . . . . . . . . . . . . . . . 3615.4.3 Suggested Reading List . . . . . . . . . . . . . . . . . 3635.5 Reducing Noise Shielding, Balancing and Grounding . . . . 3645.5.1 Shielding . . . . . . . . . . . . . . . . . . . . . . . . . 3645.5.2 Balanced transmission lines . . . . . . . . . . . . . . . 3645.5.3 Grounding . . . . . . . . . . . . . . . . . . . . . . . . 3665.5.4 Suggested Reading List . . . . . . . . . . . . . . . . . 3705.6 Microphones Transducer type . . . . . . . . . . . . . . . . . 3725.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 3725.6.2 Dynamic Microphones . . . . . . . . . . . . . . . . . . 3725.6.3 Condenser Microphones . . . . . . . . . . . . . . . . . 3785.6.4 RF Condenser Microphones . . . . . . . . . . . . . . . 3785.6.5 Suggested Reading List . . . . . . . . . . . . . . . . . 3785.7 Microphones Directional Characteristics . . . . . . . . . . . 3795.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 3795.7.2 Pressure Transducers . . . . . . . . . . . . . . . . . . . 3795.7.3 Pressure Gradient Transducers . . . . . . . . . . . . . 3855.7.4 Combinations of Pressure and Pressure Gradient . . . 3905.7.5 General Sensitivity Equation . . . . . . . . . . . . . . 392CONTENTS ix5.7.6 Do-It-Yourself Polar Patterns . . . . . . . . . . . . . . 3985.7.7 The Inuence of Polar Pattern on Frequency Response4015.7.8 Proximity Eect . . . . . . . . . . . . . . . . . . . . . 4055.7.9 Acceptance Angle . . . . . . . . . . . . . . . . . . . . 4085.7.10 Random-Energy Response (RER) . . . . . . . . . . . . 4085.7.11 Random-Energy Eciency (REE) . . . . . . . . . . . 4095.7.12 Directivity Factor (DRF) . . . . . . . . . . . . . . . . 4115.7.13 Distance Factor (DSF). . . . . . . . . . . . . . . . . . 4135.7.14 Variable Pattern Microphones . . . . . . . . . . . . . . 4155.7.15 Suggested Reading List . . . . . . . . . . . . . . . . . 4155.8 Loudspeakers Transducer type . . . . . . . . . . . . . . . . 4175.8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 4175.8.2 Ribbon Loudspeakers . . . . . . . . . . . . . . . . . . 4175.8.3 Moving Coil Loudspeakers . . . . . . . . . . . . . . . . 4195.8.4 Electrostatic Loudspeakers . . . . . . . . . . . . . . . 4235.9 Loudspeaker acoustics . . . . . . . . . . . . . . . . . . . . . . 4285.9.1 Enclosures . . . . . . . . . . . . . . . . . . . . . . . . . 4285.9.2 Other Issues . . . . . . . . . . . . . . . . . . . . . . . . 4365.10Power Ampliers . . . . . . . . . . . . . . . . . . . . . . . . . 4415.10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 4416 ElectroacousticMeasurements 4436.1 Tools of the Trade . . . . . . . . . . . . . . . . . . . . . . . . 4436.1.1 Digital Multimeter . . . . . . . . . . . . . . . . . . . . 4436.1.2 True RMS Meter . . . . . . . . . . . . . . . . . . . . . 4466.1.3 Oscilloscope . . . . . . . . . . . . . . . . . . . . . . . . 4476.1.4 Function Generators . . . . . . . . . . . . . . . . . . . 4526.1.5 Automated Testing Equipment . . . . . . . . . . . . . 4546.1.6 Swept Sine Tone . . . . . . . . . . . . . . . . . . . . . 4546.1.7 MLS-Based Measurements . . . . . . . . . . . . . . . . 4546.1.8 Suggested Reading List . . . . . . . . . . . . . . . . . 4576.2 Electrical Measurements . . . . . . . . . . . . . . . . . . . . . 4596.2.1 Output impedance . . . . . . . . . . . . . . . . . . . . 4596.2.2 Input Impedance . . . . . . . . . . . . . . . . . . . . . 4596.2.3 Gain. . . . . . . . . . . . . . . . . . . . . . . . . . . . 4606.2.4 Gain Linearity . . . . . . . . . . . . . . . . . . . . . . 4606.2.5 Frequency Response . . . . . . . . . . . . . . . . . . . 4616.2.6 Bandwidth . . . . . . . . . . . . . . . . . . . . . . . . 4616.2.7 Phase Response . . . . . . . . . . . . . . . . . . . . . . 4616.2.8 Group Delay . . . . . . . . . . . . . . . . . . . . . . . 462CONTENTS x6.2.9 Slew Rate . . . . . . . . . . . . . . . . . . . . . . . . . 4636.2.10 Maximum Output . . . . . . . . . . . . . . . . . . . . 4636.2.11 Noise measurements . . . . . . . . . . . . . . . . . . . 4646.2.12 Dynamic Range . . . . . . . . . . . . . . . . . . . . . . 4656.2.13 Signal to Noise Ratio (SNR or S/N Ratio) . . . . . . . 4656.2.14 Equivalent Input Noise (EIN). . . . . . . . . . . . . . 4656.2.15 Common Mode Rejection Ratio (CMRR) . . . . . . . 4666.2.16 Total Harmonic Distortion (THD) . . . . . . . . . . . 4676.2.17 Total Harmonic Distortion + Noise (THD+N) . . . . 4686.2.18 Crosstalk . . . . . . . . . . . . . . . . . . . . . . . . . 4696.2.19 Intermodulation Distortion (IMD) . . . . . . . . . . . 4696.2.20 DC Oset . . . . . . . . . . . . . . . . . . . . . . . . . 4696.2.21 Filter Q. . . . . . . . . . . . . . . . . . . . . . . . . . 4696.2.22 Impulse Response . . . . . . . . . . . . . . . . . . . . 4696.2.23 Cross-correlation . . . . . . . . . . . . . . . . . . . . . 4696.2.24 Interaural Cross-correlation . . . . . . . . . . . . . . . 4696.2.25 Suggested Reading List . . . . . . . . . . . . . . . . . 4696.3 Loudspeaker Measurements . . . . . . . . . . . . . . . . . . . 4706.3.1 Frequency Response . . . . . . . . . . . . . . . . . . . 4716.3.2 Phase Response . . . . . . . . . . . . . . . . . . . . . . 4716.3.3 Distortion. . . . . . . . . . . . . . . . . . . . . . . . . 4716.3.4 O-Axis Response . . . . . . . . . . . . . . . . . . . . 4716.3.5 Power Response . . . . . . . . . . . . . . . . . . . . . 4716.3.6 Impedance Curve . . . . . . . . . . . . . . . . . . . . . 4716.3.7 Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . 4716.3.8 Suggested Reading List . . . . . . . . . . . . . . . . . 4716.4 Microphone Measurements . . . . . . . . . . . . . . . . . . . . 4726.4.1 Polar Pattern. . . . . . . . . . . . . . . . . . . . . . . 4726.4.2 Frequency Response . . . . . . . . . . . . . . . . . . . 4726.4.3 Phase Response . . . . . . . . . . . . . . . . . . . . . . 4726.4.4 O-Axis Response . . . . . . . . . . . . . . . . . . . . 4726.4.5 Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . 4726.4.6 Equivalent Noise Level. . . . . . . . . . . . . . . . . . 4726.4.7 Impedance . . . . . . . . . . . . . . . . . . . . . . . . 4726.4.8 Suggested Reading List . . . . . . . . . . . . . . . . . 4726.5 Acoustical Measurements . . . . . . . . . . . . . . . . . . . . 4736.5.1 Room Modes . . . . . . . . . . . . . . . . . . . . . . . 4736.5.2 Reections . . . . . . . . . . . . . . . . . . . . . . . . 4736.5.3 Reection and Absorbtion Coecients . . . . . . . . . 4736.5.4 Reverberation Time (RT60). . . . . . . . . . . . . . . 473CONTENTS xi6.5.5 Noise Level . . . . . . . . . . . . . . . . . . . . . . . . 4736.5.6 Sound Transmission . . . . . . . . . . . . . . . . . . . 4736.5.7 Intelligibility . . . . . . . . . . . . . . . . . . . . . . . 4736.5.8 Suggested Reading List . . . . . . . . . . . . . . . . . 4737 DigitalAudio 4757.1 How to make a (PCM) digital signal . . . . . . . . . . . . . . 4757.1.1 The basics of analog to digital conversion . . . . . . . 4757.1.2 The basics of digital to analog conversion . . . . . . . 4797.1.3 Aliasing . . . . . . . . . . . . . . . . . . . . . . . . . . 4797.1.4 Binary numbers and bits . . . . . . . . . . . . . . . . 4837.1.5 Twos complement . . . . . . . . . . . . . . . . . . . . 4837.1.6 Suggested Reading List . . . . . . . . . . . . . . . . . 4847.2 Quantization Error and Dither . . . . . . . . . . . . . . . . . 4867.2.1 Dither . . . . . . . . . . . . . . . . . . . . . . . . . . . 4917.2.2 When to use dither . . . . . . . . . . . . . . . . . . . . 4987.2.3 Suggested Reading List . . . . . . . . . . . . . . . . . 4997.3 Aliasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5007.3.1 Antialiasing lters . . . . . . . . . . . . . . . . . . . . 5007.3.2 Suggested Reading List . . . . . . . . . . . . . . . . . 5007.4 Advanced A/D and D/A conversion . . . . . . . . . . . . . . 5057.4.1 Suggested Reading List . . . . . . . . . . . . . . . . . 5057.5 Digital Signal Transmission Protocols . . . . . . . . . . . . . 5067.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 5067.5.2 Whats being sent?. . . . . . . . . . . . . . . . . . . . 5077.5.3 Some more info about AES/EBU. . . . . . . . . . . . 5107.5.4 S/PDIF. . . . . . . . . . . . . . . . . . . . . . . . . . 5127.5.5 Some Terms That You Should Know... . . . . . . . . . 5127.5.6 Jitter . . . . . . . . . . . . . . . . . . . . . . . . . . . 5137.5.7 Suggested Reading List . . . . . . . . . . . . . . . . . 5137.6 Jitter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5157.6.1 When to worry about jitter . . . . . . . . . . . . . . . 5167.6.2 What causes jitter, and how to reduce it . . . . . . . . 5167.6.3 Suggested Reading List . . . . . . . . . . . . . . . . . 5167.7 Fixed- vs. Floating Point . . . . . . . . . . . . . . . . . . . . 5177.7.1 Fixed Point . . . . . . . . . . . . . . . . . . . . . . . . 5177.7.2 Floating Point . . . . . . . . . . . . . . . . . . . . . . 5207.7.3 Comparison Between Systems. . . . . . . . . . . . . . 5247.7.4 Conversion Between Systems . . . . . . . . . . . . . . 5247.7.5 Suggested Reading List . . . . . . . . . . . . . . . . . 525CONTENTS xii7.8 Noise Shaping . . . . . . . . . . . . . . . . . . . . . . . . . . . 5267.8.1 Suggested Reading List . . . . . . . . . . . . . . . . . 5267.9 High-Resolution Audio . . . . . . . . . . . . . . . . . . . . 5277.9.1 What is High-Resolution Audio? . . . . . . . . . . 5287.9.2 Wither High-Resolution audio? . . . . . . . . . . . . . 5297.9.3 Is it worth it?. . . . . . . . . . . . . . . . . . . . . . . 5337.9.4 Suggested Reading List . . . . . . . . . . . . . . . . . 5337.10Perceptual Coding . . . . . . . . . . . . . . . . . . . . . . . . 5347.10.1 History . . . . . . . . . . . . . . . . . . . . . . . . . . 5347.10.2 ATRAC. . . . . . . . . . . . . . . . . . . . . . . . . . 5347.10.3 PASC . . . . . . . . . . . . . . . . . . . . . . . . . . . 5347.10.4 Dolby . . . . . . . . . . . . . . . . . . . . . . . . . . . 5347.10.5 MPEG . . . . . . . . . . . . . . . . . . . . . . . . . . . 5347.10.6 MLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5347.10.7 Suggested Reading List . . . . . . . . . . . . . . . . . 5357.11Transmission Techniques for Internet Distribution . . . . . . 5367.11.1 Suggested Reading List . . . . . . . . . . . . . . . . . 5367.12CD Compact Disc . . . . . . . . . . . . . . . . . . . . . . . 5377.12.1 Sampling rate . . . . . . . . . . . . . . . . . . . . . . . 5377.12.2 Word length . . . . . . . . . . . . . . . . . . . . . . . 5387.12.3 Storage capacity (recording time) . . . . . . . . . . . . 5397.12.4 Physical construction . . . . . . . . . . . . . . . . . . 5397.12.5 Eight-to-Fourteen Modulation (EFM) . . . . . . . . . 5407.12.6 Suggested Reading List . . . . . . . . . . . . . . . . . 5447.13DVD-Audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5457.13.1 Suggested Reading List . . . . . . . . . . . . . . . . . 5457.14SACD and DSD . . . . . . . . . . . . . . . . . . . . . . . . . 5467.14.1 Suggested Reading List . . . . . . . . . . . . . . . . . 5467.15Hard Disk Recording . . . . . . . . . . . . . . . . . . . . . . 5477.15.1 Bandwidth and disk space. . . . . . . . . . . . . . . . 5477.15.2 Suggested Reading List . . . . . . . . . . . . . . . . . 5487.16Digital Audio File Formats . . . . . . . . . . . . . . . . . . . 5497.16.1 AIFF . . . . . . . . . . . . . . . . . . . . . . . . . . . 5497.16.2 WAV . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5497.16.3 SDII . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5497.16.4 mu-law . . . . . . . . . . . . . . . . . . . . . . . . . . 5497.16.5 Suggested Reading List . . . . . . . . . . . . . . . . . 549CONTENTS xiii8 DigitalSignalProcessing 5518.1 Introduction to DSP. . . . . . . . . . . . . . . . . . . . . . . 5518.1.1 Block Diagrams and Notation. . . . . . . . . . . . . . 5528.1.2 Normalized Frequency . . . . . . . . . . . . . . . . . . 5538.1.3 Suggested Reading List . . . . . . . . . . . . . . . . . 5548.2 FFTs, DFTsandtheRelationshipBetweentheTimeandFrequency Domains . . . . . . . . . . . . . . . . . . . . . . . . 5558.2.1 Fourier in a Nutshell . . . . . . . . . . . . . . . . . . . 5558.2.2 Discrete Fourier Transforms. . . . . . . . . . . . . . . 5588.2.3 A couple of more details on detail . . . . . . . . . . . 5638.2.4 Redundancy in the DFT Result . . . . . . . . . . . . . 5648.2.5 Whats the use? . . . . . . . . . . . . . . . . . . . . . 5658.2.6 Suggested Reading List . . . . . . . . . . . . . . . . . 5658.3 Windowing Functions . . . . . . . . . . . . . . . . . . . . . . 5668.3.1 Rectangular. . . . . . . . . . . . . . . . . . . . . . . . 5728.3.2 Hanning. . . . . . . . . . . . . . . . . . . . . . . . . . 5748.3.3 Hamming . . . . . . . . . . . . . . . . . . . . . . . . . 5768.3.4 Comparisons . . . . . . . . . . . . . . . . . . . . . . . 5788.3.5 Suggested Reading List . . . . . . . . . . . . . . . . . 5798.4 FIR Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5808.4.1 Comb Filters . . . . . . . . . . . . . . . . . . . . . . . 5808.4.2 Frequency Response Deviation . . . . . . . . . . . . . 5868.4.3 Impulse Response vs. Frequency Response . . . . . . . 5888.4.4 More complicated lters . . . . . . . . . . . . . . . . . 5898.4.5 Suggested Reading List . . . . . . . . . . . . . . . . . 5908.5 IIR Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5918.5.1 Comb Filters . . . . . . . . . . . . . . . . . . . . . . . 5918.5.2 Danger! . . . . . . . . . . . . . . . . . . . . . . . . . . 5958.5.3 Biquadratic . . . . . . . . . . . . . . . . . . . . . . . . 5958.5.4 Allpass lters . . . . . . . . . . . . . . . . . . . . . . . 6018.5.5 Suggested Reading List . . . . . . . . . . . . . . . . . 6028.6 Convolution. . . . . . . . . . . . . . . . . . . . . . . . . . . . 6038.6.1 Correlation . . . . . . . . . . . . . . . . . . . . . . . . 6098.6.2 Autocorrelation . . . . . . . . . . . . . . . . . . . . . . 6098.6.3 Suggested Reading List . . . . . . . . . . . . . . . . . 6098.7 The z-domain. . . . . . . . . . . . . . . . . . . . . . . . . . . 6108.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 6108.7.2 Filter frequency response . . . . . . . . . . . . . . . . 6118.7.3 The z-plane . . . . . . . . . . . . . . . . . . . . . . . . 6148.7.4 Transfer function. . . . . . . . . . . . . . . . . . . . . 615CONTENTS xiv8.7.5 Calculating lters as polynomials. . . . . . . . . . . . 6188.7.6 Zeros . . . . . . . . . . . . . . . . . . . . . . . . . . . 6198.7.7 Poles . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6268.7.8 Suggested Reading List . . . . . . . . . . . . . . . . . 6318.8 Digital Reverberation . . . . . . . . . . . . . . . . . . . . . . 6328.8.1 Warning. . . . . . . . . . . . . . . . . . . . . . . . . . 6328.8.2 History . . . . . . . . . . . . . . . . . . . . . . . . . . 6328.8.3 Suggested Reading List . . . . . . . . . . . . . . . . . 6449 AudioRecording 6459.1 Levels and Metering . . . . . . . . . . . . . . . . . . . . . . . 6459.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 6459.1.2 Digital Gear in the PCM World . . . . . . . . . . . . . 6489.1.3 Analog electronics . . . . . . . . . . . . . . . . . . . . 6509.1.4 Analog tape . . . . . . . . . . . . . . . . . . . . . . . . 6519.1.5 Meters. . . . . . . . . . . . . . . . . . . . . . . . . . . 6539.1.6 Gain Management . . . . . . . . . . . . . . . . . . . . 6709.1.7 Phase and Correlation Meters . . . . . . . . . . . . . . 6709.1.8 Suggested Reading List . . . . . . . . . . . . . . . . . 6709.2 Monitoring Conguration and Calibration . . . . . . . . . . . 6739.2.1 Standard operating levels . . . . . . . . . . . . . . . . 6739.2.2 Channels are not Loudspeakers . . . . . . . . . . . . . 6749.2.3 Bass management . . . . . . . . . . . . . . . . . . . . 6759.2.4 Conguration. . . . . . . . . . . . . . . . . . . . . . . 6779.2.5 Calibration . . . . . . . . . . . . . . . . . . . . . . . . 6869.2.6 Monitoring system equalization. . . . . . . . . . . . . 6929.2.7 Suggested Reading List . . . . . . . . . . . . . . . . . 6929.3 Introduction to Stereo Microphone Technique . . . . . . . . . 6939.3.1 Panning . . . . . . . . . . . . . . . . . . . . . . . . . . 6939.3.2 Coincident techniques (X-Y) . . . . . . . . . . . . . . 6949.3.3 Spaced techniques (A-B) . . . . . . . . . . . . . . . . . 6999.3.4 Near-coincident techniques . . . . . . . . . . . . . . . 6999.3.5 More complicated techniques . . . . . . . . . . . . . . 7019.3.6 Suggested Reading List . . . . . . . . . . . . . . . . . 7029.4 General Response Characteristics of Microphone Pairs . . . . 7049.4.1 Phantom Images Revisited . . . . . . . . . . . . . . . 7049.4.2 Interchannel Dierences . . . . . . . . . . . . . . . . . 7089.4.3 Summed power response. . . . . . . . . . . . . . . . . 7449.4.4 Correlation . . . . . . . . . . . . . . . . . . . . . . . . 7659.4.5 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . 777CONTENTS xv9.5 Matrixed Microphone Techniques . . . . . . . . . . . . . . . . 7799.5.1 MS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7799.5.2 Ambisonics . . . . . . . . . . . . . . . . . . . . . . . . 7869.5.3 Suggested Reading List . . . . . . . . . . . . . . . . . 7999.6 Introduction to Surround Microphone Technique . . . . . . . 8009.6.1 Advantages to Surround. . . . . . . . . . . . . . . . . 8009.6.2 Common pitfalls . . . . . . . . . . . . . . . . . . . . . 8029.6.3 Fukada Tree . . . . . . . . . . . . . . . . . . . . . . . . 8069.6.4 OCT Surround . . . . . . . . . . . . . . . . . . . . . . 8079.6.5 OCT Front System + IRT Cross . . . . . . . . . . . . 8079.6.6 OCT Front System + Hamasaki Square . . . . . . . . 8099.6.7 Klepko Technique . . . . . . . . . . . . . . . . . . . . 8099.6.8 Corey / Martin Tree . . . . . . . . . . . . . . . . . . . 8109.6.9 Michael Williams. . . . . . . . . . . . . . . . . . . . . 8139.6.10 Suggested Reading List . . . . . . . . . . . . . . . . . 8139.7 Introduction to Time Code . . . . . . . . . . . . . . . . . . . 8149.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . 8149.7.2 Frame Rates . . . . . . . . . . . . . . . . . . . . . . . 8149.7.3 How to Count in Time Code . . . . . . . . . . . . . . 8169.7.4 SMPTE/EBU Time Code Formats . . . . . . . . . . . 8169.7.5 Time Code Encoding . . . . . . . . . . . . . . . . . . . 8219.7.6 Annex Time Code Bit Assignments . . . . . . . . . 8289.7.7 Suggested Reading List . . . . . . . . . . . . . . . . . 83310 ConclusionsandOpinions 83510.0.8 Suggested Reading List . . . . . . . . . . . . . . . . . 83611 ReferenceInformation 83711.1ISO Frequency Centres . . . . . . . . . . . . . . . . . . . . . . 83711.2Scientic Notation and Prexes . . . . . . . . . . . . . . . . . 83911.2.1 Scientic notation . . . . . . . . . . . . . . . . . . . . 83911.2.2 Prexes . . . . . . . . . . . . . . . . . . . . . . . . . . 83911.3Resistor Colour Codes . . . . . . . . . . . . . . . . . . . . . . 84112 Hintsandtips 843CONTENTS xviOpeningmaterials0.1 PrefaceOnce upon a time I went to McGill University to try to get into the Mastersprogram in sound recording at the Faculty of Music. In order to accomplishthistask, studentsarerequiredtodoaqualifyingyearof introductorycourses (althoughit felt morelikeobstaclecourses...) toseewhoreallywantstogetintheprogram. Lookingback, thereisnoquestionthatIlearnedmoreinthat year thaninanyother singleyear of mylife. Inparticular, two memories stand out.OnewasmyprofessoraguynamedPeterCookwhonowworksatthe CBC in Toronto as a digital editor. Peter is one of those teachers whodoesnt know everything,and doesnt pretend to know everything but ifyou ask him a question about something he doesnt understand, hell showupatthenextweeksclasswithareadinglistwheretheanswertoyourquestioncanbefound. Thatkindof enthusiasminateachercannotbereplaced by any other quality. I denitely wouldnt have gotten as much outofthatyearwithouthim. AgoodpieceofadvicethatIrecentlyreadforuniversity students is that you dont choose courses, you choose professors.The second thing was a book by John Woram called the Sound RecordingHandbook(the1989edition). Thisbooknotonlyprovedtobethemostamazing introduction to sound recording for a novice idiot like myself, butit continued to be the most used book on my shelf for the following 10 years.In fact,I was still using it as a primary reference when I was studying formydoctoral comprehensives10yearslater. Regrettably, thatbookisnolonger in print so if you can nd a copy (remember the 1989 edition...no other...)buy (or steal) it and guard it with your life.Since then, I have seen a lot of students go through various stages of be-coming a recording engineer at McGill and in other places and Ive lamentedthelackofadecently-pricedbutacademicallyvaluabletextbookforthesepeople. Therehavebeenacoupleofbooksthathavehitthemarket, butxvii0.Openingmaterials xviiitheyre either too thin, too full of errors, too simplistic or too expensive. (Iwont name any names here, but if you ask me in person, Ill tell you...)This is why Im writing this book. From the beginning, I intended it tobe freely accessible to anyone that was interested enough to read it. I cantguarantee that its completely free of errors so if you nd any, please letmeknowandIllmaketheappropriatecorrectionsassoonasIcan. Thetoneof thisbookisprettycolloquial thatsintentional Imtryingtomake the concepts presented here as accessible as possible without reducingthe level of the content, so it can make a good introduction that covers a lotofground. Illadmitthatitdoesntmakeagreatreferencebecausethereare too many analogies and stories in here essentially too low a signal tonoise ratio to make a decent book for someone that already understands theconcepts.Note that the book isnt done yet in fact, in keeping with everythingelseyoull ndontheweb, itwill probablyneverbenished. Youll ndmany places where Ive made notes to myself on what will be added where.Also, theres a couple of explanations in here that dont make much sense even to me... so theyll get xed later. Finally, there are a lot of referencesmissing. These will be added in the next update I promise...If youthinkthatIveleftanyimportantsubjectsoutof theTableofContents, please let me know by email at [email protected] xix0.2 ThanksTherearea lotofpeopletothankforhelping meoutwiththisproject. Ihave to start with a big thanks to Peter Cook for getting me started on theright track in the rst place. To Wieslaw Woszczyk for allowing me to teachcourses at McGill back when I was still just a novice idiot the best way tolearn something is to have to teach it to someone else. To Alain Terriault,Gilbert Soulodre and Michel Lavoie for answering my dumb questions aboutelectronics when I was just starting to get the hang of exactly what thingslike a capacitor or an op amp do in a circuit. To Brian Sarvis and KyprosChristodoulideswhowerepatientenoughtoputupwithmysubsequentdumbquestionsregardingwhatthingslikediodesandtransistorsdoinacircuit. ToJasonCoreyfor puttingupwithmerunningdownmanyawrongtracklookingforanswerstosomeof thequestionsfoundinhere.ToMarkBalloraforpatientlyansweringquestionsaboutDSPandtrying(unsuccessfully) to get me to understand Shakespeare. Finally to PhilippeDepalleonceuponatimeIwastakingacourseinDSPfordummiesatMcGill and, abouttwo-thirdsof thewaythroughthesemester, Philippeguest-taughtforoneclass. Inthatclass, I wounduptakingmorenotesthanIhadforall classesinthepreviouspartof thesemestercombined.Sincethen, Philippecametobeafull-timefacultyatMcGill andI wasluckyenoughtohavehimasathesisadvisor. Basically, whenIhaveanyquestions about anything, Philippe is the person I ask.Ialsohavetothankanumberof peoplewhohaveproofreadsomeofthe stu youll nd here and have oered assistance and corrections eitherwithorwithoutbeingasked. Inalphabetical order, thesefolksareBruceBartlett, Peter Cook, Goran Finnberg, John La Grou, George Massenburg,Bert Noeth, Ray Rayburn, Eberhard Sengpiel and Greg Simmons.Also on the list of thanks are people who have given permission to usetheirmaterials. ThankstoClaudiaHaaseandThomasLischkeratRTWRadio-Technische(www.rtw.de)fortheirkindpermissiontousegraphicsfrom their product line for the section on levels and meters. Also to GeorgeMassenburg(www.massenburg.com)forpermissiontoduplicateachapterfrom the GML manual on equalizers that I wrote for him.There are also a large number of people who have emailed me, either toask questions about things that I didnt explain well enough the rst time,or to make suggestions regarding additions to the book. Ill list those peoplein a later update of the text but thanks to you if youre in that group.Finally,thanks to Jonathan Sheaer and The Jordan Valley AcademicCollege (www.yarden.ac.il) for hosting the space to put this le for now.0.Openingmaterials xx0.3 AutobiographyJustincaseyourewonderingWhodoesthisguythinkheis? Ill tellyou... This is the bio I usually send out when someone asks me for one. Itsreasonably up-to-date.Originally from St. Johns, Newfoundland, Geo Martin completed hisB.Mus. inpipeorganatMemorial Universityof Newfoundlandin1990.He is a graduate of McGills Masters program in Sound Recording and, in2001, hecompletedhisdoctoral studiesinwhichhedevelopedamethodof simulatingreectionsfromquadraticresiduediusersformultichannelvirtual acoustic environments.Following completion of his doctorate, Geo was a Faculty Lecturer forMcGillsMusicTechnologyarea, wherehetaughtcoursesinnewmedia,electronics,andelectroacoustics. Inaddition,hewasamemberofthede-velopmentteamforMcGillsnewCentreforInterdisciplinaryResearchinMusic Media and Technology (CIRMMT). He taught electroacoustic musiccompositionandconductedthecontemporarymusicensembleattheUni-versity of Ottawa. He has also been a regular member of the visiting facultyin the Music and Sound Department at the Ban Centre for the Arts. He ispresently a researcher in acoustics and perception at Bang and Olufsen a/sinDenmarkwherehehasworkedsincetheFallof2002. Hemaintainsanactive musical career as an organist, choral conductor and composer.GeohasbeenamemberoftheAudioEngineeringSocietysince1990and has served on the executive for the Montreal Student Chapter for twoyears. He was the Papers Chair for the 24th International Conference of theAudio Engineering Society titled Multichannel Audio: The New Realityheld at The Ban Centre in Alberta, Canada. He is presently the chair ofthe AES Technical Committee on Microphones and Applications.Figure1: WhatIusedtolooklikeonceuponatime. ThesedaysIhavealotlesshair.0.Openingmaterials xxi0.4 RecommendedReadingThere are a couple of books that I would highly recommend, either becausetheyre full of great explanations of the concepts that youll need to know,or because theyre great reference books. Some of these arent in print anymore0.4.1 GeneralInformationBallou, G., ed. (1987) Handbookfor SoundEngineers: TheNewAudioCyclopedia, Howard W. Sams & Company, Indianapolis.Ranes online dictionary of audio terms at www.rane.com0.4.2 SoundRecordingWoram, JohnM. (1989)SoundRecordingHandbook, HowardW. Sams&Company, Indianapolis. (Thisistheonlyeditionof thisbookthatIcanrecommend. I dontknowthepreviousedition, andthesubsequentonewasnt remotely as good.)Eargle, John (1986) Handbook of Recording Engineering, Van NostrandReinhold, New York.0.4.3 AnalogElectronicsJung, Walter G., IC Op-Amp Cookbook, Prentice Hall Inc.Gayakwad, Ramakant A., (1983) Op-amps and Linear Integrated CircuitTechnology, Prentice-Hall Inc.0.4.4 PsychoacousticsMoore, B. C. J. (1997) An Introduction to the Psychology of Hearing, Aca-demic Press, San Diego, 4th Edition.Blauert, J. (1997) Spatial Hearing: The Psychophysics of Human SoundLocalization, MIT Press, Cambridge, Revised Edition.Bregman, A. S. (1990) Auditory Scene Analysis : The Perceptual Orga-nization of Sound, MIT Press. Cambridge.Zwicker, E., &Fastl, H. (1999) Psychoacoustics: Facts andModels,Springer, Berlin.0.Openingmaterials xxii0.4.5 AcousticsMorfey, C. L. (2001). Dictionary of Acoustics, Academic Press, San Diego.KinslerL. E., Frey, A. R., Coppens, A. B., &Sanders, J. V. (1982)Fundamentals of Acoustics, John Wiley & Sons, New York, 3rd edition.Hall, D. E. (1980) Musical Acoustics: An Introduction, Wadsworth Pub-lishing, Belmont.Kutru, K. H. (1991) RoomAcoustics, Elsevier Science Publishers, Es-sex.0.4.6 DigitalAudioandDSPRoads, C., ed. (1996)TheComputerMusicTutorial, MITPress, Cam-bridge.Strawn, J., editor (1985). DigitalAudioSignalProcessing: AnAnthol-ogy, William Kaufmann, Inc., Los Altos.Smith,Steven W. TheScientistandEngineersGuidetoDigital SignalProcessing(www.dspguide.com)Steiglitz, K. (1996) A DSP Primer : With Applications to Digital Audioand Computer Music, Addison-Wesley, Menlo Park.Zlzer, U. (1997)Digital AudioSignal Processing, JohnWiley&Sons,Chichester.Anything written by Julius Smith0.4.7 ElectroacousticMeasurementsMezler, Bob (1993) Audio Measurement Handbook, Audio Precision, Beaver-ton (available at a very reasonable price from www.ap.comAnything written by Julian Dunn0.Openingmaterials xxiii0.5 Whyisthisbookfree?Myfriendsaskmewhyinthehell Ispendsomuchtimewritingabookthat I dont make any money on. There are lots of reasons starting with thethree biggies:1. If Ididtrytosell thisthroughapublisher, Isureashell wouldntmake enough money to make it worth my while. This thing has takenmany hours over many years to write.2. By the time the thing actually got out on the market, Id be long goneandeverythingherewouldbeobsolete. Ittakesalonglongtimetoget something published... and3. Its really dicult to do regular updates on a hard copy of a book. Youprobably wouldnt want me to be dropping by your house penciling incorrectionsandadditionsinabookthatyouspentalotofcashon.So, its easier to do it this way.Ive recently been introduced to the concept of charityware which Imusing as the model for this book. So, if you use it, and you think that itsworthsomecash,pleasedonatewhateveryouwouldhavespentonitinabookstore to your local cancer research foundation. Ive put together a smalllistofsuggestionsbelow. Anyamountwillbeappreciated. Alternatively,youcouldjustsendmeapostcardfromwhereveryoulive. MyaddressisGeo Martin, Grnnegade 17, DK-7830 Vinderup, DenmarkI might try and sell the next one. For this one, you have my permissiontouse, copyanddistributethis bookas longas youobeythefollowingparagraph:CopyrightGeoMartin1999-2003. Usersareauthorizedtocopytheinformation in this document for their personal research or educational usefornon-protactivitiesprovidedthisparagraphisincluded. Thereisnolimitonthenumberofcopiesthatcanbemade. Thematerialcannotbeduplicatedorusedinprintedorelectronicformforacommercialpurposeunless appropriate bibliographic references are used. - www.tonmeister.ca0.Openingmaterials xxivChapter1IntroductoryMaterials1.1 GeometryItmayinitiallyseemthatasectionexplaininggeometryisaverystrangeplace to start a book on sound recording, but as well see later, its actuallythebestplacetostart. Inordertounderstandmanyof theconceptsinthe chapters on acoustics, electronics, digital signal processing and electroa-coustics,youll need to have a veryrm and intuitive grasp of a couple ofsimple geometrical concepts. In particular, these two concepts are the righttriangleand the idea of slope.1.1.1 RightTrianglesIll assumeatthispointthatyouknowwhatatriangleis. Ifyoudonotunderstandwhatatriangleis, thenIwouldrecommendbackingupabitfrom this textbook and reading other tomes such as Trevor Draws a Triangleand the immortal classic, Babys First Book of Euclidian Geometry. (Okay,okay... I lied... Those books dont really exist... I hope that this hasnt puta dent in our relationship, and that you can still trust me for the rest of thisbook...)Onceuponatime, aGreekbythenameof Pythagorashadaminorobsession with triangles.1Interestingly, Pythagoras, like many other Greeksof histime, recognizedthedirectlinkbetweenmathematicsandmusicalacoustics, soyoull seehisnamepoppingupall overtheplaceaswegothrough this book.1Thenagain, Pythagorasalsobelievedinreincarnationandthoughtthatif youwerereallybad,youmightcomebackasabean,sothePythagoreans(hisfollowers)didnteatmeatorbeans... Youcanlookitupifyoudontbelieveme.11.IntroductoryMaterials 2Anyways, backtotriangles. Therstthingthatwehavetodeneissomething called a right triangle. This is just a regular old everyday trianglewith one specic characteristic. One of its angles is a rightanglemeaningthat its 90as is shown in Figure 1.1. One other new word to learn. Theside opposite the right angle (in Figure 1.1, that would be sidea) is calledthe hypotenuseof the triangle.abcFigure 1.1: A right trangle with sides of lengths a, b and c. Note that side a is called the hypotenuseofthetriangle.Oneof thethingsPythagorasdiscoveredwasthatif youtakearighttrangle and make a square from each of its sides as is shown in Figure 1.2,then the sum of the areas of the two smaller squares is equal to the area ofthe big square.So, lookingatFigure1.2, thenwecansaythatA=B + C. Wealsoshould know that the area of a square is equal to the square of the lengthof one of its sides. Looking at Figures 1.1 and 1.2 this means thatA = a2,B = b2, andC = c2.Therefore, we can put this information together to arrive at a standardequationforrighttrianglesknownasthePythagoreanTheorem, showninEquation 1.2.a2= b2+c2(1.1)and thereforea =_b2+c2(1.2)This equation is probably the single most important key to understand-ing the concepts presented in this book, so youd better remember it.1.IntroductoryMaterials 3ABCFigure1.2: Threesquaresof areasA, BandCcreatedbymakingsquaresoutof thesidesof arighttrangleofarbitrarydimensions. A = B +C1.1.2 SlopeLets go downhill skiing. One of the big questions when youre a beginnerdownhill skiier is how steep is the hill?Well, there is a mathematical wayto calculate the answer to this question. Essentially, another way to ask thesamequestionishowmanymetresdoIdropforeverymetrethatIskiforward? The more you drop over a given distance, the steeper the slopeof the hill.So, what were talking about when we discuss the slope of the hill is howmuch it rises (or drops) for a given run. Mathematically, the slope is writtenas a ratio of these two values as is shown in Equation 1.3.slope =riserun(1.3)but if we wanted to be a little more technical about this, then we wouldtalkabouttheratioofthedierenceinthey-value(therise)foragivendierence in the x-value (the run), so wed write it like this:slope =yx(1.4)Where is a symbol (its the Greek capital letter delta) commonly usedto indicate a dierence or a change.Letsjustthinkaboutthisalittlemoreforacoupleof minutesandconsider some dierent slopes.1.IntroductoryMaterials 4When there is no rise or drop for a change in horizontal distance, (likesailing on the ocean with no waves) then the value of yis 0, so the slopeis 0.When youre climbing a sheer rock face that drops straight down, thenthe value of x is 0 for a large change iny therefore the slope is .Ifthechangeinxandyarebothpositive(so, youaregoingforwardsand up a the same time) then the slope is positive. In other words, the linegoes up from left to right on a graph.If the change in y is negative while the change in x is positive, then theslope is negative. In other words, youre going downhill forwards, or yourelooking at a graph of a line that goes downwards from left to right.If youlookatareal textbookongeometrythenyoull seeaslightlydierent equation for slope that looks like Equation 1.5, but we wont botherwith this one. If you compare it to Equation 1.4, then youll see that, apartfrom the k theyre identical, and that the k is just a sort of altitude reading.y = mx +k (1.5)wherem is the slope.1.IntroductoryMaterials 51.2 ExponentsAn exponent is just a lazy way to write down that you want to multiply anumber by itself.If I say 102, then this is just a short notation for 10 multiplied by itself2 times therefore, its 10 10 = 100. For example, 34= 3 3 3 3 = 81.Sometimes youll see a negative number as the exponent. This simplymeans that you have to include a little division in your calculation. When-everyouseeanegativeexponent, youjusthavetodivide1bythesamething without the negative sign. For example, 102=11021.IntroductoryMaterials 61.3 LogarithmsOnceuponatimeyoulearnedtodomultiplication, afterwhichsomeoneexplained that you can use division to do the reverse. For example:ifA = B C (1.6)thenAB= C (1.7)andAC= B (1.8)Logarithms sort of work in the same way, except that they are the back-wards version of an exponent. (Just as division is the backwards version ofmultiplication.)Logarithms (or logs) work like this:If 102= 100 then log10 100 = 2Actually, its:IfAB= Cthen logAC = BNow we have to go through some properties of logarithms.log10 10 = 1 or log10 101= 1log10 100 = 2 or log10 102= 2log10 1000 = 3 or log10 103= 3Thisshouldcomeasnogreatsurpriseyoucancheckthemonyourcalculator if you dont believe me. Now, lets play with these three equations.log10 1000 = 3log10 103= 33 log10 10 = 3Therefore:logC AB= B logC A1.3.1 WarningI once learned that you should never assume, because when you assume youmake an ass out of you and me... (get it?assume... okay... dumb joke).One small problem with logarithms is the way theyre written. People usu-allydontwritethebaseofthelogsoyoullseethingslikelog(3)writtenwhich usually means log10 3 if the base isnt written, its assumed to be 10.1.IntroductoryMaterials 7Thisalsoholdstrueonmostcalculators. Punchin100andhitLOGandseeifyouget2asanansweryouprobablywill. Unfortunately, thisas-sumption is not true if youre using a computer to calculate your logarithms.Forexample, ifyoureusingMATLABandyoutypelog(100)andhittheRETURN button, youll get the answer 4.6052. This is because MATLABassumes that you mean base e (a number close to 2.7182) instead of base 10.So, if youre using MATLAB, youll have to type in log10(100) to indicatethatthelogarithmisinbase10. IfyoureinMathematica,youllhavetouse Log[10, 100] to mean the same thing.Note that many textbooks write log and mean log10just like your cal-culator. Whenthebookswantyoutouselogelikeyourcomputertheyllwrite ln (pronounced lawn) meaning the natural logarithm.The moral of the story is: BEWARE! Verify that you know the base ofthe logarithm before you get too many wrong answers and have to do it allagain.1.IntroductoryMaterials 81.4 TrigonometricFunctionsIve got an idea for a great invention. Im going to get a at piece of woodand cut it out in the shape of a circle. In the centre of the circle, Im goingto drill a hole and stick a dowel of wood in there. I think Im going to callmy new invention a wheel.Okay, okay, soIrandowntothepatentoceandfoundoutthatthewheel has already been invented... (Apparently, Bill Gates just bought thepatent rights from Michael Jackson last year...)But, since its such a greatidea lets look at one anyway. Lets drill another hole out on the edge of thewheelandstickinahandlesothatitlookslikethecontraptioninFigure1.3. If I turn the wheel, the handle goes around in circles.Figure 1.3: Wheel rotating counterclockwise when viewed from the side of the handle thats stickingoutontheright.Now lets think of an animation of the rotating wheel. In addition, welllook at the height of the handle relative to the centre of the wheel. As thewheel rotates, the handle will obviously go up and down, but it will followa specic pattern over time. If that height is graphed in time as the wheelrotates, we get a nice wave as is shown in Figure 1.4.That nice wave tells us a couple of things about the wheel:Firstly, if we assume that the handle is right on the edge of the wheel, ittells us the diameter of the wheel itself. The total height of the wave fromthe positive peak to negative trough is a measurement of the total vertical1.IntroductoryMaterials 9Vertical displacementTimeFigure1.4: Arecordoftheheightofthehandleovertimeproducingawavethatappearsontherightofthewheel.travel of thehandle, equal tothediameter. Themaximumdisplacementfrom 0 is equal to the radius of the wheel.Secondly, if we consider that the wave is a plot of vertical displacementover time, then we can see the amount of time it took for the handle to makea full rotation. Using this amount of time, we can determine how frequentlythe wheel is rotating. If it takes 0.5 seconds to complete a rotation (or forthe wave to get back to where it started half a second ago) then the wheelmust be making two complete rotations per second.Thirdly, if thewaveis aplot of thevertical displacement vs. time,then the slope of the wave is proportional to the vertical speed of the han-dle. Whentheslopeis0thehandleisstopped. (Rememberthatslope=rise/run,thereforetheslopeis0whentheriseorthechangeinverticaldisplacement is 0 this happens at the peak and trough because the handleis nished going in one direction and is instantaneously stopped in order tostartheadingintheoppositedirection.) Notethatthehandleisntreallystopped its still turning around the wheel but for that moment in time,its not moving in the vertical plane.Finally, if we think of the wave as being a plot of the vertical displacementvs. theangularrotation, thenwecanseetherelationshipbetweenthesetwoasisshowninFigure1.5. Inthiscase,thehorizontal(X)axisofthewaveform is the angular rotation of the wheel and the vertical height of thewaveform (the Y-value) is the vertical displacement of the handle.This wave that were looking at is typically called a sine wave the wordsinecoming from the same root as words like sinuous and sinus (as insinus cavity) from the Latin word sinus meaning a bay. This specicwaveshape describes a bunch of things in the universe take, for example,a weight suspended on a spring or a piece of elastic. If the weight is pulleddown, then itll bob up and down, theoretically forever. If you graphed thevertical displacement of the weight over time, youd get a graph exactly likethe one weve created above its a sine wave.Notethatmostphysicstextbookscallthisbehavioursimpleharmonic1.IntroductoryMaterials 10Figure1.5: Graphsshowingtherelationshipbetweentheangleof rotationof thewheel andthewaveformsX-axis.1.IntroductoryMaterials 11motion.Theres one important thing that the wave isnt telling us the directionof rotationof thewheel. If thewheel wereturningclockwiseinsteadofcounterclockwise, then the wave would look exactly the same as is shown inFigure 1.6.Vertical displacementTimeVertical displacementTimeFigure1.6: Twowheels rotatingat thesamespeedinoppositedirections resultinginthesamewaveform.So, howdowegetthispieceof information? Well, asitstandsnow,were just getting the height information of the handle. Thats the same asif we were sitting to the side of the wheel, looking at its edge, watching thehandlebobupanddown, butnotknowinganythingaboutitgoingfromside to side. In order to get this information, well have to look at the wheelalong its edge from below. This will result in two waves the sine wave thatwe saw above, and a second wave that shows the horizontal displacement ofthe handle over time as is shown in Figure 1.7.As can be seen in this diagram,if the wheel were turning in the oppo-sitedirectionasintheexampleinFigure1.6, thenalthoughtheverticaldisplacement would be the same, the horizontal displacement would be op-posite, and wed know right away that the wheel was tuning in the oppositedirection.This second waveform is called a cosine wave (because its the complimentof the sinewave). Notice how, whenever the sine wave is at a maximum ora minimum,the cosine wave is at 0 in the middle of its movement. Theopposite is also true whenever the cosine is at a maximum or a minimum,the sine wave is at 0. The four points that we talked about earlier (regardingwhat the sine wave tells us) are also true for the cosine we know the diam-eter of the wheel, the speed of its rotation, and the horizontal (not vertical)displacement of the handle at a given time or angle of rotation.1.IntroductoryMaterials 12Figure1.7: Graphsshowingtherelationshipbetweentheangleof rotationof thewheel andthevertical andhorizontal displacementsofthehandle.Keep in mind as well that if we only knew the cosine, we still wouldntknow the direction of rotation of the wheel we need to know the simulta-neous values of the sine and the cosine to know whether the wheel is goingclockwise or counterclockwise.Now then,lets assume for a moment that the circle has a radius of 1.(1centimeter, 1foot... itdoesntmattersolongaswekeepthinkinginthesameunitsfortherestofthislittlechat.) Ifthatsthecasethenthemaximumvalueof thesinewavewill be1andtheminimumwill be-1.The same holds true for the cosine wave. Also, looking back at Figure 1.5,wecanseethatthevalueofthesineis1whentheangleofrotation(alsoknown as the phaseangle) is 90. At the same time, the value of the cosineis 0 (because theres 0 horizontal displacement at 90). Using this, we cancomplete Table 1.1:In fact, if you get out your calculator and start looking for the Sine (sinon a calculator) and the Cosine (cos) for every angle between 0 and 359(nopointinchecking360becauseitll bethesameas0youvemadeafull rototation at that point...)and plot each value, youll get a graph thatlooks like Figure 1.8.As can be seen in Figure 1.8, the sine and cosine intersect at 45(withavalueof0.707or12andat215(withavalueof-0.707or 12. Also,you can see from this graph that a cosine is essentially a sine wave, but 901.IntroductoryMaterials 13Phase Verticaldisplacement Horizontaldisplacement(degrees) (Sine) (Cosine)00 1450.707 0.707901 01350.707 -0.7071800 -1225-0.707 -0.707270-1 0315-0.707 0.707Table1.1: Valuesofsineandcosineforvariousangles0 50 100 150 200 250 300 350-1-0.8-0.6-0.4-0.200.20.40.60.81Angle ()Figure1.8: TherelationshipbetweenSine(blue)andCosine(red)foranglesfrom0to359.1.IntroductoryMaterials 14earlier. That is to say that the value of a cosine at any angle is the same asthe value of the sine 90later. These two things provide a small clue as toanother way of looking at this relationship.Look at the rst 90 of rotation of the handle. If we draw a line from thecentre of the wheel to the location of the handle at a given angle, and thenadd lines showing the vertical and horizontal displacements as in Figure 1.7,then we get a triangle like the one shown in Figure 1.9.Figure1.9: Arighttrianglewithintherotatingwheel. Noticethatthevalueofthesinewaveisthegreenvertical legof thetriangle, thevalueof thecosineistheredhorizontal legof thetriangleandthediameterofthewheel (andthereforethepeakvaluesofboththesineandcosine)isthehypotenuse.Now, if the radius of the wheel (the hypotenuse of the triangle) is 1, thentheverticallineisthesineoftheinsideangleindicatedwitharedarrow.Likewise, the horizontal leg of the triangle is the cosine of the angle.Also, weknowfromPythagoreasthatthesquareofthehypotenuseofarighttriangleisequal tothesumof thesquaresof theothertwosides(remembera2+ b2=c2where c is the length of the hypotenuse). In otherwords, inthecaseofourtriangleabovewherethehypotenuseisequalto1, then the sin of the angle squared + the cosine of the angle squared = 1squared... This is a rule (shown below) that is true for any angle.sin2 + cos2 = 1 (1.9)where is any angle.1.IntroductoryMaterials 15Since this is true, then when the angle is 45, then we know that the righttriangle is isoceles meaning that the two legs other than the hypotenuse areof equal length (take a look at the graph in Figure 1.8). Not only are theythe same length, but, their squares add up to 1. Remember that a2+b2= c2andthatc2= 1. Therefore,withalittlebitofmath,wecanseethatthevalue of the sine and the cosine when the angle is 45 is12because its thesquare root of12and_12=12=12.1.4.1 RadiansOnce upon a time, someone discovered that there is a relationship betweenthe radius of a circle and its circumference. It turned out that, no matter howbig or small the circle, the circumference was equal to the radius multipliedby 2 and multiplied again by the number 3.141592645... That number wasgiven the name pi (written) and people have been fascinated by it eversince. Infact,thenumberdoeststopwhereIsaiditdiditkeepsgoingfor at least a billion places without repeating itself... but 9 places after thedecimal is plenty for our purposes.So, now we have a new little equation:Circumference = 2 r (1.10)where r is the radius of the circle and is 3.141592645...Normallywemeasureanglesindegreeswherethereare360inafullcircle, however, in order to measure this way, we need a protractor to tell uswhere the degrees are. Theres another way to measure angles using only aruler and a piece of string...Lets go back to the circle above with a radius of 1. Since we have thenewequation, weknowthatthecircumferenceisequal to2 rbutr= 1,sothecircumferenceis2 (saytwopi). Now,wecanmeasureangles using the circumference instead of saying that there are 360in acircle,wecansaythatthereare2radians. Wecallthemradiansbecasetheyrebasedontheradius. Sincethecircumferenceof thecircleis2rand there are 2 radians in the circle, then 1 radian is the angle where thecorrespondingarconthecircleisequal tothelengthoftheradiusofthesame circle.Usingradians is just likeusingdegrees youjust havetoput yourcalculator into a dierent mode. Look for a way of getting it into RADinsteadof DEG(RADiansinsteadof DEGrees). Now, rememberthatthereare2radiansinacirclewhichisthesameassaying360degres.1.IntroductoryMaterials 16Therefore, 180whichishalfofthecircleisequal toradians. 90is2radians and so on. You should be able to use these interchangeably in dayto day conversation.1.4.2 Phasevs. AdditionIfI takeanytwo sinusoidalwavesthathavethesamefrequency,buttheyhave dierent amplitudes, and theyre oset in phase, and I add them, theresult will be a sinusoidal wave with the same frequency with another am-plitude and phase. For example,take a look at Figure 1.10. The top plotshows one period of a 1 kHz sinusoidal wave starting with a phase of 0 ra-dians and a peak amplitude of 0.5. The second plot shows one period of a 1kHz a sinusoidal wave starting with a phase of4radians (45) and a peakamplitude of 0.8. If these two waves are added together, the result, shownonthebottom, isoneperiodof a1kHzsinusoidal wavewithadierentpeak amplitude and starting phase. The important thing that Im trying toget across here is that the frequency and wave shape stay the same onlythe amplitude and phase change.0 50 100 150 200 250 300 35010.500.510 50 100 150 200 250 300 35010.500.510 50 100 150 200 250 300 35010.500.51Figure1.10: Addingtwosinusiodswiththesamefrequencyanddierentphases. Thesumofthetoptwowaveformsisthebottomwaveform.So what?Well, most recording engineers talk about phase. Theyll saythingslikeasinewave, 135latewhichlookslikethecurveshowninFigure 1.11.If we wanted to be a little geeky about this, we could use the equationbelow to say the same thing:1.IntroductoryMaterials 170 50 100 150 200 250 300 35010.80.60.40.200.20.40.60.81Angle of rotation (deg.)DisplacementFigure1.11: Asinewave,startingataphaseof135.y(n) = Asin(n +) (1.11)which means the value of y at a given value of n is equal to A multipliedby the sine of the sum of the values nand . In other words, the amplitudeyat angle nequals the sine of the angle nadded to a constant value andthepeakvaluewill beA. Intheaboveexample, y(n)wouldbeequal to1 sin(n + 135) where ncan be any value.Now, wehavetobealittlemoregeekythanthat, even... Wehavetotalk about cosine waves instead of sine waves. Weve already seen that theseare really the same thing, just 90apart, so we can already gure out thatasinewavethatsstarting135lateisthesameasacosinewavethatsstarting 45 late.Now that weve made that transition,there is another way to describea wave. If we scale the sine and cosine components correctly and add themtogether, theresultwillbeasinusoidalwaveatanyphaseandamplitudewe want. Take a look at the equation below:Acos(n +) = a cos(n) b sin(n) (1.12)where A is the amplitude is the phase anglea = Acos()b = Asin()1.IntroductoryMaterials 18Whatdoesthismean? Well, all itmeansisthatwecannowspecifyvalues for a andb and, usingthis equation, windupwithasinusoidalwaveformofanyamplitudeandphasethatwewant. Essentially, wejusthave an alternate way of describing the waveform.For example, where you used to say A cosine wave with a peak ampli-tude of 0.93 and3radians (60) late you can now say:A = 0.93 =3a = 0.93 cos(3) = 0.93 0.5 = 0.4650b = 0.93 sin(3) = 0.93 0.8660 = 0.8054ThereforeAcos(n + 27) = 0.4650 cos(n) 0.8054 sin(n) (1.13)So we could say that its the combination of an upside-down sine wavewith a peak amplitude of 0.8054 and a cosine wave with a peak amplitudeof 0.4650. Well see in Chapter 1.5 how to write this a little more easily.Remember that, if youre used to thinking in terms of a peak amplitudeandaxedphaseoset, thenthismightseemlessintuitive. However, ifyour job is to build a synthesizer that makes a sinusoidal wave with a givenphase oset, youd much rather just add an appropriately scaled cosine andsine rather than having to build a delay.1.IntroductoryMaterials 191.5 ComplexNumbers1.5.1 WholeNumbersandIntegersOnce upon a time you learned how to count. You were probably taught tocount your ngers... 1,2,3,4 and so on. Although no one told you so atthe time, you were being taught a set of numbers called whole numbers.Sometime after that, you were probably taught that theres one numberthat gets tacked on before the ones you already knew the number 0.A little later, sometime after you learned about money and the fact thatwedonthaveenough,youweretaughtnegativenumbers... -1,-2,-3andso on. These are the numbers that are less than 0.That collection of numbers is called integers all countable numbersthat are negative, zero and positive. So the collection is typically written... -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 ...1.5.2 RationalNumbersEventually, after you learned about counting and numbers, you were taughthowtodivide. Whensomeonesaid20dividedby5equals4thentheymeant if you have 20 sticks, then you could put those sticks in 4 piles with 5sticks in each pile.Eventually, you learned that the division of one numberby another can be written as a fractionlike31or205or54or13.If you do that division the old-fashioned way, you get numbers like this:3/1 = 3.000000000 etc...20/5 = 4.00000000 etc...5/4 = 1.200000000 etc...1/3 = 0.333333333 etc...ThethingthatImtryingtopointouthereisthateventually, thesenumbers start repeating sometime after the decimal point. These numbersare called rational numbers.1.5.3 IrrationalNumbersWhat happens if you have a number that doesnt start repeating, no matterhow many numbers you have?Take a number like the square root of 2 forexample. This is a number that, when you multiply it by itself, results in thenumber 2. This number is approximately 1.4142. But, if we multiply 1.4142by 1.4142, we get 1.99996164 so 1.4142 isnt exactly the square root of 2.In fact, if we started calculating the exact square root of 2, wed result in anumber that keeps going forever after the decimal place and never repeats.1.IntroductoryMaterials 20Numbers like this (is another one...) that never repeat after the decimalare called irrational numbers1.5.4 RealNumbersAll of these number types rational numbers (which includes integers) andirrational numbers fall under the general heading of real numbers. The factthat these are called real implies immediately that there is a classicationof numbersthatareunrealinfactthisisthecase, butwecall themimaginary instead.1.5.5 ImaginaryNumbersLetsthinkabouttheideaofasquareroot. Thesquarerootofanumberis another number which, when multiplied by itself is the rst number. Forexample, 3isthesquarerootof 9because3 3=9. Letsconsiderthisalittlefurther: apositivenumbermulipliedbyitselfisapositivenumber(for example, 4 4 = 16... 4 is positive and 16 is also positive). A negativenumber multiplied by itself is also positive (i.e. 4 4 = 16).Now, in the rst case, the square root of 16 is 4 because 44 = 16. (Somepeople would be really picky and theyll tell you that 16 has two roots: 4 and-4. Thosepeopleareslightlygeeky, buttechnicallycorrect.) Theresjustonesmallsnagwhatifyouwereaskedforthesquarerootofanegativenumber? Thereisnosuchthingasanumberwhich, whenmultipliedbyitself resultsinanegativenumber. Soaskingforthesquarerootof -16doesntmakesense. Infact, ifyoutrytodothisonyourcalculator, itllprobably tell you that it gets an error instead of producing an answer.Mathematicians as a general rule dont like loose ends they arent thetypeofpeoplewholeavethingslyingaround... andhavingsomethingassimpleasthesquarerootof anegativenumberlyingaroundunansweredgot on their nerves so they had a bunch of committee meetings and decidedto do something about it. Their answer was to invent a new number calledi(although some people namely physicists and engineers call it j just toscrew everyone up... well stick with j for now, but we might change later...)What is j ?I hear you cry. Well, j is the square root of -1. Of course,thereisnonumberthatisthesquarerootof-1, butsincethatanswerisinadequate, j will do the trick.Whyisitcalledj ? Ihearyoucry. Thatoneissimplej standsforimaginarybecausethesquarerootof-1isntreal, itsanimaginarynumber that someone just made up.1.IntroductoryMaterials 21Now, remember that j *j =-1. This is useful for anysquarerootofanynegativenumber, youjustcalculatethesquarerootofthenumberpretendingthatitwaspositive,andthenstickanj afterit. So,sincethesquarerootof16, abbreviated 16=4and 1=j, then 16=j4.Lets do a couple:9 = j3 (1.14)4 = j2 (1.15)Another way to think of this is a =1 a =1 a = ja so:9 =1 9 = j 9 = j3 (1.16)Of course, this also means thatj3 j3 = (3 3) (j j) = 1 9 = 9 (1.17)1.5.6 ComplexnumbersNowthatwehavereal andimaginarynumbers, wecancombinethemtocreate a complex number. Remember that you cant just mix real numberswith imaginary ones you keep them separate most of the time, so you seenumbers like3 +j2This is an example of a complex number that contains a real component(the 3) and an imaginary component (the j 2). In many cases, these numbersare further abbreviated with a single Greek character, like or, so youllsee things like = 3 +j2but for the purposes of what well do in this book, Im going to stick witheither writing the complex number the long way or Ill use a bold characterso, instead, Ill useA = 3 +j21.5.7 ComplexMathPart1AdditionLetssaythatyouhavetoaddcomplexnumbers. Inthiscase, youhaveto keep the real and imaginary components separate, but you just add theseparate components separately. For example:1.IntroductoryMaterials 22(5 +j3) + (2 +j4) (1.18)(5 + 2) + (j3 +j4) (1.19)(5 + 2) +j(3 + 4) (1.20)7 +j7 (1.21)If youd like the short-cut rule, its(a +jb) + (c +jd) = (a +c) +j(b +d) (1.22)1.5.8 ComplexMathPart2MultiplicationThe multiplication of two complex numbers is similar to multiplying regularold real numbers. For example:(5 +j3) (2 +j4) (1.23)((5 2) + (j3 j4)) + ((5 j4) + (j3 2)) (1.24)((5 2) + (j j 3 4)) + (j(5 4) +j(3 2)) (1.25)(10 + (12 1)) + (j20 +j6) (1.26)(10 12) +j26 (1.27)2 +j26 (1.28)The shortened rule is:(a +jb)(c +jd) = (ac bd) +j(ad +bc) (1.29)1.5.9 ComplexMathPart3SomeIdentityRulesThere are a couple of basic rules that we can get out of the way at this pointwhen it comes to complex numbers. These are similar to their correspondingrules in normal mathematics.1.IntroductoryMaterials 23CommutativeLawsThis law says that the order of the numbers doesnt matter when you addor multiply. For example, 3 + 5 is the same as 5 + 3, and 3 * 5 = 5 * 3. Inthe case of complex math:(a +jb) + (c +jd) = (c +jd) + (a +jb) (1.30)and(a +jb) (c +jd) = (c +jd) (a +jb) (1.31)AssociativeLawsThis law says that, when youre adding more than two numbers, it doesntmatter which two you do rst. For example (2 + 3) + 5 = 2 + (3 + 5). Thesame holds true for multiplication.((a +jb) + (c +jd)) + (e +jf) = (a +jb) + ((c +jd) + (e +jf)) (1.32)and((a +jb) (c +jd)) (e +jf) = (a +jb) ((c +jd) (e +jf)) (1.33)DistributiveLawsThislawsaysthat, whenyouremultiplyinganumberbythesumoftwoother numbers, its the same as adding the results of multiplying the numbersone at a time. For example, 2 * (3 + 4) = (2 * 3) + (2 * 4). In the case ofcomplex math:(a+jb)((c+jd)+(e+jf)) = ((a+jb)(c+jd))+((a+jb)(e+jf)) (1.34)IdentityLawsThese are laws that are pretty obvious, but sometimes they help out. Thecorresponding laws in normal math are x + 0 = x and x * 1 = x.(a +jb) + 0 = (a +jb) (1.35)1.IntroductoryMaterials 24and(a +jb) 1 = (a +jb) (1.36)1.5.10 ComplexMathPart4InverseRulesAdditiveInverseEvery number has what is known as an additive inverse a matching num-berwhichwhenaddedtoitspartnerequals0. Forexample, theadditiveinverse of 2 is -2 because 2 + -2 = 0. This additive inverse can be found bymulitplying the number by -1 so, in the case of complex numbers:(a +jb) + (a +jb) = 0 (1.37)Therefore, the additive inverse of (a+ jb) is (-a- jb)MultiplicativeInverseSimilarly to additive inverses, every number has a matching number, which,whenthetwoaremultiplied, equals1. Theonlyexceptiontothisisthenumber 0,so,ifx does not equal 0,then the multiplicativeinverseofx is1xbecausex 1x= xx= 1. Some books write this asx x1= 1 becausex1=1x. Inthecaseof complexmath, thingsareunfortunatelyalittledierent because 1 divided by a complex number is... well... complex.if (a+ jb) is not equal to 0 then:1a +jb=a jba2+b2(1.38)We wont worry too much about how thats calculated,but we can es-tablish that its true by doing the following:(a +jb) a jba2+b2(1.39)(a +jb)(a jb)a2+b2(1.40)a2+b2a2+b2(1.41)1 (1.42)1.IntroductoryMaterials 25Theresoneinterestingthingthatresultsfromthisrule. Whatif welooked for the multiplicative inverse ofj?In other words, what is1j?Well,lets use the rule above and plug in (0 + 1j).1a +jb=a jba2+b2(1.43)10 +j1=0 j102+ 12(1.44)1j= 1j1(1.45)1j= j (1.46)Weird, but true.DividingcomplexnumbersThemultiplicativeinverserulecanbeusedifyouretryingtodivide. Forexample,abis the same asa 1btherefore:a +jbc +jd(1.47)(a +jb) 1c +jd(1.48)(a +jb)(c jd)c2+d2(1.49)1.5.11 ComplexConjugatesComplexmathhasanextrarelationshipthatdoesntreallyhaveacorre-sponding equivalent in normal math. This relationship is called a complexconjugate but dont worry its not terribly complicated. The complex con-jugateofacomplexnumberisdenedasthesamenumber, butwiththepolarity of the imaginary component inverted. So:the complex conjugate of (a+ bj ) is (a- bj )A complex conjugate is usually abbreviated by drawing a line over thenumber. So:(a +jb) = (a jb) (1.50)1.IntroductoryMaterials 261.5.12 AbsoluteValue(alsoknownastheModulus)Theabsolutevalueofacomplexnumberisalittleweirderthanwhatweusually think of as an absolute value. In order to understand this, we haveto look at complex numbers a little dierently:Rememberthatj j= 1. Also, rememberthat, ifwehaveacosinewave and we delay it by 90 and then delay it by another 90, its the sameas inverting the polarity of the cosine, in other words, multiplying the cosineby -1. So, we can think of the imaginary component of a complex numberasbeingarealnumberthatsbeenrotatedby90,wecanpictureitasisshown in Figure 1.12.modulusimaginaryreal2+3ireal axisimaginary axisFigure1.12: Therelationshipbewteentherealandimaginarycomponentsforthenumber(2+3j).NoticethattheXandYaxeshavebeenlabeledtherealandimaginaryaxes.Notice that Figure 1.12 actually winds up showing three things. It showsthereal componentalongthex-axis, theimaginarycomponentalongthey-axis, andtheabsolutevalue ormodulus of thecomplexnumberasthehypotenuse of the triangle.Thisshouldmakethecalculationfordeterminingthemodulusof thecomplex number almost obvious. Since its the length of the hypotenuse ofthe right triangle formed by the real and imaginary components, and sincewe already know the Pythagorean theorem then the modulus of the complexnumber (a +jb) is1.IntroductoryMaterials 27modulus =_a2+b2(1.51)Giventhevaluesof thereal andimaginarycomponents, wecanalsocalculate the angle of the hypotenuse from horizontal using the equation = arctan imaginaryreal(1.52) = arctanba(1.53)This will come in handy later.1.5.13 Complexnotationor... Whocares?This is probably the most important question for us. Imaginary numbers aregreat for mathematicians who like wrapping up loose ends that are incurredwhenastudent asks whats thesquareroot of -1? but what usearecomplex numbers for people in audio?Well, it turns out that theyre usedall thetime, bythepeopledoinganalogelectronicsaswell asthepeopleworking on digital signal processing. Well get into how they apply to eachspecic eld in a little more detail once we know what were talking about,but lets do a little right now to get a taste.In the chapter that introduces the trigonometric functions sine and co-sine, we looked at how both functions are just one-dimensional representa-tions of a two-dimensional rotation of a wheel. Essentially, the cosine is thehorizontal displacement of a point on the wheel as it rotates. The sine is thevertical displacement of the same point at the same time. Also, if we knowone of these two components, we know1. the diameter of the wheel and2. how fast its rotating, but we need to know both components to know3. the direction of rotation.Atanygivenmomentintime, if wefrozethewheel, wedhavesomecontribution of these two components a cosine component and a sine com-ponent for a given angle of rotation. Since these two components are eec-tively identical functions that are 90 apart (for example, a sine wave is thesame as a cosine thats been delayed by 90) and since were thinking of thereal andimaginarycomponentsinacomplexnumberasbeing90apart,1.IntroductoryMaterials 280 50 100 150 200 250 300 35010.80.60.40.200.20.40.60.81Angle of rotation (deg.)DisplacementFigure1.13: Asignal consistingonlyofacosinewavethen we can use complex math to describe the contributions of the sine andcosine components to a signal.Huh? Letslookatanexample. Ifthesignal wewantedtolookatasignal that consisted only of a cosine wave as is shown in Figure 1.13, thenwed know that the signal had 100% cosine and 0% sine. So, if we expressthe cosine component as the real component and the sine as the imaginary,then what we have is:1 + 0j (1.54)If the signal was an upside-down cosine, then the complex notation forit would be (1 + 0j) because it would essentially be a cosine * -1 and nosine component. Similarly, if the signal was a sine wave, it would be notatedas (0 1j).This last statement shouldraiseat least oneeyebrow... Whyis thecomplex notation for a positive sine wave (0 1j)?In other words, why isthere a negative sign there to represent a positive sine component? Well...Actuallythereisnogoodexplanationforthisatthispointinthebook,but it should become clear when we discuss a concept known as the FourierTransform in Section 8.2.Thisisne, butwhatif thesignal lookslikeasinusoidal wavethatsbeen delayed a little like the one in Figure 1.14?Thissignal wascreatedbyaspeciccombinationofasineandcosinewave. Infact, its70.7%sineand70.7%cosine. (IfyoudontknowhowIarrivedthatthosenumbers, checkoutEquation1.11.) Howwouldyou1.IntroductoryMaterials 290 50 100 150 200 250 300 35010.80.60.40.200.20.40.60.81Angle of rotation (deg.)DisplacementFigure1.14: Asignal consistingof acombinationof attenuatedcosineandsinewaves withthesamefrequency.expressthisusingcomplexnotation? Well, youjustlookattherelativecontributions of the two components as before:0.707 0.707j (1.55)Itsinterestingtonoticethat, althoughFigure1.14isactuallyacom-binationofacosineandasinewithaspecicratioofamplitudes(inthiscase, both at 0.707 of normal), the result looks like a sine wave thats beenshifted in phase by 45 or 4radians (or a cosine thats been phase-shiftedby 45 or4radians). In fact, this is the case any phase-shifted sine wavecan be expressed as the combination of its sine and cosine components witha specic amplitude relationship.Therefore, any sinusoidal waveform with any phase can be simplied intoitstwoelementalcomponents, thecosine(orreal)andthesine(orimagi-nary). Once the signal is broken into these two constituent components, itcannot be further simplied.If we look at the example at the end of Section 1.4, we calculated usingthe equationAcos(n +) = a cos(n) b sin(n) (1.56)that a cosine wave with a peak amplitude of 0.93 and a delay of3radianswas equivalent to the combination of a cosine wave with a peak amplitude of0.4650 and an upside-down sine wave with a peak amplitude of 0.8054. Since1.IntroductoryMaterials 30the cosine is the real component and the sine is the imaginary component,this can be expressed using the complex number as follows:0.93 cos(n +3) = 0.4650 cos(n) 0.8054 sin(n) (1.57)which is represented as0.4650 + j 0.8054whichisamuchsimplerwayof doingthings. (NoticethatI ippedthe -signtoa+.) For more informationonthis, checkout TheScientist andEngineers Guide toDigital Signal Processing available atwww.dspguide.comx cos ( + )peak amplitude of the waveformphase delay (in degrees or radians)present phase (constantly changing over time)the signal has the shape of a cosine waveFigure1.15: Aquickguidetowhatthingsmeanwhenyouseeacosinewaveexpressedasthistypeofequation.1.IntroductoryMaterials 311.6 EulersIdentitySofar, wevelookedat logarithms withabaseof 10. As weveseen, alogarithmisjustanexponentbackwards,soif AB=CthenlogAC=B.Therefore log10 100 = 2.Thereisabeastinmathematicsknownasanatural logarithmwhichis just like a regular old everyday logarithm except that the base is a veryspecicnumberitse. Whatse? Ihearyoucry... Well, justlikeisanirrationalnumbercloseto3.14159, eisanirrationalnumberthatispretty close to 2.718281828459045235360287 but it keeps on going after thedecimal place forever and ever. (If it didnt, it wouldnt be irrational, wouldit?)How someone arrived at that number is pretty much inconsequential particular if we want to avoid using calculus,but if youd like to calculateit, and if youve got a lot of time on your hands, the math is:e =11! +12! +13! +14! +... (1.58)(If youre not familiar with the mathematical expression ! you donthavetopanic! Itsshortforfactorial anditmeansthatyoumultiplyallthewholenumbersuptoandincludingthenumber. Forexample, 5! =1 2 3 4 5.)How is this euseful to us?Well, there are a number of reasons, but oneinparticular. Itturnsoutthatifweraiseetoanexponentx,wegetthefollowing.ex=x11!+x22!+x33!+x44!+... (1.59)Unfortunately, this isnt really useful to us. However, if we raise e to anexponent that is an imaginary number, something dierent happens.ej= cos() +j sin() (1.60)This is known as Eulers identityor Eulers formula.Notice now that, by putting an i up there in the exponent, we have anequationthatlinkstrigonometricfunctionstoanalgebraicfunction. Thisidentity,rstprovedbyamannamedLeonhardEuler2,isreallyusefultous.2Historical sidenote: LeonardEulerlivedatthecourtof KingFredericktheGreat,Kingof Prussia, inPotsdamfor25years(asdidVoltaireandLaMettrie). ThisisthesameKingFrederickthat tookutelessons fromJoachimQuantzandwhobought 15newfangled piano-fortes (better known to us as a piano) from Silbermann because hethought