DDSP's Harmonic synthesizer sums band-limited sinusoidal harmonics weighted by a learned distribution
The Harmonic processor takes three frame-rate tensors from a neural network: overall amplitude, harmonic distribution (the relative weight of each harmonic), and fundamental frequency (f0_hz). It applies exp_sigmoid to ensure positive amplitudes, normalizes the harmonic distribution to sum to 1, and zeroes out harmonics above the Nyquist frequency. Sample-rate audio is then generated by resampling frame-rate envelopes and accumulating phase via tf.cumsum. The harmonic model is a classic source-filter decomposition but fully differentiable: f0 controls pitch, amplitude controls loudness, and harmonic_distribution controls timbre. Because harmonics are always integer multiples of f0, the model naturally enforces pitch coherence.
Examples
harmonic = ddsp.synths.Harmonic(n_samples=64000, sample_rate=16000)
audio = harmonic(amplitudes, # [batch, n_frames, 1]
harmonic_distribution, # [batch, n_frames, n_harmonics]
f0_hz) # [batch, n_frames, 1]
Assessment
What happens to harmonic amplitudes above the Nyquist frequency? Why must harmonic_distribution be normalized (sum to 1) before synthesis?