Spoken Language Processing

Spoken Language Processing is a branch of signal processing that deals with the analysis, synthesis, and manipulation of speech signals.

13 min readEryawan Presma Yulianrifat, Dr. Kurniawati Azizah, S.T., M.Phil. (Lecturer)

Introduction

The Field of Speech Processing study about speech signal and the methods to process it.

  1. Digital Speech Coding
  2. Speech Recognition
  3. Speech Synthesis
  4. Spoken Language Dialog System

Digital Speech Coding is the process of converting speech signals into digital format. Compress and reliably transmit speech in digital systems with quality/bit-rate trade-offs. The motivation is higher capacity (compression), better quality (error control/equalization), security (encryption), lower OAM cost.

Automatic Speech Recognition (ASR)

Speech Recognition is an interdisciplinary subfield of computer science that develops methodologies and technologies to enable the recognition and translation of spoken language into text by computers with the main benefit of searchability.

Conformer: Convolutional Transformer Encoder (2020). Seq2seq transformer with multi-headed self attention. Combines attention (global context) and convolution (local invariance).

conformer architecture

HuBERT: Hidden Unit BERT (2021). Self-supervised learning for ASR. Utilizing K-means clustering procedure to iteratively update cluster / quantization. Mix predicting quantized vectors for masked + unmasked outputs. Useful pre-training for ASR task and better on low resource datasets.

HuBERT

Whisper. Trained on 680,000 hours of multilingual and multitask supervised data collected from the web. It enables transcription in multiple languages, as well as translation from those languages into English.

whisper

SpeechBrain. Full ASR toolkit integrated with PyTorch.

speechBrain

Extracted Information from Speech.

  1. Recognition
  1. Speaker Recognition

Automatic Speaker Verification: D-vector Speaker Encoder GE2E. D-vector speaker encoder architecture (3 LSTM followed by linear projection) trained isong GE2E loss.

ge2e

LVCR: Large Vocabulary Continuous Speech Recognition. Dataset with ~64,000 words.

Is speechrecognition solved? Why study it vs use someAPI? In the last ~12 years

Understanding how ASR works enables better ASR-enabled systems.

Next generation of ASR challenges as systems go live on phones and in homes.

Speech Recognition Design Intuition

Text-to-Speech (TTS)

Text-to-Speech (TTS) is an NLP system that learns how a computer can read text or symbols and pronounce them by producing soundwaves automatically.

Application Example:

Tacotron-2 (2018). Seq2seq attention-based encoder-decoder. Only supports monolingual single-speaker. Does not model prosody explicitly.

tacotron

FastSpeech (2020). Non-autoregressive Seq2seq with length regulator and fully parallel transformer blocks.

fastspeech

Glow-TTS (2020). Flow-based & parallel generation.

glow tts

E2E-Prosody (2018) and Tacotron-GST (2018). To produce realistic speech, TTS system must implicitly or explicitly model the prosody. Add style tokens for prosody control.

e2e gst

VITS: Variational Inference with Adversarial Learning for end-to-end Text-to-Speech. VITS architecture (3 Transformer blocks) trained with adversarial loss.

vits

Spoken Language Dialog System (SLDS)

Spoken Language Dialog System (SLDS) is a system that converse by voice and take actions. Task oriented conversations.

Paradigm:

Speech Theory

Phonetic is a branch of linguistics that studies how humans produce and perceive sounds. Modern phonetics has three branches:

Phoneme is a mental representation of a sound, not necessarily a letter.When we swap a phoneme we change the word.

Phone is the minimal linguistic unit of phonetics. Is the phonetic representation of a phoneme (the actual sound)

Allophone. Different ways to produce the same phoneme while keeping the same meaning.

Phonetic Dictionary is a list of symbols to represent sounds in a language. There are some standard phonetic dictionary:

Pronunciation Dictionary. Words in their written orthography forms do not accurately represent the pronunciation. They need to be transcribed. Phonetic transcription provide more details on how the actual sounds are pronounced -> deal with phones. Phonemic transcription represent how people interpret such sounds -> deal with phonemes (G2P).

Speech Signal is a complex mixture of periodic, aperiodic and stochastic signals -> non-stationary in nature. In practise we assume that speech is stationary over a short interval.

Speech Signal Early Processing To process speech signals in a computer -> convert the analog continuous time form to a digital signal (.wav, AIFF, AU, .raw).

Speech Analysis is a process to find the acoustic feature representation of the original human speech waveform needed in speech processing, including TTS.

Acoustic Features include

Acoustic Representation

Formant Prediction. The formants (F2,F2,F3,F4, …) are usually defined as a broad peak or local maximum in the spectrum.

