Phase Unwrapping in TTS Direct Waveform Synthesis
Direct waveform synthesis in experimental Text-to-Speech (TTS) pipelines aims to generate high-fidelity audio signals directly in the frequency or time-frequency domain without relying on computationally heavy, black-box neural vocoders. A central obstacle in these architectures is accurately modeling and reconstructing the phase spectrum alongside magnitude. Phase unwrapping resolves the mathematical ambiguities of circular phase representations, allowing signal processing pipelines and neural models to construct smooth, physically coherent phase trajectories that eliminate destructive interference, buzzing, and harsh temporal artifacts in the synthesized voice.
In traditional TTS pipelines, the acoustic model predicts an intermediate representation—typically an 80-band mel-spectrogram—which intentionally discards phase information. A neural vocoder (such as HiFi-GAN or WaveNet) or an iterative algorithm (such as Griffin-Lim) then reconstructs the full-band time-domain waveform. While effective, this decoupling adds architectural complexity, latency, and error propagation. To simplify the stack, experimental direct waveform synthesis models predict the full complex Short-Time Fourier Transform (STFT), comprising both magnitude and phase components.
The fundamental problem with raw STFT phase values is that they are inherently wrapped to the principal interval \([-\pi, \pi)\). Because phase wraps modulo \(2\pi\), standard regression loss functions (such as Mean Squared Error or L1 loss) fail to measure true acoustic distance; a prediction of \(\pi - \epsilon\) and \(-\pi + \epsilon\) are practically identical in physical space, yet a naive loss penalizes them as maximally distant. Furthermore, the discrete jumps of \(2\pi\) present severe discontinuities that neural networks struggle to generalize without producing robotic timbres or dispersion artifacts.
Phase unwrapping addresses this by tracking phase changes across consecutive frequency bins and time frames, producing an unbounded, continuous phase trajectory:
- Instantaneous Frequency and Group Delay Derivation: Unwrapping along the time axis yields the instantaneous frequency (the temporal derivative of phase), while unwrapping along the frequency axis yields the group delay (the negative spectral derivative of phase). Both representations transform modulo-\(2\pi\) jumps into continuous, meaningful physical quantities that modern neural architectures can smoothly predict.
- Differentiable Loss Formulations: In end-to-end training pipelines, algorithms incorporate differentiable phase unwrapping to evaluate continuous phase differences. By measuring errors on unwrapped phase or its derivatives, the loss function penalizes structural mismatches in waveform shape rather than arbitrary wrap boundaries.
- Harmonic and Formant Consistency: Human speech relies heavily on harmonic alignment. If the phase across adjacent harmonics drifts out of coherence due to wrapping errors, the vocal tract resonances blur, causing a degraded, "phasey," or hollow acoustic quality. Unwrapping ensures that harmonic phase offsets remain stable, preserving the naturalness of voiced segments.
Despite its necessity, integrating phase unwrapping into experimental TTS systems presents specific challenges:
- Zero-Magnitude Singularities: In unvoiced regions, pauses, or spectral notches, the magnitude approaches zero, making phase undefined and mathematically chaotic. Phase unwrapping algorithms can rapidly accumulate errors in these low-energy regions, corrupting neighboring speech frames.
- Two-Dimensional Ambiguity: True STFT phase is a two-dimensional grid across time and frequency. Unwrapping path dependency means unwrapping across time first and then frequency can yield different results than unwrapping frequency first, necessitating path-independent or gradient-based unwrapping strategies.
Consequently, experimental direct synthesis pipelines frequently bypass explicit 2D spatial unwrapping at inference time. Instead, they use phase unwrapping during training to supervise intermediate targets—such as instantaneous frequency deviations or complex STFT derivatives—allowing the network to implicitly learn continuous phase dynamics that invert cleanly via an inverse STFT (iSTFT) into clear, natural human speech.