DDSP: Differentiable Digital Signal Processing

Jesse Engel, Lamtharn Hantrakul, Chenjie Gu, Adam Roberts

TL;DR

DDSP (Differentiable Digital Signal Processing) is a library that integrates classic, interpretable signal processing elements—like oscillators and filters—directly into deep learning architectures. By leveraging the strong inductive biases of DSP, DDSP achieves high-fidelity audio synthesis with models that are significantly smaller, faster, and more interpretable than standard autoregressive or GAN-based approaches.

What Problem Does This Paper Address?

Generative audio modeling has traditionally been split into two camps. On one side, we have neural synthesis models (like WaveNet or GANSynth) that generate raw waveforms or spectrograms. While powerful, these models are often "black boxes" that require massive amounts of data and parameters to learn basic periodic structures. They struggle with issues like phase alignment and spectral leakage because they don't "know" that sound is often composed of oscillations.

On the other side are traditional vocoders and synthesizers. These are highly efficient and interpretable because they are built on physical principles of sound. However, they are difficult to integrate into modern machine learning workflows because they are typically not differentiable, limiting their expressivity and preventing end-to-end training.

Figure 1: Challenges of neural audio synthesis. Full description provided in Section 1.1.

DDSP bridges this gap by making these classic DSP components fully differentiable, allowing them to be used as layers within a neural network.

Methods

The authors introduce a suite of differentiable DSP modules, including harmonic oscillators, envelopes, and LTV-FIR (linear-time-varying finite-impulse-response) filters.

To demonstrate the power of these modules, they implement a DDSP Autoencoder. The architecture consists of:

  1. Encoders: Extract fundamental frequency ($f_0$), loudness ($l$), and a latent timbre vector ($z$) from the input audio.
  2. Decoder: A relatively simple neural network (MLP and GRU) that maps these features to control parameters for the DSP modules.
  3. DSP Synthesizer: A combination of an additive synthesizer (summing sinusoids for harmonic content) and a subtractive synthesizer (filtering white noise for stochastic content).
  4. Reverb: A differentiable module that applies a long impulse response via FFT convolution to simulate room acoustics.

The entire system is trained end-to-end using a multi-scale spectrogram loss, which compares the synthesized audio to the original across multiple time-frequency resolutions.

Figure 2: Autoencoder architecture. Red components are part of the neural network architecture, green components are the latent representation, and yellow components are deterministic synthesiz- ers and effects. Components with dashed borders are not used in all of our experiments. Namely, z is not used in the model trained on solo violin, and reverb is not used in the models trained on NSynth. See the appendix for more detailed diagrams of the neural network components.

Datasets

The models were evaluated on two primary datasets:

  • NSynth: A large-scale dataset of musical notes across various instrument families (strings, brass, woodwinds, etc.).
  • Solo Violin: A custom dataset consisting of 13 minutes of expressive, monophonic violin performances by a single player, recorded in a consistent acoustic environment.

Key Insights and Ideas

  • Inductive Bias is a Cheat Code: By using an oscillator, the model doesn't have to learn how to generate a sine wave from scratch; it only needs to learn how to control its frequency and amplitude. This makes the learning task significantly easier.
  • Interpretability by Design: Because the latent variables ($f_0$, loudness, timbre) correspond to physical properties, users can manipulate them independently. You can change the pitch of a recording without affecting its timbre, or "dereverberate" a recording by simply bypassing the reverb module during synthesis.
  • Efficiency: Because the DSP modules do the heavy lifting of signal generation, the neural network "controller" can be very small. The authors demonstrate a "Tiny" model with only 240k parameters that still produces high-quality results.
  • Extrapolation: Standard neural models often fail when asked to generate notes outside their training range. DDSP models can extrapolate gracefully; for example, shifting a violin's $f_0$ down an octave results in a sound that naturally resembles a cello.

Key Results

  • State-of-the-Art Performance: The supervised DDSP autoencoder outperformed a SOTA WaveRNN baseline in resynthesis accuracy, particularly in tracking fundamental frequency ($f_0$ L1 error of 0.02 vs 1.00).
  • Model Size: DDSP models are roughly 10x to 300x smaller than comparable autoregressive models like WaveNet (6M-12M parameters vs 75M).
  • Timbre Transfer: The authors demonstrated "timbre transfer," where the pitch and loudness contours of a human singing are used to drive a violin-trained DDSP model, effectively making the violin "sing."

Limitations and Future Work

  • Monophony: The current work focuses on monophonic sources (one note at a time). Extending this to polyphonic audio (chords, full bands) is a significant next step.
  • Inharmonicity: The harmonic oscillator assumes integer multiples of the fundamental. While sufficient for many instruments, it doesn't perfectly capture the inharmonicity of stiff strings or bell-like sounds.
  • Deterministic Latents: The current autoencoder is deterministic. The authors suggest that incorporating stochastic latents (like in GANs or VAEs) could further improve the realism of complex textures.

For those interested in trying it out, the library is open-source and available at github.com/magenta/ddsp.

Summary updated

Abstract

Most generative models of audio directly generate samples in one of two domains: time or frequency. While sufficient to express any signal, these representations are inefficient, as they do not utilize existing knowledge of how sound is generated and perceived. A third approach (vocoders/synthesizers) successfully incorporates strong domain knowledge of signal processing and perception, but has been less actively researched due to limited expressivity and difficulty integrating with modern auto-differentiation-based machine learning methods. In this paper, we introduce the Differentiable Digital Signal Processing (DDSP) library, which enables direct integration of classic signal processing elements with deep learning methods. Focusing on audio synthesis, we achieve high-fidelity generation without the need for large autoregressive models or adversarial losses, demonstrating that DDSP enables utilizing strong inductive biases without losing the expressive power of neural networks. Further, we show that combining interpretable modules permits manipulation of each separate model component, with applications such as independent control of pitch and loudness, realistic extrapolation to pitches not seen during training, blind dereverberation of room acoustics, transfer of extracted room acoustics to new environments, and transformation of timbre between disparate sources. In short, DDSP enables an interpretable and modular approach to generative modeling, without sacrificing the benefits of deep learning. The library is publicly available at https://github.com/magenta/ddsp and we welcome further contributions from the community and domain experts.
BibTeX
@inproceedings{engel2020ddsp,
  author = {Jesse Engel and Lamtharn Hantrakul and Chenjie Gu and Adam Roberts},
  title = {{DDSP: Differentiable Digital Signal Processing}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
}
Figure