공부 정리 블로그

[신호처리-15]-TTS (음성 합성) 본문

대학원 수업/음성신호

[신호처리-15]-TTS (음성 합성)

따옹 2023. 5. 31. 21:35

TTS 기본 원리 / 딥러닝 이전의 기본 원리 이해

 

Text-to-Speech (TTS) Synthesis (1)

• Word or phrase concatenation(phrase의 경우 관용적인 문구도 활용하게 되므로 문장이 제한됨)

▫ Limited vocabulary

word를 연결하면 되지만 단어 수가 제한됨

▫ Applications

 Warning messages

 Operating instructions

 

• Arbitrary TTS(voc size에 대한 restriction 이 없음, 한 번도 보지 않은 단어도 TTS를 할 수 있음)

물론 퀄리티는 떨어질 수 있음

▫ Unrestricted vocabulary including words never met before

▫ Applications

 Reading mail or a book/newspaper

 Reading back of typed text for proofreading(타이핑한 버튼이 무엇인지 알려줌 ex)2,4,6,7)

 Give information to someone concentrating elsewhere(사용자가 다른 쪽에 집중해야할 때 ex)운전 중인 사용자는 시야는 교통상황에 집중되어 있을때, 차 내부 정보에 대해서는 TTS를 통해 생성해낼 수 있음(speech로 들려줌))

▫ Requires lots of computational power to sound good.(소리를 좋게 만드려면 많은 계산량이 필요함)

 

Text-to-Speech (TTS) Synthesis (2)

arbitrary TTS를 하려면...

• Use sequences of subword units.(word보다 낮은 단위, 여기에서 seq생성)

▫ Flexibility for extended or even arbitrary vocabularies

 

• Basic components

▫ Text preprocessing

 Translate the text string of characters into a new string with ambiguities resolved. (Ex. “Dr.” into “Doctor” or “Drive”) 여러가지 경우를 가질 수 있으므로 명확하게 해주는 게 필요

