Docsity

Exploring Audio Compression: ADPCM, G.726, Quantizer, Vocoders, and CELP, Study notes of Electrical and Electronics Engineering

Partial preview of the text

Download Exploring Audio Compression: ADPCM, G.726, Quantizer, Vocoders, and CELP and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

ECE Lecture 13 1

ECE160 / CMPS

Multimedia

Lecture 13: Spring 2007

Basic Audio Compression Techniques

ECE Lecture 13 2

ADPCM in Speech Coding

  • ADPCM forms the heart of the ITU's speech compression

standards G.721, G.723, G.726, and G.727.

  • The difference between these standards involves

the bit-rate (from 3 to 5 bits per sample) and

some algorithm details.

  • The default input is μ-law coded PCM 16-bit samples.

Speech sample, linear PCM

at 8 kHz/16 bits per sample.

Speech sample, restored

from G.721-compressed

audio at 4 bits/sample

Difference signal

ECE Lecture 13 4

G.726 Quantizer

  • The input value is a ratio of a difference with the

factor α.

  • By changing α, the quantizer can adapt to

change in the range of the difference signal

  • a backward adaptive quantizer.

ECE Lecture 13 5

Backward Adaptive Quantizer

  • Backward adaptive works in principle by noticing either

of the cases:

  • too many values are quantized to values far from zero -

would happen if quantizer step size in f were too small.

  • too many values fall close to zero too much of the time -

would happen if the quantizer step size were too large.

  • Jayant quantizer allows one to adapt a backward

quantizer step size after receiving just one single output.

  • Jayant quantizer simply expands the step size if the quantized

input is in the outer levels of the quantizer, and reduces the step

size if the input is near zero.

ECE Lecture 13 7

G.726 -

Backward Adaptive Jayant Quantizer

  • G.726 uses fixed quantizer steps based on the

logarithm of the input difference signal,

e

n

divided by α. The divisor is:

β = log

  • When difference values are large, α is divided into:
    • locked part α L - scale factor for small difference values.
    • unlocked part α U - adapts quickly to larger differences.
    • These correspond to log quantities β L

and β U

, so that:

β = Aβ

U

+ (1 −A )β

L

  • A changes so that it is about unity for speech,

and about zero for voice-band data.

ECE Lecture 13 8

G.726 -

Backward Adaptive Jayant Quantizer

  • The “unlocked" part adapts via the equation

α U

M

k

α U

β U

log 2

M

k

  • β U

where M k

is a Jayant multiplier for the k th level.

  • The locked part is slightly modied from the unlocked

part:

β L

(1 − B )β L

  • Bβ U

where B is a small number, say 2

− 6 .

  • The G.726 predictor is quite complicated: it uses

a linear combination of 6 quantized differences and

two reconstructed signal values,

from the previous 6 signal values f n

ECE Lecture 13 10

Phase Insensitivity

  • A complete reconstituting of speech waveform is really

unnecessary, perceptually: what is needed is for the amount of

energy at any time and frequency to be right, and the signal will

sound about right.

  • Phase is a shift in the time argument inside a function of time.
    • Suppose we strike a piano key, and generate a roughly sinusoidal

sound cos(ω t ), with ω = 2π f.

  • Now if we wait sufficient time

to generate a phase shift π/ 2

and then strike another key,

with sound cos(2ω t + π/2),

we generate a waveform

like the solid line

  • This waveform is the sum

cos(ω t ) + cos(2ω t + π/2).

  • If we did not wait before

striking the second note,

then our waveform would

be cos(ω t ) + cos(2ω t ). But

perceptually, the two notes

would sound the same sound,

even though in actuality they would be shifted in phase.

ECE Lecture 13 11

Channel Vocoder

Vocoders can

operate at

low bit-rates,

1-2 kbps. A channel vocoder

first applies a filter

bank to separate

out the different

frequency

components

ECE Lecture 13 13

Formant Vocoder

  • Formants: the salient frequency components that are

present in a sample of speech.

  • Rationale: encode only the most important frequencies.
  • The solid line shows

frequencies present

in the first 40 msec

of a speech sample.

The dashed line shows

that while similar

frequencies are still

present one second

later, these frequencies

have shifted.

ECE Lecture 13 14

Linear Predictive Coding (LPC)

  • LPC vocoders extract salient features of speech directly

from the waveform, rather than transforming the signal to

the frequency domain

  • LPC Features:
    • uses a time-varying model of vocal tract sound generated from a

given excitation

  • transmits only a set of parameters modeling the shape and

excitation of the vocal tract, not actual signals or differences -

small bit-rate

  • About “ Linear": The speech signal generated by the

output vocal tract model is calculated as a function of the

current speech output plus a second term linear in

previous model coefficients

ECE Lecture 13 16

LPC Coding Process

  • If the output values generate s ( n ), for input

values f ( n ), the output depends on p previous

output sample values:

G - the “gain" factor coefficients;

a

i

  • values in a linear predictor model
  • LP coefficients can be calculated by solving the

following minimization problem:

ECE Lecture 13 17

Code Excited Linear Prediction

(CELP)

  • CELP is a more complex family of coders that attempts

to mitigate the lack of quality of the simple LPC model

  • CELP uses a more complex description of the excitation:
    • An entire set (a codebook) of excitation vectors is matched to the

actual speech, and the index of the best match is sent to the

receiver

  • The complexity increases the bit-rate to 4,800-9,600 bps
  • The resulting speech is perceived as being more similar and

continuous

  • Quality achieved this way is sufficient for audio conferencing

ECE Lecture 13 19

Relationship between STP and LTP

  • STP captures the formant structure of the short-

term speech spectrum based on only a few

samples

  • LTP, following STP, recovers the long-term

correlation in the speech signal that represents

the periodicity in speech using whole frames or

subframes (1/4 of a frame)

  • LTP is often implemented as adaptive codebook

searching

ECE Lecture 13 20

CELP Analysis Model with

Adaptive and Stochastic Codebooks