1st Edition

Audio Effects Theory, Implementation and Application

By Joshua D. Reiss, Andrew McPherson Copyright 2015
    368 Pages 15 Color & 150 B/W Illustrations
    by CRC Press

    Audio Effects: Theory, Implementation and Application explores digital audio effects relevant to audio signal processing and music informatics. It supplies fundamental background information on digital signal processing, focusing on audio-specific aspects that constitute the building block on which audio effects are developed. The text integrates theory and practice, relating technical implementation to musical implications. It can be used to gain an understanding of the operation of existing audio effects or to create new ones. In addition to delivering detailed coverage of common (and unusual) audio effects, the book discusses current digital audio standards, most notably VST and AudioUnit. Source code is provided in C/C++ and implemented as audio effect plug-ins with accompanying sound samples. Each section of the book includes study questions, anecdotes from the history of music technology, and examples that offer valuable real-world insight, making this an ideal resource for researchers and for students moving directly into industry.

    Preface

    About the Authors

    Aim and Scope of Book

    Introduction and Fundamentals

    Understanding Sound and Digital Audio

    Working with Decibels

    Level Measurements

    Representing and Understanding Digital Signals

    Representing Complex Numbers

    Frequency and Time-Frequency Representations

    Aliasing

    Modifying and Processing Digital Signals

    The Z Transform and Filter Representation

    Digital Filter Example

    Nonlinear and Time-Varying Effects

    Delay Line Effects

    Delay

    Theory

    Basic Delay

    Delay with Feedback

    Other Delay Types

    Slapback Delay

    Multitap Delay

    Ping-Pong Delay

    Implementation

    Basic Delay

    Variations

    Delay Line Interpolation

    Code Example

    Applications

    Vibrato Simulation

    Theory

    Interpolation

    Implementation

    Low-Frequency Oscillator

    Parameters

    Code Example

    Applications

    Flanging

    Theory

    Principle of Operation

    Basic Flanger

    Low-Frequency Oscillator

    Flanger with Feedback

    Stereo Flanging

    Properties

    Common Parameters

    Depth (or Mix)

    Delay and Sweep Width

    Speed and Waveform

    Feedback (or Regeneration)

    Inverted Mode (or Phase)

    Implementation

    Buffer Allocation

    Interpolation

    Code Example

    Applications

    Resonant Pitches

    Avoiding Disappearing Instruments

    Flanging versus Chorus

    Chorus

    Theory

    Basic Chorus

    Low-Frequency Oscillator

    Pitch-Shifting in the Chorus

    Multivoice Chorus

    Stereo Chorus

    Properties

    Common Parameters

    Depth (or Mix)

    Delay and Sweep Width

    Speed and Waveform

    Number of Voices

    Other Variations

    Summary: Flanger and Chorus Compared

    Filter Design

    Filter Construction and Transformation

    Simple, Prototype Low-Pass Filter

    High-Order Prototype Low-Pass Filter

    Changing the Gain at the Cutoff Frequency

    Shifting the Cutoff Frequency

    Creating a Shelving Filter

    Inverting the Magnitude Response

    Simple Low-Pass to Band Pass Transformation

    Popular IIR Filter Design

    Low Pass

    High Pass

    Low Shelf

    High Shelf

    Gain at Bandwidth

    Band Pass Filters

    Band Stop Filters

    Peaking and Notch Filters

    The Allpass Filter

    Applications of Filter Fundamentals

    Exponential Moving Average Filter

    Loudspeaker Crossovers

    Filter Effects

    Equalization

    Theory

    Two-Knob Tone Controls

    Three-Knob Tone Controls

    Presence Control

    Loudness Control

    Graphic Equalizers

    Bands in a Graphic Equalizer

    Parametric Equalizers

    Summary

    Implementation

    General Notes

    Tone Control Architecture

    Calculating Filter Coefficients

    Presence and Loudness Architecture

    Graphic Equalizer Architecture

    Parametric Equalizer Architecture

    Code Example

    Applications

    Graphic Equalizer Application

    Parametric Equalizer Application

    Wah-Wah

    Theory

    Basis in Speech

    Basic Wah-Wah

    Auto-Wah

    Tremolo-Wah

    Other Variations

    Implementation

    Filter Design

    Low-Frequency Oscillator

    Envelope Follower

    Analog Emulation

    Phaser

    Theory

    Basic Phaser

    Low-Frequency Oscillator

    Phaser with Feedback

    Stereo Phaser

    Implementation

    Allpass Filter Calculation

    Alternate Implementation

    LFO Waveform

    Analog and Digital Implementations

    Common Parameters

    Code Example

    Amplitude Modulation

    Tremolo

    Theory

    Low-Frequency

    Oscillator

    Properties

    Implementation

    Audio Rate and Control Rate

    Code Example

    Ring Modulation

    Theory

    Modulation in the Frequency Domain

    Perception

    w-Frequency Oscillator

    Variations

    Implementation

    Code Example

    Applications

    Dynamics Processing

    Dynamic Range Compression

    Theory

    Compressor Controls

    Signal Paths

    The Gain Stage

    The Gain Computer

    Level Detection

    RMS Detector

    Peak Detector

    Level-Corrected Peak Detectors

    Implementation

    Feedback and Feedforward Design

    An Alternate Digital Feedback Compressor

    Detector Placement

    Code Example

    Application

    Artifacts

    Summary

    Noise Gates and Expanders

    Theory and Implementation

    Applications

    Overdrive, Distortion, and Fuzz

    Theory

    Characteristic Curve

    Hard and Soft Clipping

    Input Gain

    Symmetry and Rectification

    Harmonic Distortion

    Intermodulation Distortion

    Analog Emulation

    Implementation

    Basic Implementation

    Aliasing and Oversampling

    Filtering

    Common Parameters

    Tube Sound Distortion

    Code Example

    Applications

    Expressivity and Spectral Content

    Sustain

    Comparison with Compression

    The Phase Vocoder

    Phase Vocoder Theory

    Overview

    Windowing

    Analysis: Fast Fourier Transform

    Interpreting Frequency Domain Data

    Target Phase, Phase Deviation, and Instantaneous Frequency

    Synthesis: Inverse Fast Fourier Transform

    Overlap-Add

    Filterbank Analysis Variant

    Oscillator Bank Reconstruction Variant

    Phase Vocoder Effects

    Robotization

    Robotization Code Example

    Whisperization

    Whisperization Code Example

    Time Scaling

    Time-Scaling Resynthesis

    Pitch Shifting

    Code Example

    Phase Vocoder Artifacts

    Spatial Audio

    Theory

    Panorama

    Precedence

    Vector Base Amplitude Panning

    Ambisonics

    Wave Field Synthesis

    The Head-Related Transfer Function

    ITD Model

    ILD Model

    Implementation

    Joint Panorama and Precedence

    Ambisonics and Its Relationship to VBAP

    Implementation of WFS

    HRTF Calculation

    Applications

    Transparent Amplification

    Surround Sound

    Sound Reproduction Using HRTFs

    The Doppler Effect

    A Familiar Example

    Derivation of the Doppler Effect

    Simple Derivation of the Basic Doppler Effect

    General Derivation of the Doppler Effect

    Simplifications and Approximations

    Implementation

    Time-Varying Delay Line Reads

    Multiple Write Pointers

    Code Example

    Applications

    Reverberation

    Theory

    Sabine and Norris–Eyring Equations

    Direct and Reverberant Sound Fields

    Implementation

    Algorithmic Reverb

    Schroeder’s Reverberator

    Moorer’s Reverberator

    Generating Reverberation with the Image Source Method

    Background

    The Image Source Model

    Modeling Reflections as Virtual Sources

    Locating the Virtual Sources

    The Impulse Response for a Virtual Source

    Convolutional Reverb

    Convolution and Fast Convolution

    Block-Based Convolution

    Physical Meaning

    Other Approaches

    Applications

    Why Use Reverb?

    Stereo Reverb

    Gated Reverb

    Reverse Reverb

    Common Parameters

    Audio Production

    The Mixing Console

    The Channel Section

    The Master Section

    Metering and Monitoring

    Basic Mixing Console

    Signal Flow and Routing

    Inserts for Processors, Auxiliary Sends for Effects

    Subgroup and Grouping

    Digital versus Analog

    Latency

    Digital User Interface Design

    Sound Quality

    Do You Need to Decide?

    Software Mixers

    Digital Audio Workstations

    Common Functionality of Computer-Based DAWs

    MIDI and Sequencers

    Audio Effect Ordering

    Noise Gates

    Compressors and Noise Gates

    Compression and EQ

    Reverb and Flanger

    Reverb and Vibrato

    Delay Line Effects

    Distortion

    Order Summary

    Combinations of Audio Effects

    Parallel Effects and Parallel Compression

    Sidechaining

    Ducking

    De-Esser Sidechain Compression for Mastering

    Multiband Compression

    Dynamic Equalization

    Combining LFOs with Other Effects

    Discussion

    Building Audio Effect Plug-Ins

    Plug-In Basics

    Programming Language

    Plug-In Properties

    The JUCE Framework

    Theory of Operation

    Callback Function

    Managing Parameters

    Initialization and Cleanup

    Preserving State

    Example: Building a Delay Effect in JUCE

    Required Software

    Creating a New Plug-In in JUCE

    Opening Example Plug-Ins

    File Overview

    PluginProcessor.h

    Declaration and Methods

    Variables

    PluginProcessor.cpp

    Audio Callback

    Initialization

    Managing Parameters

    Cleanup

    PluginEditor.h

    PluginEditor.cpp

    Initialization

    Managing Parameters

    Resizing

    Cleanup

    Summary

    Advanced Topics

    Efficiency Considerations

    Thread Safety

    Conclusion

    References

    Index

    Biography

    Joshua D. Reiss, Ph.D, is a senior lecturer with the Centre for Digital Music in the School of Electronic Engineering and Computer Science at Queen Mary University of London. He has bachelor’s degrees in both physics and mathematics, and earned his Ph.D in physics from the Georgia Institute of Technology. He is a member of the Board of Governors of the Audio Engineering Society, and co-founder of the company MixGenius. Dr. Reiss has published more than 100 scientific papers and serves on several steering and technical committees. He has investigated music retrieval systems, time scaling and pitch shifting techniques, polyphonic music transcription, loudspeaker design, automatic mixing for live sound, and digital audio effects. His primary focus of research, which ties together many of the above topics, is on the use of state-of-the-art signal processing techniques for professional sound engineering.

    Andrew P. McPherson, Ph.D, joined Queen Mary University of London as a lecturer in the Centre for Digital Music in September 2011. He holds a Ph.D in music composition from the University of Pennsylvania and an M.Eng in electrical engineering from the Massachusetts Institute of Technology. Prior to joining Queen Mary, he was a postdoc in the Music Entertainment Technology Laboratory at Drexel University, supported by a Computing Innovation Fellowship from the Computing Research Association and the National Science Foundation (NSF). Dr. McPherson’s current research topics include electronic augmentation of the acoustic piano, new musical applications of multi-touch sensing, quantitative studies of expressive performance technique, and embedded audio processing systems. He remains active as a composer of orchestral, chamber, and electronic music, with performances across the United States, Canada, and the UK at venues including the Tanglewood and Aspen music festivals.

    "This book strikes a great balance between theory and get-your-hands-dirty applications. You get the essential math that deepens your understanding, but not so much that it discourages the motivated reader. The book is rich with actual examples—working code—so that you can build and hear functioning effects right away. The strong orientation to families of effects found in every recording studio means that readers of this book can look forward to making a full set of useful, relevant, real-world effects. The theory is just enough to arm you with the power to innovate and create, so you learn how to do what is shown in the book and, more importantly, to make your own extensions, variations, and inventions."
    —Alex U. Case, University of Massachusetts Lowell, USA

    "Audio Effects: Theory, Implementation and Application is a fascinating new book on audio processing algorithms. It starts from basics of digital audio engineering and signal processing, and then continues to explain in detail the most important audio effects algorithms. I very much like the chapter on delay-line effects, which gives a great overview of all the well-known methods, such as slapback and ping-pong delay effects, and flanging and chorus algorithms. This book not only explains the basic idea and applications of each method, but also briefly shows the mathematics in the background of all techniques. I much enjoyed reading the historical anecdotes about the origins of some audio effect techniques. Every chapter ends with a compact set of problems, which makes this book very useful as a textbook. Both easy and challenging problems are included."
    —Vesa Välimäki, Aalto University, Esbo, Finland

    "This is a clear and concise guide to the details and applications of audio signal processing. The mathematical treatment of the subject is rigorous yet accessible, and problems to test understanding are included at the end of each chapter. Code examples in C++ are provided."
    —Jez Wells, University of York, UK

    "Audio Effects: Theory, Implementation, and Applications is a great book for those who are excited about the technical side of audio effects. Newcomers can gain a basic understanding of each of the topics and advanced students can take their understanding to the next level. The diagrams and formulae are in-depth and also function as a great one-stop reference on the subject."
    —Craig Abaya, San Francisco State University, California, USA

    "In the book, audio signal processing is explained in a very nice and smart way. Mentioning and explaining system theoretic aspects of basic processing structures helps readers to understand them in detail. Besides that, the application of these structures in music and audio in general is described in great detail, and in a very motivating manner. The authors start with simple structures (e.g., with constant parameters), allowing for a simple entry. Afterward, variants (e.g., by allowing the parameters to be changed in a periodic fashion) are described that show how structures are used in practice. Additional C-code examples help if readers really want to get hands-on experience when implementing audio processing schemes."
    —Gerhard Schmidt, Kiel University, Germany

    "... one of the best-written, best-structured, and most complete books on the topic of audio processing. ... The book uses dedicated chapters for a wide range of effects that take place in the time-domain (delay, reverberation, phase vocoder), the frequency domain (filters, Doppler effects, equalizers) or the realm of dynamics (overdrive, modulation, compression, etc.) and in each instance provides the theory of mathematical foundation using sophomore-level engineering math, clear and effective figures, excellent examples and exercises, as well as a short paragraph akin to a “did you know?” entry that lightens the reading. Whenever appropriate, the authors also include programming examples. From the excellent introduction to the final chapter (dedicated to building software plug-ins for some of the popular digital audio workstations environments), the book exalts clarity of thought and of presentation. ... What this book offers is an in-depth guide to how audio effects can be designed, calculated, and implemented in software. It is an effective text for college-level students in electrical engineering (or computer science) who have a passion for audio. ... Every reference book should have a good bibliography and reference section, and in this regards the readers will not be disappointed either. The references are both broad and deep, and they are extremely current. ... Personally I would not hesitate to spend the money on this work, as I can see annotating a lot of the pages (especially the code portions). ... a book of this quality should have a spot on an engineer's bookshelf."
    —Dominique J. Chéenne, Columbia College Chicago, Illinois, USA, from Noise Control Engineering Journal, November-December 2014

    "... presents the application and implementation, from a technical approach, of the gamut of audio effects with a balanced focus on the math and science involved. ... There are a large number of well-placed references throughout the book for further reading or expanded research into filters and DSP effects. ... I would recommend this book to anyone interested in a behind-the-scenes look at how our modern DSP-based effects do their magic. The book also will help with understanding the math and concepts related to modern DSP-based effects."
    —David Brown, Santa Ana, California, USA, from the Journal of the Audio Engineering Society, Vol. 63, No. 9, September 2015