Pitch Prediction. The pitch of sound (F0) is one of the main characteristics of prosody. Pitch is directly related to intonation. F0 is used in a variety of tasks:

Low Resource Languages Task (LRL).

  1. Monolingual Single-Speaker TTS for LRL (MoSS TTS)
  2. Multilingual Multi-Speaker TTS for LRL (MLMS TTS)
  3. Zero-Shot Multilingual Multi-Speaker TTS for LRL (Zero-shot MLMS TTS)

Monolingual Single-Speaker TTS: Hierarchical Transfer Learning Architecture. Transitive transfer knowledge.

t2 hierarchical transfer

Multilingual Multispeaker TTS: Hierarchical Transfer Learning Architecture.

multilang multispeaker

Zero-Shot MLMS TTS: Hierarchical Transfer Learning for Zero-Shot MLMS TTS.

mlms tts

Deep Learning for Speech Processing

Symbolic AI and Machine Learning. symbolic vs ml

Learning Problem. Improve over task T with reespect to performance measure P as experience E increases. Task T, specific task that the computer/program has to be able to do

Deep Learning Approach Based on Training Type.

Basic Deep Neural Network (DNN) Architecture.

Input size vs Output size Task Variability. rnn process sequence

Seq2Seq Learning. Training a model to convert a sequence from one domain as input to a sequence in another domain as output.

Encoder-Decoder vs Attention-based Encoder-Decoder. Bottleneck encoder decoder:

The core idea of attention is to focus on the most relevant parts of the input sequence for each output

RNN and Transformers

Speech Sound

Sound is a distortion in air pressure traveling in waves that gets intrepreted by brain as sound.

Compression and Refraction. Increasing the air pressure is called compression while decreasing the air pressure is called rarefaction. Sound wave is a wave of compression and rarefaction.

sound wave
sound save spatial
  • HP: Compression
  • LP: Rarefaction

Describing sound waves. Sound is a disturbance of air molecules that travels in a wave (compression, rarefaction) with the following properties

  1. Amplitude (perceived as loudness)
    • The size of the distortion
    • How much energy the wave has
  2. Frequency (perceived as pitch)
    • The number of cycles of the wave per second.

Fundamental frequency. The “base” frequency (F0). The frequency at which that object vibrates. Males ~130Hz, females ~220Hz.

Harmonics. Integer multiples of fundamental frequency. Activated when object vibrates at fundamental frequency.

Resonance is a property of all objects. This reflection causes some interestin things to happen to the sound waves through a process called interference. We are actually interested in the resonance that occurs inside of hollow bodies like the body of a guitar: sound waves reflect off of the walls. There are two types of interference that can be created through resonance within hollow bodies:

  1. Constructive interference is when the peaks of the reflected waves line up. This doubles the amplitude of those waves.
  2. Destructive interference is when the peaks of one wave line up with the trough of a second wave. This cancels out the wave!
resonance

Speech sounds and formants.

  1. Vocal folds/cords: two muscular bands that produce your sound
  2. Vocal tract: the body of your instrument. Vocal tract has resonance bands, called formants (Formant 1 (F1), Formant 2 (F2), …).
    • the trachea,
    • the oral cavity
    • the rounder shape of the lip
    • Each speech sound can be uniquely defined by formants

Producing speech sounds.

  1. Your vocal folds create a fundamental frequency (perhaps 200Hz) that also has some harmonics (say, 400, 600, 800, etc).
  2. These harmonics resonate in the “body of your instrument”. In the case of speech, we have three “bodies”: the trachea, and the oral cavity, and the lips
  3. We call the most prominent harmonic band for each body (that is, the most prominent band NOT created by the F0) a FORMANT.

Formants and sound in our language. There is no 1-to-1 correlation between the physical properties (formants) and perception of speech sounds. Each speech sound can be uniquely defined by articulatory distinctive features. The production of speech sounds can be reduced to a small set of motor commands.

Phonetics.

  • Allowing deep learning models to learn letter-sound mappings from data can perform much better than hand engineering phonetic structure into a recognition or synthesis system.
  • Basic understanding of phonetics and speech production helps with describing and debugging spoken language systems

Pronunciation Transcription. A word can be transcribed into 2 types of transcription.

  1. Broad transcription/phonemic transcription -> Grapheme-to-Phoneme (G2P)

    • Converts word into a sequence of phonemes
    • Uses slashes
    • puff = /pʌf/
  2. Narrow transcription/phonetic transcription -> Letter-to-Sound (L2S)

    • Gives us extra information about how a word sounds
    • Uses brackets
    • [p^hʌf]

Phoneme, Phone, and Allophone. Phoneme - A phoneme is the mental representation of a sound, its what on your mind. Phone - A phone is the actual sound produced by the vocal tract. Allophone - Different ways to produce the same phoneme while keeping the same meaning. Example such as [p^h] and [p] are the same phoneme but different phones.

