What Is Mel-Cepstral Distortion (MCD) in TTS?
Mel-Cepstral Distortion (MCD) is an objective metric used to evaluate the acoustic quality and spectral accuracy of synthesized speech compared to a ground-truth human recording. By measuring the distance between two sets of Mel-Cepstral Coefficients (MCEPs), MCD provides an automated way to assess how faithfully a Text-to-Speech (TTS) model reproduces the spectral envelope and timbre of a target voice. This guide explains the purpose of MCD, details the step-by-step mathematical calculation used to compute it, and highlights how to interpret the resulting values in speech synthesis workflows.
Understanding Mel-Cepstral Coefficients (MCEPs)
To understand MCD, one must first understand Mel-Cepstral Coefficients (MCEPs). In human speech production, sound is modeled as an excitation source (vocal folds) passing through a linear filter (the vocal tract). The vocal tract forms the spectral envelope, defining phonetic content and individual vocal timbre.
Cepstral analysis isolates this spectral envelope from the pitch harmonics. By applying the mel scale—a perceptual scale of pitches judged by listeners to be equal in distance—the frequency bins are warped to match human auditory sensitivity. MCEPs represent this warped spectral envelope compactly, typically retaining the lowest 13 to 25 coefficients (excluding the 0th coefficient, which primarily captures power/energy).
Why Use MCD to Measure TTS Accuracy?
Subjective listening tests, such as the Mean Opinion Score (MOS), are the gold standard for speech naturalness, but they are expensive, time-consuming, and prone to human bias. MCD acts as an objective, algorithmic counterpart that:
- Measures timbre reproduction and phonetic spectral fidelity.
- Allows researchers to monitor model performance during training iterations.
- Detects acoustic collapse, muffled frequency outputs, or inaccurate vocal tract approximations.
Step-by-Step Calculation of MCD
Calculating MCD involves three primary steps: feature extraction, temporal alignment, and distance computation.
1. Feature Extraction
Both the synthesized audio and the ground-truth reference audio are transformed into sequences of mel-cepstral vectors:
- The audio signals are split into overlapping frames (typically 20–25 ms frames with a 5 ms hop size).
- Mel-generalized cepstral analysis extracts \(D\)-dimensional vectors for each frame, represented as \(c_t\) for the target audio and \(\hat{c}_t\) for the synthesized audio.
- The 0th coefficient (\(c_0\)) is usually excluded from distance calculations to isolate spectral shape from overall volume differences.
2. Time Alignment via Dynamic Time Warping (DTW)
A synthesized utterance rarely matches the natural reference audio frame-for-frame due to variations in speaking rate and pause lengths.
To compare corresponding phonetic segments accurately:
- Dynamic Time Warping (DTW) is applied to find an optimal warping path between the two frame sequences.
- DTW aligns the \(T\) frames of the reference with the matching frames of the synthesized audio, minimizing artificial distance caused solely by duration differences.
3. Euclidean Distance and Decibel Conversion
Once aligned, the Euclidean distance between the MCEP vectors of each aligned frame pair is computed and scaled to decibels (dB).
The frame-level MCD at frame \(t\) is calculated as:
\[\text{MCD}_t = \frac{10\sqrt{2}}{\ln 10} \sqrt{\sum_{d=1}^{D} \left(c_{t,d} - \hat{c}_{t,d}\right)^2}\]
Where:
- \(D\) is the number of cepstral dimensions analyzed.
- \(c_{t,d}\) is the \(d\)-th coefficient of the reference frame at time \(t\).
- \(\hat{c}_{t,d}\) is the \(d\)-th coefficient of the synthesized frame at time \(t\).
- \(\frac{10\sqrt{2}}{\ln 10} \approx 6.14185\) is the scaling factor converting the natural log cepstral distance to decibels (dB).
The overall MCD for the entire utterance is the average of all aligned frame-level distances:
\[\text{MCD} = \frac{1}{T} \sum_{t=1}^{T} \text{MCD}_t\]
Where \(T\) is the total number of aligned frames.
Interpreting MCD Scores
MCD yields a non-negative value measured in decibels (dB):
- 0 dB: A theoretical identical match in spectral envelope.
- Below 6.0 dB: High spectral similarity, typical of modern high-performing neural TTS architectures and accurate voice cloning pipelines.
- 6.0 to 8.0 dB: Moderate accuracy; phonetic structure is generally intelligible, but subtle vocal timbre details may sound muffled or artificial.
- Above 8.0 dB: Noticeable acoustic divergence, signifying inaccurate formant tracking, missing high-frequency details, or poor phonetic rendering.
Practical Limitations
While MCD is a vital diagnostic tool for spectral envelope matching, it does not provide a complete measure of voice naturalness:
- Ignores Prosody: Because DTW aligns durations and MCEPs exclude the fundamental frequency (\(F_0\)), MCD does not penalize robotic pitch or unnatural pauses.
- Phase Insensitive: MCD evaluates magnitude spectra, ignoring phase anomalies that may cause robotic artifacts in the generated waveform.
Consequently, MCD is most effective when paired with complementary metrics, such as \(F_0\) Root Mean Square Error (RMSE) for pitch, duration error metrics, and perceptual listening tests.