3. What’s the need for speech
coding ?
Necessary in order to represent human speech in a
digital form
Applications: mobile/telephone communication, voice
over IP
Code efficiency (high quality, fewer bits) is a must
6. Example of coding techniques
ZIP: no transformation nor quantization, apply VLC (LZW)
to the stream of letters (symbols) in a file directly, lossless
coding
PCM for speech: no transformation, quantize the speech
samples directly, apply fixed length binary coding
ADPCM for speech: apply prediction to original samples,
the predictor is adapted from one speech frame to the next,
quantize the prediction error, error symbols coded using
fixed length binary coding
JPEG for image: apply discrete cosine transform to blocks
of image pixels, quantize the transformed coefficients,
code the quantized coefficients using variable length
coding (runlength + Huffman coding)
7. The aim of speech coding is to enhance the quality of a speech
signal at a particular bit-rate or to minimize the bit-rate at a given
quality.
The bit-rate at which the speech is to be transmitted or stored
depends on the rate of transmission or storage, the computation of
coding the digital speech signal and the quality of the speech signal
required.
7
8. Low bit-rate
High speech quality
Robustness to different speakers/languages
Channel errors
Low memory requirements
Less computational complexity
Low coding delay
8
11. Necessity
Efficient speech-coding techniques
Digital streams of ones and zeros
The lower the bandwidth, the lower the quality
Processing power
The better quality (for a given bandwidth) uses a more
complex algorithm
A balance between quality and cost
12. Voice Quality
Bandwidth is easily quantified
Voice quality is subjective
MOS, Mean Opinion Score
ITU-T Recommendation P.800
Excellent – 5
Good – 4
Fair – 3
Poor – 2
Bad – 1
A minimum of 30 people
Listen to voice samples or in conversations
13. About Speech
Speech
Air pushed from the lungs past the vocal cords and along
the vocal tract
The basic vibrations – vocal cords
The sound is altered by the disposition of the vocal tract
( tongue and mouth)
Model the vocal tract as a filter
The shape changes relatively slowly
The vibrations at the vocal cords
The excitation signal
14. 14
Speech Compression
Handling speech with other media information such as text, images,
video, and data is the essential part of multimedia applications
The ideal speech coder has a low bit-rate, high perceived quality,
low signal delay, and low complexity.
Delay
Less than 150 ms one-way end-to-end delay for a conversation
Processing (coding) delay, network delay
Complexity
Computational complexity of speech coders depends on
algorithms
Contributes to achievable bit-rate and processing delay
15. 15
Speech coding
Standard voice channel:
analog: 4 kHz slot (~ 40 dB SNR)
digital: 64 Kbps = 8 bit µ-law x 8 kHz
How to compress?
Exploit redundancy
signal assumed to be a single voice, not any waveform
Code only what is needed
intelligibility
speaker identification
Source-filter decomposition
vocal tract shape & fundamental frequency change slowly
16. 16
Taxonomy of Speech Coders
Speech Coders
Waveform Coders Source Coders
Time Domain:
PCM, ADPCM
Frequency Domain:
e.g. Sub-band coder,
Adaptive transform
coder
Linear
Predictive
Coder
Vocoder
17. Speech coders are classified based on the
bit-rate at which they produce output with
reasonable quality and on the type of
coding techniques used for coding the
speech signal.
17
18. Classification by Bit-Rate
Type of coder Bit-Rate Range
High bit-rate coders >15 Kbps
Medium bit-rate coders 5 to 15 Kbps
Low bit-rate coders 2 to 5 Kbps
Very Low bit-rate coders <2 Kbps
18
20. Types of Speech Codecs
Waveform codecs,source codecs (also known as vocoders),and
hybrid codecs.
21. 21
The ancestor: Channel Vocoder (1940s-1960s)
Source-filter decomposition
filterbank breaks into spectral bands
transmit slowly-changing energy in each band
10-20 bands, perceptually spaced
Downsampling
Excitation with a pitch / noise model
22. 22
LPC encoding
The classic source-filter model
Compression gains:
filter parameters are ~slowly changing
excitation can be represented many ways
23. 23
Linear Predictive Code
Model speech production system
as an auto-regressive model:
Model parameters are computed
for speech segment (~30 ms).
Parameters {a(k); k=1:p} are found
by solving a Toeplitz system of
equations.
Transfer function
To encode speech, one may
transmit the quantized parameters
{a(k)} and G or equivalent
parameter set.
The model order is 8-10 in most
speech coding standards.
)()()()(
1
neknskans
p
k
+−= ∑= ∑=
−
−
== p
k
k
zka
G
zE
zS
zH
1
)(1
)(
)(
)(
unvoiced
G
v/u
voiced
N
random
sequence
generator
periodic
pulse
train
generator
× H(z) = 1
1− ∑ akz-k
P
k = 1
u[n]
Vocal Tract Model
Excitation parameters
v/u : voiced/ unvoiced
N : pitch for voiced
G : signal gain
→ excitation signal u[n]
Vocal Tract parameters
{ak
} : LPC coefficients
→formant structure of
speech signals
24. 24
Excitation parameters
v/u : voiced/ unvoiced
N : pitch for voiced
G : signal gain
→ excitation signal u[n]
Vocal Tract parameters
{ak
} : LPC coefficients
→formant structure of
speech signals
unvoiced
G
v/u
voiced
N
random
sequence
generator
periodic
pulse
train
generator
× H(z) = 1
1− ∑ akz-k
P
k = 1
u[n]
Vocal Tract Model
26. 26
Encoding LPC filter parameters
For ‘communications quality’:
8 kHz sampling (4 kHz bandwidth)
~10th order LPC (up to 5 pole pairs)
update every 20-30 ms → 300 - 500 param/s
Representation & quantization
{ai} - poor distribution,
can’t interpolate
reflection coefficients {ki}:
guaranteed stable
log area ratios (LAR) - stable
Bit allocation (filter):
GSM (13 kbps):
8 LARs x 3-6 bits / 20 ms = 1.8 Kbps
27. 27
Excitation
Excitation as LPC residual is already better than raw signal:
save several bits/sample, still > 32 Kbps
Crude model: U/V flag + pitch period
~ 7 bits / 5 ms = 1.4 Kbps → LPC10 @ 2.4 Kbps
28. 28
CELP
Code excited linear predictive (CELP) speech coding.
White noise input does not give satisfactory results:
the residue sequence still contains important information for
speech synthesis
it is necessary to send the residue to receiving end too.
To save space, use vector quantization (VQ) technique to encode
the residue sequence
Hence the name “code excited”.
In CELP, each code book is a linear vector containing 0 or ±1
each code word length is 60 samples
successive code words are overlapped by 58 samples
a linear search is performed to find the best code words as input
to the LPC model.
32. 32
Implementation Issues
Tasks:
LPC analysis filter to calculate
the coefficients
Long term prediction for pitch
analysis need to find delay D
and gain
VQ search during CELP
encoding – Most time
consuming
FIR filtering for pre- and post
processing
Often implemented in DSP chips
for embedded applications (e.g.
cell phone).
The parameter quantization part
needs bit-level operation.