ATIS 3GPP S PECIFICATION
ATIS.3GPP.26.090.900-2010
3rd Generation Partnership Project;
Technical Specification Group Services and System Aspects;
Mandatory Speech Codec speech processing functions;
Adaptive Multi-Rate (AMR) speech codec;
Transcoding functions (Release 9)
Approved by WTSC
Wireless Technologies and Systems Committee
ATIS is committed to providing leadership for, and the rapid development and promotion of, worldwide technical and operations standards for information, entertainment and communications technologies using a pragmatic, flexible and open approach.
< http://www.atis.org/ >
The text in this ATIS Specification is identical to 3GPP TS 26.090 V9.0.0.
Please note that ATIS.3GPP.26.090.900-2010 was developed within the Third Generation Partnership Project (3GPP™) and may be further elaborated for the purposes of 3GPP™. The contents of ATIS.3GPP.26.090.900-2010 are subject to continuing work within the 3GPP™ and may change following formal 3GPP™ approval. Should the 3GPP™ modify the contents of ATIS.3GPP.26.090.900-2010 it will be re-released by the 3GPP™ with an identifying change of release date and an increase in version number. The user of this Specification is advised to check for the latest version of 3GPP TS 26.090 V9.0.0 at the following address:
ftp://ftp.3gpp.org/Specs/ (sorted by release date)
The user is further advised to verify the changes over the version listed as the approved basis for this Specification and to utilize discretion after identifying any changes.
3GPP Support Office
650 Route des Lucioles -- Sophia Antipolis Valbonne - FRANCE
tel: +33 4 92 94 42 00 fax: +33 4 93 65 47 16 web: http://www.3gpp.org
"3GPP" is a registered trademark of ETSI in France and other jurisdictions on behalf of the 3rd Generation Partnership Project Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC).
ATIS.3GPP.26.090.900-2010
Published by
Alliance for Telecommunications Industry Solutions 1200 G Street, NW, Suite 500
Washington, DC 20005
Copyright © 2012 by Alliance for Telecommunications Industry Solutions All rights reserved.
No part of this publication may be reproduced in any form, in an electronic retrieval system or otherwise, without the prior written permission of the publisher. For information contact ATIS at +1 202.628.6380. ATIS is online at
< http://www.atis.org >.
Printed in the United States of America.
Contents
Foreword ... 5
1 Scope... 6
2 References... 6
3 Definitions, symbols and abbreviations ... 6
3.1 Definitions ...6
3.2 Symbols ...8
3.3 Abbreviations ...11
4 Outline description... 12
4.1 Functional description of audio parts ...12
4.2 Preparation of speech samples...13
4.2.1 PCM format conversion ...13
4.3 Principles of the adaptive multi-rate speech encoder ...13
4.4 Principles of the adaptive multi-rate speech decoder ...15
4.5 Sequence and subjective importance of encoded parameters ...16
5 Functional description of the encoder... 16
5.1 Pre-processing (all modes) ...16
5.2 Linear prediction analysis and quantization ...16
5.2.1 Windowing and auto-correlation computation...17
5.2.2 Levinson-Durbin algorithm (all modes)...18
5.2.3 LP to LSP conversion (all modes) ...18
5.2.4 LSP to LP conversion (all modes) ...20
5.2.5 Quantization of the LSP coefficients ...20
5.2.6 Interpolation of the LSPs ...22
5.2.7 Monitoring resonance in the LPC spectrum (all modes)...23
5.3 Open-loop pitch analysis ...23
5.4 Impulse response computation (all modes) ...27
5.5 Target signal computation (all modes) ...27
5.6 Adaptive codebook ...27
5.6.1 Adaptive codebook search ...27
5.6.2 Adaptive codebook gain control (all modes)...31
5.7 Algebraic codebook...31
5.7.1 Algebraic codebook structure ...31
5.7.2 Algebraic codebook search ...34
5.8 Quantization of the adaptive and fixed codebook gains ...37
5.8.1 Adaptive codebook gain limitation in quantization ...37
5.8.2 Quantization of codebook gains...37
5.8.3 Update past quantized adaptive codebook gain buffer (all modes)...39
5.9 Memory update (all modes)...40
6 Functional description of the decoder... 40
6.1 Decoding and speech synthesis ...40
6.2 Post-processing...43
6.2.1 Adaptive post-filtering (all modes) ...43
6.2.2 High-pass filtering and up-scaling (all modes) ...44
7 Detailed bit allocation of the adaptive multi-rate codec ... 45
8 Homing sequences ... 49
8.1 Functional description ...49
8.2 Definitions ...50
8.3 Encoder homing...50
8.4 Decoder homing ...50
9 Bibliography ... 54
Annex A (informative): Change history... 55Foreword
This Technical Specification has been produced by the 3rd Generation Partnership Project (3GPP).
The contents of the present document are subject to continuing work within the TSG and may change following formal TSG approval. Should the TSG modify the contents of the present document, it will be re-released by the TSG with an identifying change of release date and an increase in version number as follows:
Version x.y.z where:
x the first digit:
1 presented to TSG for information;
2 presented to TSG for approval;
3 or greater indicates TSG approved document under change control.
y the second digit is incremented for all changes of substance, i.e. technical enhancements, corrections, updates, etc.
z the third digit is incremented when editorial only changes have been incorporated in the document.
1 Scope
The present document describes the detailed mapping from input blocks of 160 speech samples in 13-bit uniform PCM format to encoded blocks of 95, 103, 118, 134, 148, 159, 204, and 244 bits and from encoded blocks of 95, 103, 118, 134, 148, 159, 204, and 244 bits to output blocks of 160 reconstructed speech samples. The sampling rate is 8 000 samples/s leading to a bit rate for the encoded bit stream of 4.75, 5.15, 5.90, 6.70, 7.40, 7.95, 10.2 or 12.2 kbit/s. The coding scheme for the multi-rate coding modes is the so-called Algebraic Code Excited Linear Prediction Coder, hereafter referred to as ACELP. The multi-rate ACELP coder is referred to as MR-ACELP.
In the case of discrepancy between the requirements described in the present document and the fixed point
computational description (ANSI-C code) of these requirements contained in [4], the description in [4] will prevail.
The ANSI-C code is not described in the present document, see [4] for a description of the ANSI-C code.
The transcoding procedure specified in the present document is mandatory for systems using the AMR speech codec.
2 References
The following documents contain provisions which, through reference in this text, constitute provisions of the present document.
References are either specific (identified by date of publication, edition number, version number, etc.) or non-specific.
For a specific reference, subsequent revisions do not apply.
For a non-specific reference, the latest version applies. In the case of a reference to a 3GPP document (including a GSM document), a non-specific reference implicitly refers to the latest version of that document in the same Release as the present document.
[1] GSM 03.50: " Digital cellular telecommunications system (Phase 2+); Transmission planning aspects of the speech service in the GSM Public Land Mobile Network (PLMN) system".
[2] 3GPP TS 26.101 : "Frame Structure".
[3] 3GPP TS 26.094: "AMR Speech Codec; Voice Activity Detector".
[4] 3GPP TS 26.073: "Adaptive Multi-Rate (AMR); ANSI C source code".
[5] 3GPP TS 26.074: "Adaptive Multi-Rate (AMR); Test sequences".
[6] ITU-T Recommendation G.711 (1988): "Pulse code modulation (PCM) of voice frequencies".
[7] ITU-T Recommendation G.726: "40, 32, 24, 16 kbit/s Adaptive Differential Pulse Code Modulation (ADPCM)".
[8] ITU-T Recommendation G.712
3 Definitions, symbols and abbreviations
3.1 Definitions
For the purposes of the present document, the following terms and definitions apply:
adaptive codebook: contains excitation vectors that are adapted for every subframe. The adaptive codebook is derived from the long-term filter state. The lag value can be viewed as an index into the adaptive codebook adaptive postfilter: this filter is applied to the output of the short-term synthesis filter to enhance the perceptual quality of the reconstructed speech. In the adaptive multi-rate codec, the adaptive postfilter is a cascade of two filters: a formant postfilter and a tilt compensation filter
algebraic codebook: fixed codebook where algebraic code is used to populate the excitation vectors (innovation vectors). The excitation contains a small number of nonzero pulses with predefined interlaced sets of positions anti-sparseness processing: adaptive post-processing procedure applied to the fixed codebook vector in order to reduce perceptual artefacts from a sparse fixed codebook vector
closed-loop pitch analysis: adaptive codebook search, i.e., a process of estimating the pitch (lag) value from the weighted input speech and the long term filter state. In the closed-loop search, the lag is searched using error minimization loop (analysis-by-synthesis). In the adaptive multi-rate codec, closed-loop pitch search is performed for every subframe
direct form coefficients: One of the formats for storing the short term filter parameters. In the adaptive multi-rate codec, all filters which are used to modify speech samples use direct form coefficients.
fixed codebook: The fixed codebook contains excitation vectors for speech synthesis filters. The contents of the codebook are non-adaptive (i.e., fixed). In the adaptive multi-rate codec, the fixed codebook is implemented using an algebraic codebook.
fractional lags: A set of lag values having sub-sample resolution. In the adaptive multi-rate codec a sub-sample resolution of 1/6th or 1/3rd of a sample is used.
frame: time interval equal to 20 ms (160 samples at an 8 kHz sampling rate) integer lags: set of lag values having whole sample resolution
interpolating filter: FIR filter used to produce an estimate of subsample resolution samples, given an input sampled with integer sample resolution
inverse filter: this filter removes the short term correlation from the speech signal. The filter models an inverse frequency response of the vocal tract
lag: long term filter delay. This is typically the true pitch period, or its multiple or sub-multiple Line Spectral Frequencies: (see Line Spectral Pair)
Line Spectral Pair: transformation of LPC parameters. Line Spectral Pairs are obtained by decomposing the inverse filter transfer function A(z) to a set of two transfer functions, one having even symmetry and the other having odd symmetry. The Line Spectral Pairs (also called as Line Spectral Frequencies) are the roots of these polynomials on the z-unit circle
LP analysis window: for each frame, the short term filter coefficients are computed using the high pass filtered speech samples within the analysis window. In the adaptive multi-rate codec, the length of the analysis window is always 240 samples. For each frame, two asymmetric windows are used to generate two sets of LP coefficient in the 12.2 kbit/s mode. For the other modes, only a single asymmetric window is used to generate a single set of LP coefficients. In the 12.2 kbit/s mode, no samples of the future frames are used (no lookahead). The other modes use a 5 ms lookahead
LP coefficients: linear Prediction (LP) coefficients (also referred as Linear Predictive Coding (LPC) coefficients) is a generic descriptive term for the short term filter coefficients
mode: when used alone, refers to the source codec mode, i.e., to one of the source codecs employed in the AMR codec
open-loop pitch search: process of estimating the near optimal lag directly from the weighted speech input. This is done to simplify the pitch analysis and confine the closed-loop pitch search to a small number of lags around the open-loop estimated lags. In the adaptive multi-rate codec, an open-loop pitch search is performed in every other subframe
residual: the output signal resulting from an inverse filtering operation
short term synthesis filter: this filter introduces, into the excitation signal, short term correlation which models the impulse response of the vocal tract
perceptual weighting filter: this filter is employed in the analysis-by-synthesis search of the codebooks. The filter exploits the noise masking properties of the formants (vocal tract resonances) by weighting the error less in regions near the formant frequencies and more in regions away from them
subframe: time interval equal to 5 ms (40 samples at 8 kHz sampling rate)
vector quantization: method of grouping several parameters into a vector and quantizing them simultaneously zero input response: output of a filter due to past inputs, i.e. due to the present state of the filter, given that an input of zeros is applied
zero state response: output of a filter due to the present input, given that no past inputs have been applied, i.e., given that the state information in the filter is all zeroes
3.2 Symbols
For the purposes of the present document, the following symbols apply:
A z
The inverse filter with unquantized coefficients
A z
The inverse filter with quantized coefficients
H z A z 1
The speech synthesis filter with quantized coefficientsa
i The unquantized linear prediction parameters (direct form coefficients)a
i The quantified linear prediction parametersm
The order of the LP model1
B z ( )
The long-term synthesis filter
W z
The perceptual weighting filter (unquantized coefficients)
1,
2 The perceptual weighting factorsF z
E( )
Adaptive pre-filterT
The integer pitch lag nearest to the closed-loop fractional pitch lag of the subframe
The adaptive pre-filter coefficient (the quantified pitch gain)H z A z
f
A z
nd
( ) ( / )
( / )
The formant postfilter
n Control coefficient for the amount of the formant post-filtering
d Control coefficient for the amount of the formant post-filtering
H z
t Tilt compensation filter
t Control coefficient for the amount of the tilt compensation filtering
tk
1'
A tilt factor, withk
1'
being the first reflection coefficient
h
fn
The truncated impulse response of the formant postfilterL
h The length ofh
f n
r i
h( )
The auto-correlations ofh
f n
A z
n The inverse filter (numerator) part of the formant postfilter
1 A z
d The synthesis filter (denominator) part of the formant postfilter
r n
The residual signal of the inverse filterA z
n
h n
t Impulse response of the tilt compensation filter
sc( ) n
The AGC-controlled gain scaling factor of the adaptive postfilter
The AGC factor of the adaptive postfilter
H
h1z
Pre-processing high-pass filterw n
I( )
,w
II( ) n
LP analysis windowsL
1( )I Length of the first part of the LP analysis windoww n
I( ) L
2( )I Length of the second part of the LP analysis windoww n
I( ) L
1( )II Length of the first part of the LP analysis windoww
II( ) n L
2( )II Length of the second part of the LP analysis windoww
II( ) n r
ac( ) k
The auto-correlations of the windowed speechs n ' ( )
w
lagi
Lag window for the auto-correlations (60 Hz bandwidth expansion)f
0 The bandwidth expansion in Hzf
s The sampling frequency in Hzr '
ac( ) k
The modified (bandwidth expanded) auto-correlations
E
LDi
The prediction error in thei
th iteration of the Levinson algorithmk
i Thei
th reflection coefficienta
( )ji Thej
th direct form coefficient in thei
th iteration of the Levinson algorithm
F z
1 Symmetric LSF polynomial
F z
2 Antisymmetric LSF polynomial
F z
1 PolynomialF z
1
with rootz 1
eliminated
F z
2 PolynomialF z
2
with rootz 1
eliminatedq
i The line spectral pairs (LSPs) in the cosine domainq
An LSP vector in the cosine domain
( )q
in The quantified LSP vector at the ith subframe of the frame n
i The line spectral frequencies (LSFs)T x
m( )
Am
th order Chebyshev polynomialf i
1( ), f i
2( )
The coefficients of the polynomialsF z
1( )
andF z
2( ) f i
1'( ), f i
2'( )
The coefficients of the polynomialsF z
1
andF z
2
f i ( )
The coefficients of eitherF z
1
orF z
2
C x
Sum polynomial of the Chebyshev polynomialsx
Cosine of angular frequency
k Recursion coefficients for the Chebyshev polynomial evaluationf
i The line spectral frequencies (LSFs) in Hz
f
t f f
1 2 f
10 The vector representation of the LSFs in Hz
z
( )1n
,z
( )2 n
The mean-removed LSF vectors at framen
r
( )1n
,r
( )2 n
The LSF prediction residual vectors at framen p( ) n
The predicted LSF vector at framen
( )r
2n 1
The quantified second residual vector at the past framef
k The quantified LSF vector at quantization index kE
LSP The LSP quantization errorw i
i, 1 , , , 10
LSP-quantization weighting factorsd
i The distance between the line spectral frequenciesf
i1 andf
i1
h n
The impulse response of the weighted synthesis filterO
k The correlation maximum of open-loop pitch analysis at delayk O
ti
i
, 1 , , 3
The correlation maxima at delayst i
i, 1 , , 3
M t
i,
i , i 1 , , 3
The normalized correlation maximaM
i and the corresponding delayst i
i, 1 , , 3 H z W z A z
A z A z
( ) ( ) ( / )
( ) ( / )
1 2
The weighted synthesis filter
A z
1 The numerator of the perceptual weighting filter
1 A z
2 The denominator of the perceptual weighting filterT
1 The integer nearest to the fractional pitch lag of the previous (1st or 3rd) subframes n ' ( )
The windowed speech signal
s
wn
The weighted speech signal
s n
Reconstructed speech signal
s n
The gain-scaled post-filtered signal
s n
f Post-filtered speech signal (before scaling)
x n
The target signal for adaptive codebook search
x n
2 ,x
2t The target signal for algebraic codebook searchres
LP( ) n
The LP residual signal
c n
The fixed codebook vector
v n
The adaptive codebook vectory n ( ) = ( ) v n h n ( )
The filtered adaptive codebook vector
y
kn
The past filtered excitation
u n
The excitation signal
u n
The emphasized adaptive codebook vector'( )
u n
The gain-scaled emphasized excitation signalT
op The best open-loop lagt
min Minimum lag search valuet
max Maximum lag search value
R k
Correlation term to be maximized in the adaptive codebook searchb
24 The FIR filter for interpolating the normalized correlation termR k
R k
t The interpolated value ofR k
for the integer delayk
and fractiont
b
60 The FIR filter for interpolating the past excitation signalu n
to yield the adaptive codebook vectorv n
A
k Correlation term to be maximized in the algebraic codebook search at indexk C
k The correlation in the numerator ofA
k at indexk
E
Dk The energy in the denominator ofA
k at indexk
d H x
t 2 The correlation between the target signalx n
2
and the impulse responseh n
, i.e.,backward filtered target
H
The lower triangular Toepliz convolution matrix with diagonalh 0
and lower diagonals
h 1 , , h 39
H H
t The matrix of correlations ofh n
d n ( )
The elements of the vectord
( , ) i j
The elements of the symmetric matrix
c
k The innovation vectorC
The correlation in the numerator ofA
km
i The position of thei
th pulse
i The amplitude of thei
th pulseN
p The number of pulses in the fixed codebook excitationE
D The energy in the denominator ofA
k
res
LTPn
The normalized long-term prediction residual
b n
The signal used for presetting the signs in algebraic codebook search
s n
b The sign signal for the algebraic codebook search
d n
Sign extended backward filtered target
'( , ) i j
The modified elements of the matrix
, including sign informationz
t,z n
The fixed codebook vector convolved withh n
E n
The mean-removed innovation energy (in dB)E
The mean of the innovation energy
E n ~
The predicted energy b b b b
1 2 3 4
The MA prediction coefficients
R k
The quantified prediction error at subframek E
I The mean innovation energyR n ( )
The prediction error of the fixed-codebook gain quantizationE
Q The quantization error of the fixed-codebook gain quantizatione n ( )
The states of the synthesis filter1 A z
e
wn
The perceptually weighted error of the analysis-by-synthesis search
The gain scaling factor for the emphasized excitationg
c The fixed-codebook gain
g
c The predicted fixed-codebook gaing
c The quantified fixed codebook gain gp The adaptive codebook gaingp The quantified adaptive codebook gain
gc g
cg
c
A correction factor between the gaing
c and the estimated oneg
c
gc The optimum value for
gc
sc Gain scaling factor3.3 Abbreviations
For the purposes of the present document, the following abbreviations apply.
ACELP Algebraic Code Excited Linear Prediction
AGC Adaptive Gain Control
AMR Adaptive Multi-Rate
CELP Code Excited Linear Prediction
EFR Enhanced Full Rate
FIR Finite Impulse Response
ISPP Interleaved Single-Pulse Permutation
LP Linear Prediction
LPC Linear Predictive Coding
LSF Line Spectral Frequency
LSP Line Spectral Pair
LTP Long Term Predictor (or Long Term Prediction)
MA Moving Average
4 Outline description
The present document is structured as follows:
Clause 4.1 contains a functional description of the audio parts including the A/D and D/A functions. Clause 4.2 describes the conversion between 13-bit uniform and 8-bit A-law or
-law samples. Clauses 4.3 and 4.4 present a simplified description of the principles of the AMR codec encoding and decoding process respectively. In clause 4.5, the sequence and subjective importance of encoded parameters are given.Clause 5 presents the functional description of the AMR codec encoding, whereas clause 6 describes the decoding procedures. In clause 7, the detailed bit allocation of the AMR codec is tabulated.
4.1 Functional description of audio parts
The analogue-to-digital and digital-to-analogue conversion will in principle comprise the following elements:
1) Analogue to uniform digital PCM - microphone;
- input level adjustment device;
- input anti-aliasing filter;
- sample-hold device sampling at 8 kHz;
- analoguetouniform digital conversion to 13bit representation.
The uniform format shall be represented in two's complement.
2) Uniform digital PCM to analogue
- conversion from 13bit/8 kHz uniform PCM to analogue;
- a hold device;
- reconstruction filter including x/sin( x ) correction;
- output level adjustment device;
- earphone or loudspeaker.
In the terminal equipment, the A/D function may be achieved either:
- by direct conversion to 13-bit uniform PCM format;
- or by conversion to 8-bit A-law or
-law compounded format, based on a standard A-law or
-lawcodec/filter according to ITU-T Recommendations G.711 [6] and G.714, followed by the 8-bit to 13-bit conversion as specified in clause 4.2.1.
For the D/A operation, the inverse operations take place.
In the latter case it should be noted that the specifications in ITU-T G.714 (superseded by G.712) are concerned with PCM equipment located in the central parts of the network. When used in the terminal equipment, the present
document does not on its own ensure sufficient out-of-band attenuation. The specification of out-of-band signals is defined in [1] in clause 2.
4.2 Preparation of speech samples
The encoder is fed with data comprising of samples with a resolution of 13 bits left justified in a 16-bit word. The three least significant bits are set to '0'. The decoder outputs data in the same format. Outside the speech codec further processing must be applied if the traffic data occurs in a different representation.
4.2.1 PCM format conversion
The conversion between 8-bit A-Law or
-law compressed data and linear data with 13-bit resolution at the speech encoder input shall be as defined in ITU-T Rec. G.711 [6].ITU-T Rec. G.711 [6] specifies the A-Law or
-law to linear conversion and vice versa by providing table entries.Examples on how to perform the conversion by fixed-point arithmetic can be found in ITU-T Rec. G.726 [7]. Clause 4.2.1 of G.726 [7] describes A-Law or
-law to linear expansion and clause 4.2.8 of G.726 [7] provides a solution for linear to A-Law or
-law compression.4.3 Principles of the adaptive multi-rate speech encoder
The AMR codec consists of eight source codecs with bit-rates of 12.2, 10.2, 7.95, 7.40, 6.70, 5.90, 5.15 and 4.75 kbit/s.
The codec is based on the code-excited linear predictive (CELP) coding model. A 10th order linear prediction (LP), or short-term, synthesis filter is used which is given by:
H z A z a z
i ii
m
1 1
1
1
, (1)where
a i ,
i 1 , , , m
are the (quantified) linear prediction (LP) parameters, andm 10
is the predictor order.The long-term, or pitch, synthesis filter is given by:
1 1
B z 1 g z
p T
, (2)where
T
is the pitch delay andg
p is the pitch gain. The pitch synthesis filter is implemented using the so-called adaptive codebook approach.The CELP speech synthesis model is shown in figure 2. In this model, the excitation signal at the input of the short-term LP synthesis filter is constructed by adding two excitation vectors from adaptive and fixed (innovative) codebooks. The speech is synthesized by feeding the two properly chosen vectors from these codebooks through the short-term synthesis filter. The optimum excitation sequence in a codebook is chosen using an analysis-by-synthesis search procedure in which the error between the original and synthesized speech is minimized according to a perceptually weighted distortion measure.
The perceptual weighting filter used in the analysis-by-synthesis search technique is given by:
W z A z
A z
1 2
, (3)
where
A z
is the unquantized LP filter and0
2
1 1
are the perceptual weighting factors. The values
1 0 9 .
(for the 12.2 and 10.2 kbit/s mode) or
1 0 . 94
(for all other modes) and
2 0 6 .
are used. The weighting filter uses the unquantized LP parameters.The coder operates on speech frames of 20 ms corresponding to 160 samples at the sampling frequency of 8 000 sample/s. At each 160 speech samples, the speech signal is analysed to extract the parameters of the CELP model (LP filter coefficients, adaptive and fixed codebooks' indices and gains). These parameters are encoded and transmitted. At the decoder, these parameters are decoded and speech is synthesized by filtering the reconstructed excitation signal through the LP synthesis filter.
The signal flow at the encoder is shown in figure 3. LP analysis is performed twice per frame for the 12.2 kbit/s mode and once for the other modes. For the 12.2 kbit/s mode, the two sets of LP parameters are converted to line spectrum pairs (LSP) and jointly quantized using split matrix quantization (SMQ) with 38 bits. For the other modes, the single set of LP parameters is converted to line spectrum pairs (LSP) and vector quantized using split vector quantization (SVQ). The speech frame is divided into 4 subframes of 5 ms each (40 samples). The adaptive and fixed codebook parameters are transmitted every subframe. The quantized and unquantized LP parameters or their interpolated versions are used depending on the subframe. An open-loop pitch lag is estimated in every other subframe (except for the 5.15 and 4.75 kbit/s modes for which it is done once per frame) based on the perceptually weighted speech signal.
Then the following operations are repeated for each subframe:
The target signal
x n
is computed by filtering the LP residual through the weighted synthesis filter
W z H z
with the initial states of the filters having been updated by filtering the error between LP residual and excitation (this is equivalent to the common approach of subtracting the zero input response of the weighted synthesis filter from the weighted speech signal).The impulse response,
h n
of the weighted synthesis filter is computed.Closed-loop pitch analysis is then performed (to find the pitch lag and gain), using the target
x n
and impulse responseh n
, by searching around the open-loop pitch lag. Fractional pitch with 1/6th or 1/3rd of a sample resolution (depending on the mode) is used.The target signal
x n
is updated by removing the adaptive codebook contribution (filtered adaptive codevector), and this new target,x n
2
, is used in the fixed algebraic codebook search (to find the optimum innovation).The gains of the adaptive and fixed codebook are scalar quantified with 4 and 5 bits respectively or vector quantified with 6-7 bits (with moving average (MA) prediction applied to the fixed codebook gain).
Finally, the filter memories are updated (using the determined excitation signal) for finding the target signal in the next subframe.
The bit allocation of the AMR codec modes is shown in table 1. In each 20 ms speech frame, 95, 103, 118, 134, 148, 159, 204 or 244 bits are produced, corresponding to a bit-rate of 4.75, 5.15, 5.90, 6.70, 7.40, 7.95, 10.2 or
12.2 kbit/s. More detailed bit allocation among the codec parameters is given in tables 9a-9h. Note that the most significant bits (MSB) are always sent first.
Table 1: Bit allocation of the AMR coding algorithm for 20 ms frame
Mode Parameter 1st
subframe
2nd subframe
3rd subframe
4th subframe
total per frame
2 LSP sets 38
12.2 kbit/s Pitch delay 9 6 9 6 30
(GSM EFR) Pitch gain 4 4 4 4 16
Algebraic code 35 35 35 35 140
Codebook gain 5 5 5 5 20
Total 244
LSP set 26
10.2 kbit/s Pitch delay 8 5 8 5 26
Algebraic code 31 31 31 31 124
Gains 7 7 7 7 28
Total 204
LSP sets 27
7.95 kbit/s Pitch delay 8 6 8 6 28
Pitch gain 4 4 4 4 16
Algebraic code 17 17 17 17 68
Codebook gain 5 5 5 5 20
Total 159
LSP set 26
7.40 kbit/s Pitch delay 8 5 8 5 26
(TDMA EFR) Algebraic code 17 17 17 17 68
Gains 7 7 7 7 28
Total 148
LSP set 26
6.70 kbit/s Pitch delay 8 4 8 4 24
(PDC EFR) Algebraic code 14 14 14 14 56
Gains 7 7 7 7 28
Total 134
LSP set 26
5.90 kbit/s Pitch delay 8 4 8 4 24
Algebraic code 11 11 11 11 44
Gains 6 6 6 6 24
Total 118
LSP set 23
5.15 kbit/s Pitch delay 8 4 4 4 20
Algebraic code 9 9 9 9 36
Gains 6 6 6 6 24
Total 103
LSP set 23
4.75 kbit/s Pitch delay 8 4 4 4 20
Algebraic code 9 9 9 9 36
Gains 8 8 16
Total 95
4.4 Principles of the adaptive multi-rate speech decoder
The signal flow at the decoder is shown in figure 4. At the decoder, based on the chosen mode, the transmitted indices are extracted from the received bitstream. The indices are decoded to obtain the coder parameters at each transmission frame. These parameters are the LSP vectors, the fractional pitch lags, the innovative codevectors, and the pitch and innovative gains. The LSP vectors are converted to the LP filter coefficients and interpolated to obtain LP filters at each subframe. Then, at each 40-sample subframe:
- the excitation is constructed by adding the adaptive and innovative codevectors scaled by their respective gains;
- the speech is reconstructed by filtering the excitation through the LP synthesis filter.
Finally, the reconstructed speech signal is passed through an adaptive postfilter.
4.5 Sequence and subjective importance of encoded parameters
The encoder will produce the output information in a unique sequence and format, and the decoder must receive the same information in the same way. In table 9a-9h, the sequence of output bits and the bit allocation for each parameter is shown.
The different parameters of the encoded speech and their individual bits have unequal importance with respect to subjective quality. The output and input frame formats for the AMR speech codec are given in [2], where a reordering of bits take place.
5 Functional description of the encoder
In this clause, the different functions of the encoder represented in figure 3 are described.
5.1 Pre-processing (all modes)
Two pre-processing functions are applied prior to the encoding process: high-pass filtering and signal down-scaling.
Down-scaling consists of dividing the input by a factor of 2 to reduce the possibility of overflows in the fixed-point implementation.
The high-pass filter serves as a precaution against undesired low frequency components. A filter with a cut off frequency of 80 Hz is used, and it is given by:
2 1
2 1
1
1 1 . 906005859 0 . 911376953 927246903 .
0 8544941 .
1 927246093 .
) 0
(
z z
z z z
H
h . (4)Down-scaling and high-pass filtering are combined by dividing the coefficients at the numerator of
H
h1 z
by 2.5.2 Linear prediction analysis and quantization
12.2 kbit/s mode
Short-term prediction, or linear prediction (LP), analysis is performed twice per speech frame using the auto-correlation approach with 30 ms asymmetric windows. No lookahead is used in the auto-correlation computation.
The auto-correlations of windowed speech are converted to the LP coefficients using the Levinson-Durbin algorithm. Then the LP coefficients are transformed to the Line Spectral Pair (LSP) domain for quantization and interpolation purposes. The interpolated quantified and unquantized filter coefficients are converted back to the LP filter coefficients (to construct the synthesis and weighting filters at each subframe).
10.2, 7.95, 7.40, 6.70, 5.90, 5.15, 4.75 kbit/s modes
Short-term prediction, or linear prediction (LP), analysis is performed once per speech frame using the auto-correlation approach with 30 ms asymmetric windows. A lookahead of 40 samples (5 ms) is used in the auto-correlation computation.
The auto-correlations of windowed speech are converted to the LP coefficients using the Levinson-Durbin algorithm. Then the LP coefficients are transformed to the Line Spectral Pair (LSP) domain for quantization and interpolation purposes. The interpolated quantified and unquantized filter coefficients are converted back to the LP filter coefficients (to construct the synthesis and weighting filters at each subframe).
5.2.1 Windowing and auto-correlation computation
12.2 kbit/s mode
LP analysis is performed twice per frame using two different asymmetric windows. The first window has its weight concentrated at the second subframe and it consists of two halves of Hamming windows with different sizes. The window is given by:
w n
n
L n L
n L
L n L L L
I
I
I
I I
I I I
( )
. .46 , , , ,
. .46 ( )
, , , .
( )
( )
( ) ( )
( ) ( ) ( )
0 54 0
1 0 1
0 54 0
1 1
1
1
1 2
1 1 2
cos cos
(5)
The values
L
1( )I 160
andL
2( )I 80
are used. The second window has its weight concentrated at the fourth subframe and it consists of two parts: the first part is half a Hamming window and the second part is a quarter of a cosine function cycle. The window is given by:w n
n
L n L
n L
L n L L L
II
II
II
II II
II II II
( )
. .46 , , , ,
( )
, , ,
( )
( )
( ) ( )
( ) ( ) ( )
0 54 0 2
2 1 0 1
2
4 1 1
1
1
1 2
1 1 2
cos cos
(6)
where the values
L
1( )II 232
andL
2( )II 8
are used.Note that both LP analyses are performed on the same set of speech samples. The windows are applied to 80 samples from past speech frame in addition to the 160 samples of the present speech frame. No samples from future frames are used (no lookahead). A diagram of the two LP analysis windows is depicted below.
20 ms 5 ms
frame (160 samples) sub frame (40 samples)
frame n-1 frame n
t w (n)I
w (n)II
Figure 1: LP analysis windows
The auto-correlations of the windowed speech
s n n , 0 , 239
, are computed by:r
ack s n s n k k
n k
( ) ' ( ) ' ( ) , , , ,
2390 10
(7)and a 60 Hz bandwidth expansion is used by lag windowing the auto-correlations using the window:
w i f i
f i
lag
s
exp 1 , ,
2
2
01 10
2
, (8)where
f
0 60
Hz is the bandwidth expansion andf
s 8000
Hz is the sampling frequency. Further,r
ac( ) 0
is multiplied by the white noise correction factor 1.0001 which is equivalent to adding a noise floor at -40 dB.10.2, 7.95, 7.40, 6.70, 5.90, 5.15, 4.75 kbit/s modes
LP analysis is performed once per frame using an asymmetric window. The window has its weight concentrated at the fourth subframe and it consists of two parts: the first part is half a Hamming window and the second part is a quarter of a cosine function cycle. The window is given by equation (6) where the values
L
1 200
andL
2 40
are used.
The auto-correlations of the windowed speech
s n n , 0 , 239
, are computed by equation (7) and a 60 Hz bandwidth expansion is used by lag windowing the auto-correlations using the window of equation (8). Further,r
ac( ) 0
is multiplied by the white noise correction factor 1.0001 which is equivalent to adding a noise floor at -40 dB.5.2.2 Levinson-Durbin algorithm (all modes)
The modified auto-correlations
r ' ( )
ac0 1 0001 . r
ac( ) 0
andr ' ( )
ack r
ac( ) k w
lag( ), k k 1 , 10 ,
are used to obtain the direct form LP filter coefficientsa k
k, 1 , , , 10
by solving the set of equations.
a r
k aci k r i i
k
' ' ( ) ,
ac , , .
1 101 10
(9)The set of equations in (9) is solved using the Levinson-Durbin algorithm. This algorithm uses the following recursion:
E r
i a
k a r i j E i
a k
j i
a a k a
E i k E i
LD ac
i
i j
i j ac i
LD i
i i
j i
j i
i i j i
LD i LD
( ) ' ( )
' ( ) / ( )
( ) ( ) ( )
( )
( ) ( )
( ) ( ) ( )
0 0
1 10
1
1
1 1
1 1
0 1
1 0 1
1 1
2
for to do
for to do
end end
The final solution is given as
a
j a
(j10), j 1 , , 10
.The LP filter coefficients are converted to the line spectral pair (LSP) representation for quantization and interpolation purposes. The conversions to the LSP domain and back to the LP filter coefficient domain are described in the next clause.
5.2.3 LP to LSP conversion (all modes)
The LP filter coefficients
a k
k, 1 , , 10
, are converted to the line spectral pair (LSP) representation for quantization and interpolation purposes. For a 10th order LP filter, the LSPs are defined as the roots of the sum and difference polynomials:
F z
1A z z
11A z
1 (10)and
F z
2A z z
11A z
1 , (11)respectively. The polynomial
F z
1
andF z
2
are symmetric and anti-symmetric, respectively. It can be proven that all roots of these polynomials are on the unit circle and they alternate each other.F z
1
has a rootz 1
(
) andF z
2
has a rootz 1
( 0
). To eliminate these two roots, we define the new polynomials:
F z
1 F z
11 z
1 (12)and
F z
2 F z
21 z
1 (13)Each polynomial has 5 conjugate roots on the unit circle
e
j i , therefore, the polynomials can be written as
F z q z
iz
i 1
1 2
1 3 9
1 2
, , ,
(14)
and
F z q z
iz
i 2
1 2
2 4 10
1 2
, , ,
, (15)
where
q
i cos
i with i being the line spectral frequencies (LSF) and they satisfy the ordering property0
1
2
10
. We refer toq
i as the LSPs in the cosine domain.Since both polynomials
F z
1
andF z
2
are symmetric only the first 5 coefficients of each polynomial need to be computed. The coefficients of these polynomials are found by the recursive relations (fori = 0
to 4):
f i a a f i
f i a a f i
i m i
i m i
1 1 1
2 1 2
1 1
(16)where
m 10
is the predictor order.The LSPs are found by evaluating the polynomials
F z
1
andF z
2
at 60 points equally spaced between 0 andand checking for sign changes. A sign change signifies the existence of a root and the sign change interval is then divided 4 times to better track the root. The Chebyshev polynomials are used to evaluate
F z
1
andF z
2
. In this method the roots are found directly in the cosine domain q
i . The polynomialsF z
1
orF z
2
evaluated atz e
j can be written as:
F 2 e
j5C x
, with:
C x T x
5 f 1 T x
4 f 2 T x
3 f 3 T x
2 f 4 T x
1 f 5 2
, (17)where
T
m x cos m
is them
th order Chebyshev polynomial, andf i i , 1 , , 5
are the coefficients of eitherF z
1
orF z
2
, computed using the equations in (16). The polynomialC x
is evaluated at a certain value ofx cos
using the recursive relation:for down to end
k
x f k
C x x f
k k k
4 1
2 5
5 2
1 2
1 2
( )
( ) ( ) / ,
with initial values
5 1
and
6 0 .
The details of the Chebyshev polynomial evaluation method are found in P. Kabal and R.P. Ramachandran [4].5.2.4 LSP to LP conversion (all modes)
Once the LSPs are quantified and interpolated, they are converted back to the LP coefficient domain
a
k . Theconversion to the LP domain is done as follows. The coefficients of
F z
1
orF z
2
are found by expanding equations (14) and (15) knowing the quantified and interpolated LSPsq
i, = , i 1 , 10
. The following recursive relation is used to computef i
1
:
for to
for down to end
end i
f i q f i f i
j i
f j f j q f j f j
i
i
1 5
2 1 2 2
1 1
2 1 2
1 2 1 1 1
1 1 2 1 1 1
with initial values
f
1 0 1
andf
1 1 0
. The coefficientsf
2 i
are computed similarly by replacingq
2 1iby
q
2 .iOnce the coefficients
f i
1
andf
2 i
are found,F z
1
andF z
2
are multiplied by1 z
1 and1 z
1, respectively, to obtainF z
1
andF z
2
; that is:
f i f i f i i
f i f i f i i
1 1 1
2 2 2
1 1 5
1 1 5
, , ,
, , ,
. (18)Finally the LP coefficients are found by:
a f i f i i
f i f i i
i
0 5 0 5 1 5
0 5 11 0 5 11 6 10
1 2
1 2
. . , , ,
. . , , ,
. (19)This is directly derived from the relation
A z F z
1 F z
2 2
, and considering the fact thatF z
1
and
F z
2 are symmetric and anti-symmetric polynomials, respectively.5.2.5 Quantization of the LSP coefficients
12.2 kbit/s mode
The two sets of LP filter coefficients per frame are quantified using the LSP representation in the frequency domain;
that is:
f f
q i
i s
i
2 1 10
arccos , , , ,
(20)where
f
i are the line spectral frequencies (LSF) in Hz [0,4 000] andf
s 8000
is the sampling frequency. The LSF vector is given byf
t f f
1 2 f
10
, witht
denoting transpose.A 1st order MA prediction is applied, and the two residual LSF vectors are jointly quantified using split matrix quantization (SMQ). The prediction and quantization are performed as follows. Let
z
(1) n
andz
(2) n
denote the mean-removed LSF vectors at framen
. The prediction residual vectorsr
(1) n
andr
(2) n
are given by:
r z p
r z p
( ) ( )
( ) ( )
, ,
1 1
2 2
n n n
n n n
and
(21) where
p( ) n
is the predicted LSF vector at framen
. First order moving-average (MA) prediction is used where:
p n 0 65 . r
( )2n 1
, (22)where
r
( )2 n 1
is the quantified second residual vector at the past frame.The two LSF residual vectors
r
(1) andr
(2) are jointly quantified using split matrix quantization (SMQ). The matrix r
(1)r
(2)
is split into 5 submatrices of dimension 2 x 2 (two elements from each vector). For example, the first submatrix consists of the elementsr
1( )1 ,r
2( )1 ,r
1( )2 , andr
2( )2 . The 5 submatrices are quantified with 7, 8, 8+1, 8, and 6 bits, respectively. The third submatrix uses a 256-entry signed codebook (8-bit index plus 1-bit sign).A weighted LSP distortion measure is used in the quantization process. In general, for an input LSP vector
f
and a quantified vector at indexk
,f
k, the quantization is performed by finding the indexk
which minimizes:
E
LSPf w
i if w
ik ii
.
110 2
(23)
The weighting factors
w i
i, 1 , , 10
, are given by 450 otherwise,
1050 - 0.8 1.8
=
, 450 450 for
547 . 347 1 . 3
i
i i
i
d
d d
w
(24)
where
d
i f
i1 f
i1 withf
0 0
andf
11 4000
. Here, two sets of weighting coefficients are computed for the two LSF vectors. In the quantization of each submatrix, two weighting coefficients from each set are used with their corresponding LSFs.10.2, 7.95, 7.40, 6.70, 5.90, 5.15, 4.75 kbit/s modes
The set of LP filter coefficients per frame is quantified using the LSP representation in the frequency domain using equation (20).
A 1st order MA prediction is applied, and the residual LSF vector is quantified using split vector quantization. The prediction and quantization are performed as follows. Let