Recursive Calculation of Mel-Cepstrum from LP Coefficients
Keiichi Tokuda†, Takao Kobayashi††, and Satoshi Imai††,†Department of Computer Science

Nagoya Institute of Technology, Nagoya, 466-8555 Japan††Precision and Intelligence Laboratory
Tokyo Institute of Technology, Yokohama, 227 Japan
1 April 1994

Abstract
The mel-cepstral coefficients are often calculated from the linear prediction coefficients byusing recursion formulas. However, the obtained mel-cepstral coefficients have errors causedby truncation in the quefrency domain. The purpose of this report is to point out that the melcepstral coefficients can be calculated from the LP (Linear Prediction) coefficients using therecursion formulas without the truncation error.

1 INTRODUCTION
The mel-cepstrum is useful parameter for speech recognition, and have widely been used in many
speech recognition systems [1]. There exist several methods to obtain mel-cepstral coefficients. In
the case using recursion formulas, the mel-cepstral coefficients, i.e., frequency-transformed cepstralcoefficients, are calculated from the LP (Linear Prediction) coefficients as follows: the LP coefficients are first transformed to the cepstral coefficients by using the recursion formula of [2], then thecepstral coefficients transformed to the mel-cepstral coefficients by using the recursion formula of[3]. However, since the cepstrum calculated from the LP coefficients is an infinite sequence, it mustbe truncated in the quefrency domain. As a result, we cannot obtain exact values of mel-cepstralcoefficients.
This report points out that the mel-cepstral coefficients can be calculated from the LP coefficients without the truncation error when we first apply the recursion formula for frequencytransformation, and then apply the recursion formula of LPC-cepstrum.

2 Definition of The Mel-Cepstrum
The cepstrum1 c(m) of a real sequence x(n) is defined as1c(m) =2πj1


Clog X(z) z m−1 dz

Strictly, the complex cepstrum defined by A. V. Oppenheim and R. W. Schafer [4].

1(1)

∞
log X(z) =c(m) z −m(2)m=−∞where X(z) is the z-transform of x(n), and C is a counterclockwise closed contour in the region ofconvergence of log X(z) and encircling the origin of the z-plane. Frequency-transformed cepstrum,so-called mel-cepstrum [5], is defined asc̃(m) =12πjC

log X(z) z̃ m−1 dz̃
∞

log X(z) =c̃(m) z̃ −m(3)

(4)

m=−∞

wherez̃ −1 = Ψ(z) =z −1 − α,
1 − α z −1

| α | < 1.

(5)

The phase response ω̃ of the all-pass system Ψ(ejω ) = e−j ω̃ is given byω̃ = β(ω) = tan−1(1 − α2 ) sin ω.
(1 + α2 ) cos ω − 2α(6)Thus, evaluating (3) and (4) on the unit circle of the z̃-plane, we see that c̃(m) is the inverse Fouriertransform of log X(ejω ) calculated on a warped frequency scale ω̃:c̃(m) =12π π−πlog X̃(ej ω̃ ) ej ω̃m dω̃∞log X̃(ej ω̃ ) =c̃(m) e−j ω̃m(7)

(8)

m=−∞

whereX̃(ej ω̃ ) = X(ejβ−1 (ω̃)

).

(9)

The phase response ω̃ = β(ω) gives a good approximation to auditory frequency scales with anappropriate choice of α. An example of 16kHz sampling is shown in Fig. 1. In the figure, dashedlines show the mel [6] and Bark2 frequency scales normalized by 8kHz. Table 1 shows examples ofα for approximating the mel and Bark scales at several sampling frequencies.
The system function obtained by the LP method has the formKH(z) =1+M(10)a(m) z −mm=1

where we assume that H(z) is a minimum phase system3 . The problem is to calculate the melcepstral coefficients c̃(m), m = 0, 1, . . . , N given by
Klog1+M

=a(m) z −m∞c̃(m)z̃ −mm=0

m=12A piecewise function shown in [7] is used for plotting the Bark scale.
3The system H(z) obtained by the autocorrelation method is always minimum phase.