▫ Text to phonetic-prosodic translation(텍스트 정보를 phonetic-prosodic 정보로 변환해줘야함, 어디서부터 어디까지 끊어읽어야 하는지(pharsing), 의미/문법 단위로 잘라 읽음)

 Parsed(끊어 읽어야하는 곳을 정해줌) to determine syntactic (문법구조 : and, to some extent, 의미론적 : semantic) structure.

 자르고 난 뒤, Generate prosodic information(TTS는 기본적으로 message정보를 전송하는(말로 바꿔서) 하지만 text 자체는 운율 정보가 없으므로 이런 부분을 어떻게 할 것인가) and preliminary strings of sound unit

 Determine quantities such as pitch(높으면 여성, 낮으면 남성), duration(소리의 길이를 얼마나 할 것인지(길게 발화를 시킬지), and amplitude(소리를 얼마나 세게 synthesys 할 것인지)=> 이런 정보들을 quantity로 생성해야함, 각각 얼마나 가져갈 것인가가 매우 중요한 정보

▫ Speech generation from the signal-processing component

신호처리 성분으로부터 speech generate -> 이 모델이 딥러닝

pitch , duration, amplitute를 분석하고 아래 모델로 딥러닝하는 경우가 많음

 

The Sound Unit to Speech Translation

• Articulatory synthesis 물리적으로 발음을 (성도, 성대 등을 이용해서) 만들어냄

▫ Physical models for articulators and their movements

 The difficulty of deriving the physical parameters by analysis(세팅해줘야하는 파라미터를 정확하게 추정하는 게 현실적으로 쉽지 않음)

 The large computational resources required for synthesis (이걸 가지고 합성하면 계산량이 어마어마함. 실용적이기 보단 science 관점에서 관심이 감)

 More interesting from a scientific standpoint than a practical one

 

• Source-filter synthesis (synthesis by rule) (가장 익숙한 모델로 합성해봄)

▫ Formant synthesis(이 정보로 생성)

 Characterize the spectral shape.(envelop에 의존)

 Develop rules that handled the parameter modification for a particular context.

특정 문맥에 따라 rule 생성

 Can be specified in terms of cepstrum and linear prediction.(formant를 추출하는 방식들)

 

• Concatenative synthesis(기존에는 정보들을 가지고 filtering 을 통해서 (allpole filter))

▫ Direct-time waveform storage and parametric storage for speech segments(아예 Direct-time waveform을 memory에 가지고 있고 필요한 문자열에 따라서 연결해서 붙이는 방법)

 

Fant’s OVE II Speech Synthesizer

formant frequency cascade 방식

초창기 모델

pulse (voiced) generate-> noise(un voiced) 생성

두 개의 성분이 더해져서 계속적으로 filter를 거치게 되면(Vowel network) 

Vowel network, Nasal network -> 2가지를 합친 경우,

Fricative and plosive network pulse, noise 만 한 경우로 3가지 채널로 voice를 synthesys

 

Holmes Parallel-Formant Synthesizer

formant frequency 모두 평등하게 정보를 전달함 -> 경우의 수가 매우 다양해 짐

모든 것을 test 못 해보는 경우도 생길 수 있지만 각각의 정보들이 적절하게 조합되면 좋은 특성의 speech 생성 가능

 

위의 두 방법은 생각보다 성능이 좋지 않음 -> 1차적인 한계 때문

 

Reasons for Inferior Speech한계점들

• Some claims of the primary limitation

▫ Imprecise simulation of the excitation function(excitation  fun 의 부정확한 시뮬레이션)

▫ Small spectral differences(작은 것에도 민감하게 반응)

▫ The prosodic contours make synthetic speech sound unnatural for many utterances.

 

• The Klatt synthesizer (1) 한계를 극복하기 위해 개발

▫ Compromise between the designs of Fant and Holmes

 Incorporated Fant’s generation of voiced sound by using cascade formant resonators

 Use a channel vocoder structure for the fricative sounds.

 

하나로 합침

 

aspirarion (프랑스어 'r' 발음)

voiced - cascade 한 방식으로

unvoiced - parallel 한 방식으로

 

• All-pole synthesizer derived from formant analysis

▫ That of the vowel portion of Fant’s OVE II (cascade 방식)

general 한 모델 time delay 에 대해 적절한 wieght sum이 되어 생성이 되는 것이 아닌가.

▫ Cascade of second order poles

 

• All-pole synthesizer derived from linear predictive coding analysis 

 

• Fixed poles and variable zeros derived from channel vocoder analysis

pole, zero를 다 설정해줘야해서 걸리적 거림

▫ The bandpass filters are fixed but their gains are variable.

 

• Variable poles and variable zeros derived for a parallel-formant synthesizer

▫ The filters themselves are allowed to vary.

 

Concatenative Methods (1)

음성을 단순히 연결해서 씀

• Concatenative approaches

처음엔 단순하게 ㄱ ㅏ ㄴ ㅏ 가 있을 때,

'ㄱ' 발음 다음 'ㄴ' 을 연결해서 붙이는 방법이 있지만 실제 성능을 좋지 않음

왜? 지점 ㄱ -> ㅏ 의 transition 상황으로 신호의 변이가 심해서, 'ㄱ', 'ㅏ' 특성이 많이 다른데, 이때  연결해서 붙이면 discontinuity가 도드라지면 자연스로운 음성을 생성하기 쉽지 않음 

▫ Speech waveforms are stored and then concatenated during synthesis.

 

• Voiced sounds

▫ Compressed by manipulating a pitch period waveform to reduce the number of signal samples that were required to have a power spectrum that was sufficiently close to the original

 

• Unvoiced sounds

▫ Rely on a table of prototypical waveforms.

 

더 좋은 방법이 없을까?

Diphone Synthesis

중간에 끊어진 구간이 변화가 거의 없는 특정 발음이 되고 있는 시점

-> 변화가 거의 없다보니 위상 (phase)만 맞춰서 해주면 소리의 왜곡이 최소가 됨

 

• Stringing together phoneme segments sounds terrible

▫ Get large discontinuities at the boundaries. -> 소리를 어색하게 만든다

 

• Diphones

▫ Go from the middle of one phoneme to the middle of the next.

 “mat"

4 section : 묵음에서 m의 중간/ ~ e의 중간/ e~ t의 중간 / t의 묵음

중간에 끊어진 구간이 실제로는 변화가 거의 없는 특정 발음이 되고 있는 시점 => phase (위상)을 맞춰주면 왜곡이 최소화

 

Diphone Recoding

• 43 phonemes => 43^2 = 1849 diphones(이 만큼 sample 필요)

▫ Some phoneme pairs never occur in English words.(실제로는 이런 경우가 잘 없음. 두개가 연거푸 나오지 않는 것들이 많다 , 가짓수 줄이는 요인)

▫ Some phoneme pairs vary according to context.(어떤 Pair냐에 따라 다양한 발화가 생성되는 경우가 있음 (가짓수 늘리는 요인))

 Need several versions.

▫ Typically need an inventory of 2000 to 3000 elements.

 

• Record all the diphones from a single speaker.

하나의 single speaker에 대해서 녹음을 해야함(감정상태, 발화를 길게 하고 싶을 때, 짧게 하고 싶을 때..)

 

• Need to vary the pitch, duration, and amplitude of each phoneme to fit in with the prosody.

하지만 이걸 조절한다고 해서 masseage를 잃어버리면 안됨

format frequency(메세지에 직접적으로 관련있는 것)는 변화가 없도록 변화 시켜야 함

▫ We must not affect the formant frequencies.

 We use unaltered chunks of the waveform without stretching or shrinking the time axis.

 

 

Pitch Variation

pitch를 올린다 -> pitch period를 짧게 한다

• Change the pitch by chopping out or duplicating bits from the lowest energy portion of each pitch cycle.

To avoid a discontinuity, we fade gradually from one waveform segment to another.

weighted sum을 통해서 바꾸는 과정을 진행

• Altering the pitch affects the duration, too.

 

pitch를 바꾸었는데 duration 자연스럽게 바뀜

pitch만 바꿔야하는데, formant frequency도 바뀜, 이때, pitch는 유지하면서 pitch period를 줄이려면

formant

formant frequency 유지하면서, pitch를 줄이려면, 변화가 제일 약한 가운데 부분에 해당하는 것을 잘라서 버림..

중간에 채움

Duration Variation

pitch를 바꾸지 않고 duration 만 바꾸자

formant가 있는 부분이 중요하므로, 최대한 유지시키기 위해서 formant 사이에 하나 더 놓아줌 =>  4개 -> 5개

로 duration 을 키울 수 있음

 

• Change duration by duplicating or omitting entire pitch cycles.

▫ To increase the duration by 10% you would repeat every 10th pitch cycle 늘리는 방법

▫ To reduce the duration by 10% you would delete every 10th pitch cycle 줄이는 방법 (아예 formant를 탈락시킴)

• Snip and join waveforms at the center of pitch cycles where the energy is lowest.

 

문제는 pitch 가 잘 안 보이는 unvoiced sound

• For unvoiced segments of speech there is no pitch cycle.

▫ Find a pseudo pitch by finding the time delay at which the speech is most correlated with itself.

가짜 pitch를 찾아서 그걸 확인해 볼 수 있음(corr이 가장 높은 구간)

▫ If there is very little correlation then it doesn’t matter where you snip it.

주기성이 없다면 어디를 자르든 크게 영향은 없다