Unit Selection TTS Database Indexing Techniques
In concatenative unit selection Text-to-Speech (TTS), speech is synthesized by piecing together small segments of recorded audio from large acoustic databases. Audible glitches—such as sudden shifts in pitch, volume, or spectral characteristics—occur when concatenated units do not match cleanly at their boundaries. To generate smooth speech in real time without exhaustive, computationally prohibitive searches, systems rely on specialized database indexing techniques to quickly retrieve candidates that minimize both target cost (mismatch with the desired phonetic context) and join cost (discontinuity between adjacent units).
Classification and Regression Trees (CART)
One of the most foundational indexing mechanisms in unit selection is phonetic and prosodic decision trees, commonly implemented as Classification and Regression Trees (CART). Because comparing every audio unit in a database of several gigabytes is impractical, CART partitions the candidate space hierarchically based on linguistic and context questions (such as preceding phoneme, stress, syllable position, and pitch accent).
At runtime, the target specification travels down the decision tree to a leaf node containing a clustered subset of acoustically similar units. By narrowing the initial candidate pool exclusively to units that share tight acoustic and prosodic behaviors, CART indexes substantially eliminate large spectral jumps and pitch mismatches before sequence evaluation begins.
Spatial and Multidimensional Metric Trees (KD-Trees)
For continuous acoustic features such as fundamental frequency (\(F_0\)), duration, and Line Spectral Pairs (LSPs), acoustic databases employ multi-dimensional space-partitioning structures like KD-trees and vantage-point trees.
Instead of relying solely on categorical phonetic labels, units are indexed as points in a high-dimensional feature space. When a target unit requires a specific pitch trajectory and spectral shape, the system performs a k-nearest neighbor (\(k\)-NN) query within the KD-tree. This geometric indexing guarantees that selected units are within tight Euclidean tolerances of the intended sound, suppressing mid-phrase timbre shifts and unnatural intonational peaks.
Pre-computed Join Cost Matrices and Boundary Indexing
Calculating the spectral discontinuity at the boundaries of adjacent units during runtime introduces latency that can force TTS systems to prune search paths prematurely, leading to suboptimal, glitch-prone joins. To circumvent this, databases utilize pre-computed join cost indexes.
Developers compute spectral distances (using metrics such as Mahalanobis distance or Mel-Frequency Cepstral Coefficients distance) between potential boundary pairings offline. These values are stored in sparse lookup matrices, indexed by left- and right-boundary unit identifiers. When evaluating the Viterbi search graph, the engine pulls boundary costs directly from cache-friendly indexed tables, enabling the dynamic programming algorithm to thoroughly evaluate smooth boundary paths without timing out.
Locality-Sensitive Hashing (LSH)
In very large voice corpuses containing tens of hours of speech, tree-based indexing suffers from the "curse of dimensionality." Locality-Sensitive Hashing (LSH) addresses this by mapping high-dimensional acoustic vectors into discrete hash buckets, ensuring that acoustically similar segments collide with high probability.
By querying the hash table for a specific boundary profile, the synthesis engine retrieves candidate units with near-identical boundary spectra in sub-linear time. This guarantees that candidates selected for concatenation share overlapping acoustic properties, directly reducing the audible phase and energy jumps that cause clicking and popping noises.
Dynamic Viterbi Search Pruning and Lattice Indexing
Once candidate units are retrieved, they form a state lattice where the optimal sequence is found using the Viterbi algorithm. Indexing the transition probabilities and path constraints into graph topologies allows search algorithms (such as beam search) to prune erratic branches dynamically.
By indexing units that possess natural, consecutive recordings from the original corpus as preferred "zero-cost" joins, the database search strongly biases toward retrieving intact multi-phone segments (such as words or entire syllables). Reusing continuous audio fragments sidesteps synthesis joins entirely, providing the highest fidelity output with minimal acoustic disruption.