Prosody.

  • To convey sentence-level pragmatic meanings.
  • The use of suprasegmental (above & beyond the segment/phone) phonetic features.

Pitch.

  • Pitch is the mental sensation or perceptual correlate of F0
  • Relationship between pitch and F0 is not linear
  • Human pitch perception is most accurate between 100Hz and 1000Hz. (Linear in this range, Logarithmic above 1000Hz)

Three Aspects of Prosody.

  • Prominence: some syllables/words are more prominent than others
  • Structure/boundaries: sentences have prosodic structure
    • Some words group naturally together
    • Others have a noticeable break or disjuncture between them
  • Tune: the intonational melody of an utterance

Signal Processing

non-stationary by nature that consists of a complex mixture of various types of signals

  1. Periodic: repeats exactly with period T
  2. Aperiodic: any non-periodic signal
  3. Stochastic: noisy, unpredictable signals

White Noise is a particular type of a stochastic signal. It is completely random, however its characteristic does not change over time.

  • The signal values at any two different times are completely uncorrelated.
  • White noise is specified by a mean value μ\mu and variance σ2\sigma^2.

Sinusoids is a deterministic periodic signal. The projection of a fixed length vector rotating at a constant angular velocity.

  • Amplitude is the length of rotating vector.
  • Frequency is the number of cycles per second (1/T, T is period). One full rotation (θ=2π\theta=2\pi), if θ=wt    w=2πf\theta = wt\implies w=2\pi f where w is angular frequency.
sinusoids

Phase. Two sinusoids with equal frequency still may be different. In order to fully describe a sinusoid, one needs to specify

  1. Amplitude
  2. Frequency
  3. Phase

Wave in Time Domain wave is expressed as a function of time in cosine or sine form.

f(t)=Acos(wt+ϕ)f(t) = A\cos(wt + \phi)

Note that wave usually be represented as f(t)=Accos(wt)+Assin(wt)f(t) = A_c\cos(wt) + A_s\sin(wt) in fourier analysis where we do not need to specify the phase. Using the phase, we can pick one either cosine or sine wave.

Stationarity. A signal is stationary if its statistical properties do not change over time.

  • A sine wave of constant amplitude & frequency
  • Noise of constant mean and variance

Speech & Quasi-stationarity. in practice we normally assume that speech is stationary over a stationary over a short interval.

  • a complex mixture of periodic, aperiodic and stochastic signals
  • non-stationary by nature
  • Interval of stationarity is normally about 10 ms.

Fourier theorem. Any periodic signal of frequency f0f0 can be constructed exactly by adding together sinusoids of with frequencies (f0, 2f0, 3f0, …) each with appropriate amplitude AkA_k and phase ϕk\phi_k

x(t)=k=1Akcos(2πfkt+ϕk)x(t) = \sum_{k=1}^{\infty} A_k \cos(2\pi f_k t + \phi_k)

Fourier analysis is a mathematical process used to solve complex waveform problems by decomposing the wave into its sinusoidal components.

  • finding unkown AkA_k and ϕk\phi_k for a known waveform function x(t)x(t)

Spectrum. Any periodic function can be characterised by the amplitude and phase of its sinusoidal components. This characterisation is called the spectrum.

The Fourier Transform. Allows us to move between the time domain and the frequency domain.

Digital Signals

Digital Signal is. A sequence s[n], where s are not only finite, but can only take a finite set of values and may take complex values.

Example of Digital Signal.

  1. DC Signal
  2. Unit Step Signal
  3. Unit Pulse
  4. Pulse train
  5. Impulse Function
  6. Sinusoids
  7. Exponential
  8. Complex Exponential

Sampling

Sampling is measuring the instantaneous value of a signal at regular discrete intervals.

Quality metrics of sample.

  1. Sampling rate (fs=1/Tsf_s=1/T_s): the number of samples per second.
  2. Sample depth qq: The audio sample can represent a higher range of amplitudes measures in bits. 8bit -> 2^8 = 256 amplitude values.
  3. Bit rate: the product of sampling rate and sample depth. Measured in bits per second (bps).

Nyquist rate. The minimum sampling rate necessary to preserve the maximum frequency.

  • The sampling frequency must be at least twice the highest frequency present in the signal fc<1/(2Ts)f_c < 1/(2T_s)

Nyquist frequency. The highest frequency that can be represented by the sampling rate. Given a sampling rate, the highest frequency that sampling rate measure is called Nyquist frequency.

  • Measured at half of sampling rate

Aliasing. Occur when sampling rate is too low (below Nyquist rate)

  • Cause a lower frequency component to appear in the sampled data