2(11)~ (rad)Warped radian frequency ωππ /20π /20π

Radian frequency ω (rad)~ (rad)Warped radian frequency ω(a) mel scale (α = 0.42)

ππ /20π /20π

Radian frequency ω (rad)(b) Bark scale (α = 0.55)
Figure 1: Phase responses ω̃ = β(ω) of Ψ(ejω ) = e−j ω̃ (real lines) and auditory frequency scales(dashed lines). (16kHz of sampling frequency)

3Table 1: Examples of α.
Sampling Frequency
mel scale
Bark scale

8kHz
0.31
0.42

10kHz
0.35
0.47

12kHz
0.37
0.50

16kHz
0.42
0.55

20kHz
0.44
—

22.05kHz
0.45—

from the LP coefficients a(m), m = 1, 2, . . . , M and K. It is noted that when the system H(z) isof minimum phase, the mel-cepstrum becomes a causal and stable sequence.
In the conventional recursive calculation method, the mel-cepstral coefficients are calculated asfollows:
1. The cepstral coefficients c(m)’s given byKlogM1+∞

=a(m) zc(m) z −m(12)

m=0−m

m=1

are calculated by using the recursion formula of [2].
2. The mel-cepstral coefficients c̃(m), m = 1, 2, . . . , N given by∞∞c(m) z −m =m=0c̃(m)z̃ −m(13)m=0

are calculated by using the recursion formula for frequency transformation [3].
Unfortunately, the cepstrum obtained by (12) is an infinite sequence and we require the infinite
sequence to calculate finite number of the mel-cepstral coefficients given by (13). Practically, themel-cepstrum is calculated from truncated cepstrum by an approximation:L∞c(m) z −m =m=0c̃(m)z̃ −m .

(14)

m=0

It is noted that to reduce the truncation error sufficiently, L should be chosen in such a way thatL >> M . The complexity to calculate c̃(m), m = 0, 1, . . . , N from a(m), m = 1, 2, . . . , M and
K is O(M L) + O(LN ).

3 Recursive Calculation of The Mel-Cepstrum
The following procedure can avoid the trancation error:
1. The frequency transformed LP coefficients are first calculated based on the relation:
K1+M

a(m) zK̃=−m1+∞
ã(k)z̃m=1

m=1by the recursion formula for frequency transformation [3].
4(15)−m

2. The mel-cepstrum given byK̃

log1+∞
=ã(k)z̃−m∞c̃(m)z̃ −m(16)

m=0

m=1

are calculated by the recursion formula of [2].
Although ã(m) is an infinite sequence, the mel-cepstral coefficients c̃(m), m = 0, 1, . . . , N givenby (16) can be calculated from the finite sequence ã(m), m = 1, 2, . . . , N and K̃. Therefore, it is
not necessary to calculate infinite number of coefficients ã(m), m = 1, 2, . . . , ∞.
The recursion formulas for calculation of mel-cepstrum from LP coefficients are written as
follows:ã(i) (m) =(i−1) (0),
 a(−i) + α ã(1 − α2 ) ã(i−1) (0) + α ã(i−1) (1), ã(i−1) (m − 1) + α (ã(i−1) (m) − ã(i) (m − 1)),i = −M, . . . , −1, 0K̃ = K/ã(0) (0),ã(m) = ã(0) (m)/ã(0) (0),c̃(m) =m−1 log K̃, −ã(m) −m=0
m=1m = 2, 3, . . . , N(17)1≤m≤N(18)m=0kc̃(k) ã(m − k),m
k=1

1≤m≤N(19)where a(0) = 1.
The above algorithm calculates c̃(m), m = 1, 2, . . . , N from a(m), m = 1, 2, . . . , M and K withthe complexity of O(M N )+O(N 2 ). Note that the above algorithm is a special case of the recursion
formula of [8], [9].

4 Example
Fig. 2(a) shows an example of the spectrum obtained by the LP method. Fig. 2(b) and (c) show
the spectra represented by the mel-cepstra which obtained the conventional and proposed methods,respectively. The spectrum represented by the mel-cepstral coefficients c̃(m), m = 0, 1, . . . , N isgiven by
HN (ejω ) = expN
c̃(m)z̃ −m .

