I have two speech signals: one with a man reading a passage, and one with a woman reading the same passage.

I want to synchronize these signals so that, for each word, their readings line up. The problem is that the differences in the signals are heterogeneous. Sometimes, the man will read a word slightly faster, and sometimes the woman will read the word faster. The length of their pauses could similarly be different on a per-pause basis.

Is there a slick automatic way of syncing these that's robust to noise?

My guess at a solution algorithm is to

  1. Find the segment of the signal containing the next word in the male signal, and similarly for the female signal.
  2. Stretch/contract the male/female segments to align in length, and then move onto the next word.

Obviously, when I say stretch/contract, I mean without changing the pitch.


I've found the answer. It's Dynamic Time Warping, which is a play on the edit distance algorithm. A python implementation for audio signals can be found here.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.