Table of Contents
List of abbreviations xiii
List of variables xv
1 Introduction 1
1.1 Describing audio signals 1
1.1.1 Measuring audio levels 2
1.1.2 Pro-audio versus Consumer audio levels 3
1.1.3 Dynamic range 4
1.1.4 Signal to noise ratio (SNR) 4
1.1.5 Frequency and bandwidth 5
1.1.6 Characterizing noise 7
1.1.7 Probability density functions and histograms 8
1.2 Digital audio basics 8
1.3 Describing audio systems 9
1.3.1 Continuous and discrete systems 10
1.3.2 Linear and non-linear systems 10
1.3.3 Temporal properties 11
1.3.4 Impulse response 12
1.3.5 Frequency response 12
1.4 Further reading 14
1.5 Challenges 15
1.6 Project - audio playback 15
2 Complex vectors and phasors 17
2.1 Complex number representation and operations 17
2.1.1 Unit circle 18
2.1.2 Example: convert from polar to rectangular form 20
2.1.3 Programming example: plotting complex vectors 21
2.1.4 Complex mathematical operations 23
2.2 Complex conjugates 23
2.3 Phasors 24
2.3.1 Programming example: rotating a vector 25
2.4 Beat frequencies 27
2.4.1 Programming example: beat frequencies 29
2.5 Challenges 29
2.6 Project - AM and FM synthesis 30
Bibliography 31
3 Sampling 33
3.1 Phasor representation on the complex plane 34
3.2 Nyquist frequency 35
3.3 Time shift operators 37
3.3.1 Programming example: simple delay effect 38
3.4 Sampling a continuous signal 39
3.4.1 Example: analog to digital conversion 42
3.5 Fitter 42
3.5.1 Programming example: listening to jitter 43
3.6 Challenges 45
Bibliography 45
4 Aliasing and reconstruction 47
4.1 Under-sampling 48
4.1.1 Programming example: aliasing 48
4.2 Predicting the alias frequency 50
4.2.1 Example: calculating the alias frequencies 53
4.2.2 Mirror/foldback frequency 53
4.2.3 Example: calculating the alias frequencies (again) 55
4.3 Anti-aliasing filter 56
4.4 Reconstruction 57
4.4.1 Deriving the interpolator 58
4.4.2 Ideal interpolation 59
4.4.3 Real-time interpolation 61
4.5 Challenges 62
4.6 Project - aliasing 62
Bibliography 64
5 Quantization 65
5.1 Quantization resolution 66
5.2 Audio buffers 67
5.2.1 Programming example: signal quantization 68
5.2.2 Example: 3-bit quantization 69
5.3 Sample-and-hold circuit 70
5.4 Quantization error (eq) 70
5.4.1 Programming example: quantization error 71
5.4.2 PDF of quantization error 72
5.4.3 RMS of quantization error 72
5.4.4 Programming example: PDF and RMS of quantization error 73
5.5 Pulse code modulation 74
5.5.1 Non-uniform quantization 75
5.5.2 Programming example: μ-law quantization 76
5.6 Challenges 77
Bibliography 77
6 Dither 79
6.1 Signal-to-Error Ratio (SER) 80
6.1.1 The case of the missing noise 80
6.2 SER at low signal levels 82
6.3 Applying dither 82
6.3.1 Programming example: RPDF dither 84
6.4 Triangular PDF dither 86
6.4.1 Programming example: TPDF dither 87
6.4.2 Noise shaping 88
6.5 High-frequency dither 90
6.6 Challenges 91
6.7 Project - dither effects 92
Bibliography 93
7 DSP basics 95
7.1 Time-shift operators 96
7.2 Time-reversal operator 97
73 Time scaling 98
7.4 Block diagrams 99
7.4.1 Example: moving average filter 100
7.4.2 Delay using the z-operator 101
7.5 Difference equations 102
7.6 Canonical form 103
7.6.1 Programming example: filter implementation 105
7.7 Challenges 106
7.8 Project - plucked string model 107
Bibliography 108
8 FIR filters 109
8.1 FIR filters by way of example 110
8.2 Impulse response 112
8.3 Convolution 112
8.3.1 Properties of convolution 114
8.3.2 Example: convolving two signals 115
8.3.3 Programming example: vocal processing 116
8.4 Cross-correlation 117
8.4.1 Programming example: time-delay estimation 118
8.4.2 Programming example: matched filtering 118
8.5 FIR filter phase 118
8.5.1 Linear phase 119
8.5.2 Minimum phase 120
8.6 Designing FIR filters 120
8.6.1 Programming example: pre-echo 121
8.7 Challenges 122
8.8 Project - FIR filters 123
Bibliography 124
9 z-Domain 125
9.1 Frequency response 125
9.2 Magnitude response 127
9.3 Comb filters 128
9.3.1 Programming example: comb filters 128
9.3.2 Programming example: removing ground hum 130
9.4 2-Transform 131
9.4.1 Properties of z-Transform 133
9.4.2 Example: analyzing a cascade of filters 134
9.5 Pole/zero plots 136
9.5.1 Example: first-order LPF and HPF 137
9.5.2 Programming example: notch filter 140
9.6 Filter phase response 143
9.7 Group delay 144
9.8 Challenges 146
10 IIR filters 147
10.1 General characteristics of IIR filters 147
10.1.1 Denormal numbers 149
10.2 IIR filter transfer functions 149
10.2.1 Programming example: first-order IIR filter 150
10.3 IIR filter stability 153
10.3.1 Programming example: 3D p/z plot 153
10.4 Second-order resonators 155
10.4.1 Programming example: sweeping resonator 157
10.5 Biquadratic filters 158
10.5.1 Bi-quad design 159
10.6 Proportional parametric EQ 164
10.6.1 Programming example: 3-band parametric EQ 166
10.7 Forward-reverse filtering 167
10.8 Challenges 168
10.9 Project - resonator 168
Bibliography 170
11 Impulse response measurements 171
11.1 Noise reduction through averaging 172
11.2 Capturing IRs with MLS 173
11.2.1 MLS limitations 174
11.2.2 Example: maximum length sequence 174
11.2.3 Circular convolution/correlation 175
11.3 Capturing IRs with ESS 176
11.3.1 ESS stimulus generation 178
11.3.2 Inverse ESS generation 180
11.3.3 Noise reduction 181
11.3.4 Programming example: noise reduction with ESS 182
11.4 Challenges 183
11.5 Project - room response measurements 183
Bibliography 185
12 Discrete Fourier transform 187
12.1 Discretizing a transfer function 187
12.2 Sampling the frequency response 188
12.3 The DFT and inverse discrete Fourier transform 189
12.3.1 Example: DFT of a delta 190
12.3.2 Programming example: fast Fourier transform of a delta 191
12.4 Twiddle factor 191
12.4.1 Programming example: DFT of a sinusoid 192
12.4.2 Example: DFT of a rectangular pulse 194
12.5 Properties of the DFT 196
12.6 Revisiting sampling in the frequency domain 198
12.7 Frequency interpolation 199
12.7.1 Programming example: frequency interpolation 200
12.8 Challenges 201
12.9 Project - spectral filtering 202
13 Real-time spectral processing 205
13.1 Filtering in the frequency domain 206
13.2 Windowing 207
13.3 Constant overlap and add 211
13.4 Spectrograms 211
13.4.1 Programming example: vocal formants 212
13.5 Challenges 214
13.6 Project - automatic feedback control 215
14 Analog modeling 217
14.1 Derivation of the z-transform 217
14.2 Impulse invariance 219
14.2.1 Example: RC series filter 219
14.2.2 Programming example: RC filter 220
14.3 Bilinear transformation 222
14.3.1 Example: RC series filter 224
14.3.2 Frequency pre-warping 225
14.3.3 Example: pre-warping 226
14.4 Frequency sampling 227
14.4.1 Linear phase frequency sampling 227
14.4.2 Programming example: RLC with linear phase 227
14.4.3 Minimum phase frequency sampling 229
14.4.4 Programming example: RLC with minimum phase 230
14.5 Non-linear modeling with ESS 231
14.6 Challenges 236
Bibliography 236
Index 237