(20)

m=0

From the figures, it is seen that the spectrum obtained by the conventional method loses the feature
at the low frequencies because of the truncation in the quefrency domain. On the other hand, theproposed method is independent from the truncation in the quefrency domain. In this simulation,
L = 15 (= N = M ) is used for the conventional calculation method. Although the truncation
error can be reduced sufficiently with L greater than about 2M , we cannot obtain exact values ofmel-cepstral coefficients unless L → ∞.

5120
Log magnitued (dB)

H(ejω)
periodogram
80

400024Frequency (Hz)68(a) Original spectrum (M = 15)120
Log magnitued (dB)

HN(ejω)periodogram
80

400024Frequency (Hz)68(b) Conventional method (L = N = 15)120
Log magnitued (dB)

HN(ejω)periodogram
80

400024Frequency (Hz)68(c) Proposed method (N = 15)
Figure 2: Spectra represented by the mel-cepstra which are calculated from the LP coefficients byusing the conventional and proposed methods. (α = 0.42)
65 CONCLUSIONSIn this report, we have shown a recursive calculation method of mel-cepstral coefficients from LPcoefficients. Our approach first applies the frequency transformation and then applies the recursion
formula of [2]. Using the recursion formulas, we can obtain the mel-cepstral coefficients without
the error caused by the truncation in the quefrency domain.
In the LP method, the LP coefficients are determined to minimize the mean square of linear
prediction error. However, N -th order mel-cepstral coefficients, which are obtained from the LP
coefficients by the recursion formulas, do not minimize the mean square of linear prediction error.
To avoid this problem, we have already proposed a mel-cepstral analysis method [10], [11], in which
we can extract mel-cepstral coefficients which minimizes the mean square of linear prediction error
directly.

References[1] J. W. Picone, “Signal modeling techniques in speech recognition,” in Proc. IEEE, vol. 81 no.
9, pp.1215–1247, Sep. 1993.
[2] B. S. Atal, “Effectiveness of linear prediction characteristics of the speech wave for automatic
speaker identification and verification,” in J. Acoust. Soc. America, vol. 55, no. 6, pp.1304–1312, June. 1974.
[3] A. V. Oppenheim and D. H. Johnson, “Discrete representation of signals,” in Proc. IEEE, vol.
60, no. 7, pp.681-691, June 1972.
[4] A. V. Oppenheim and R. W. Schafer, Descrete-Time Signal Processing, Englewood Cliffs,
N.J.: Prentice-Hall, 1989.
[5] S. Imai, K. Sumita, C. Furuichi, “Mel log spectral approximation filter for speech synthesis”,
Trans. IECE, vol. J66-A, pp.122–129, Feb. 1983 (in Japanese).
[6] G. Fant, Speech sound and features. Cambridge: MIT Press, 1973.
[7] S. Seneff, “A computational model for the peripheral auditory system: application to speech
recognition research,” in Proc. ICASSP’86, 1986, pp.1983–1986.
[8] K. Tokuda, T. Kobayashi and S. Imai, “Recursion formula for calculation of mel generalizedcepstrum coefficients,” Trans. IEICE, vol. J71-A, pp.128–131 Jan. 1988 (in Japanese).
[9] K. Tokuda, T. Masuko, T. Kobayashi and S. Imai, “Mel-generalized cepstral analysis —aunified approach to speech spectral estimation,” in Proc. ICSLP-94, 1994, pp.1043–1046.
[10] T. Fukada, K. Tokuda, T. Kobayashi and S. Imai, “An adaptive algorithm for mel-cepstral
analysis of speech,” in Proc. ICASSP, 1992, pp.137–140.
[11] K. Tokuda, T. Kobayashi, T. Fukada, H. Saito and S. Imai, “Spectral estimation of speechbased on mel-cepstral representation,” Trans. IEICE, vol. J74-A, pp.1240–1248, Aug. 1991
(in Japanese).

7