Sequences, streaming data, robotics, and scientific extensions · Entry index · SEQ008 · Architecture
DDSP: differentiable digital signal processing
A framework that places differentiable signal-processing components inside learned audio systems. Instead of asking a generic decoder to learn all waveform structure, it predicts controls for interpretable synthesis…
In CodeSplash
Documented in the Academy only. There's no Set up button.
- Availability
- Explained here
- Code example
- Component demo, not a trained model
- Who ran it
- CodeSplash's own run
- CodeSplash's run
- The reference's example ran in Python and R here, and they agree.
- The reference's record
- Python: Ran in the reference's review, but on a different version of the code. R: Reviewed but not run: R wasn't available to the reference's authors.
Purpose
A framework that places differentiable signal-processing components inside learned audio systems. Instead of asking a generic decoder to learn all waveform structure, it predicts controls for interpretable synthesis operations such as harmonic oscillators and filtered noise.
Question / hypotheses
Can learned controls reproduce sound through a chosen differentiable synthesis model while retaining meaningful parameter control? The framework has no inherent H0/H1; assess reconstruction, controllability, and model mismatch.
Architecture / computational structure
An analysis network estimates latent or explicit controls; differentiable oscillators, filters, and optional effects synthesize waveform output; spectral losses propagate gradients through the signal chain. A control’s physical name does not guarantee it is identifiable from every input recording.
Assumptions
The synthesizer’s inductive bias must fit the source. Harmonic-plus-noise representations suit some pitched sounds but not every transient or polyphonic mixture. Pitch/control estimates, anti-aliasing, and sample-rate conventions strongly affect both training and interpretability.
Formula / computational definition
A harmonic component can be written , with phase increments determined by fundamental frequency. A typical reconstruction objective sums magnitude and log-magnitude spectrogram discrepancies at multiple resolutions; the exact synthesis graph and losses define the implementation.
Parameters and notation
Learned parameters: control encoder/decoder networks and any trainable signal-processing components. Inferred controls: pitch, amplitude envelopes, harmonic weights, and noise-filter parameters. Hyperparameters include harmonic count, STFT resolutions, control rate, loss weights, and aliasing constraints.
Fitting, fine-tuning, and adaptation
Fit control networks with differentiable rendering and verify gradients through each signal component. For a new instrument, adapt synthesis controls before changing the entire decoder graph. Freeze or supervise pitch where justified, and compare inferred controls with known synthetic parameters before trusting interpretations on real recordings.
How to use and calibrate
Assess spectral/audio quality, pitch and envelope accuracy, parameter intervention behavior, and out-of-family sounds. Plot harmonic structure and control trajectories. Perceptually similar sounds can arise from different controls, so reconstruction alone cannot establish a unique physical explanation.
Example application
Learn or inspect controls for a monophonic instrument, then vary fundamental frequency while holding the amplitude envelope fixed.
Interpretation / pitfalls
Watch out
Python: the authors’ DDSP implementation or custom differentiable oscillators/filters. R: reticulate to training components; base R can generate the fixed harmonic example. The example is a synthesis primitive with known controls, not a trained audio reconstruction model.
Python and R code examples (dependencies/validation)
Python uses NumPy and the shared mse helper when called; base R uses the shared helper when called. Validation: Python component executed; R companion reviewed, not executed. Scope: the specific component described above, not the full model or its training.
Python and R
The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.
Component demo, not a trained model — synthetic mathematical component, not a full-model implementation
Shared setup for this chapter
import numpy as np
def mse(a,b):
a,b=np.asarray(a),np.asarray(b)
if a.shape!=b.shape or a.size==0:
raise ValueError("MSE needs nonempty equal shapes")
return float(np.mean((a-b)**2))
fs=8000; time=np.arange(800)/fs; f0=220.; amplitudes=np.array([1.,.3,.1])
harmonics=np.arange(1,4); waveform=(amplitudes[:,None]*np.sin(2*np.pi*harmonics[:,None]*f0*time)).sum(0)
result={"rms":float(np.sqrt(np.mean(waveform**2))),"highest_partial_hz":int(harmonics[-1]*f0)}
print(result)
Component demo, not a trained model — synthetic mathematical component, not a full-model implementation
Shared setup for this chapter
mse <- function(a,b) {
stopifnot(length(a)>0L, identical(dim(a),dim(b)), length(a)==length(b))
mean((a-b)^2)
}
fs <- 8000; time <- (0:799)/fs; f0 <- 220; amplitudes <- c(1,.3,.1); harmonics <- 1:3
waveform <- colSums(amplitudes*sin(2*pi*outer(harmonics*f0,time)))
result <- c(rms=sqrt(mean(waveform^2)),highest_partial_hz=tail(harmonics,1)*f0)
print(result)
Sources
- Source 1arxiv.org
From the CodeSplash reference, entry SEQ008.