# mlib_signalcepstral_s16(3mlib) [sunos man page]

```mlib_SignalCepstral_S16(3MLIB)				    mediaLib Library Functions				    mlib_SignalCepstral_S16(3MLIB)

NAME
mlib_SignalCepstral_S16 - perform cepstral analysis

SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ]
#include <mlib.h>

mlib_status mlib_SignalCepstral_S16(mlib_s16 *cepst, mlib_s32 cscale, const mlib_s16 *signal, void *state);

DESCRIPTION
The  mlib_SignalCepstral_S16()  function  performs cepstral analysis.  The user supplied scaling factor will be used and the output will be
saturated if necessary.

The basic operations to compute the cepstrum is shown below.

+-----------+	+--------+	 +-----------+
|	Fourier  |	|	 |	 |  Inverse  |
----->|		 |----->| log|*| |------>|  Fourier  |----->
x(n) | Transform | X(k) |	 | X'(k) | Transform | c(n)
+-----------+	+--------+	 +-----------+

where x(n) is the input signal and c(n) is its cepstrum. In mathematics, they are

N-1		 2*PI*k*n
X(k) = SUM x(n) * exp(-j*----------)
n=0		    N

X'(k) = log|X(k)|

1  N-1		     2*PI*k*n
c(n) = --- SUM X'(k) * exp(j*----------)
N  n=0			N

Since X'(k) is real and even (symmetric), i.e.

X'(k) = X'(N - k)

the c(n) is real and the equation becomes Cosine transform.

1  N-1		   2*PI*k*n
c(n) = --- SUM X'(k) * cos(----------)
N  n=0		      N

The cepstral coefficients in LPC is a special case of the above.

See Digital Signal Processing by Alan V. Oppenheim and Ronald W. Schafer, Prentice Hall, 1974.

See Fundamentals of Speech Recognition by Lawrence Rabinerand Biing-Hwang Juang, Prentice Hall, 1993.

PARAMETERS
The function takes the following arguments:

cepst	       The cepstral coefficients.

cscale	       The scaling factor of cepstral coefficients, where actual_data = output_data * 2**(-scaling_factor).

signal	       The input signal vector, the signal samples are in Q15 format.

state	       Pointer to the internal state structure.

RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE.

ATTRIBUTES
See attributes(5) for descriptions of the following attributes:

+-----------------------------+-----------------------------+
|      ATTRIBUTE TYPE	     |	    ATTRIBUTE VALUE	   |
+-----------------------------+-----------------------------+
|Interface Stability	     |Evolving			   |
+-----------------------------+-----------------------------+
|MT-Level		     |MT-Safe			   |
+-----------------------------+-----------------------------+

SunOS 5.10							    10 Nov 2004 				    mlib_SignalCepstral_S16(3MLIB)```

## Check Out this Related Man Page

```mlib_SignalLPC2Cepstral_S16(3MLIB)			    mediaLib Library Functions				mlib_SignalLPC2Cepstral_S16(3MLIB)

NAME
mlib_SignalLPC2Cepstral_S16 - convert linear prediction coefficients to cepstral coefficients

SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ]
#include <mlib.h>

mlib_status mlib_SignalLPC2Cepstral_S16(mlib_s16 *cepst,
mlib_s32 cscale, const mlib_s16 *lpc, mlib_s32 lscale,
mlib_s16 gain, mlib_s32 gscale, mlib_s32 length,
mlib_s32 order);

DESCRIPTION
The mlib_SignalLPC2Cepstral_S16() function converts linear prediction coefficients to cepstral coefficients. The user supplied scaling fac-
tor, cscale, will be used and the output will be saturated if necessary.

The cepstral coefficients are the coefficients of the Fourier transform representation of the log magnitude spectrum.

The LPC cepstral coefficients can be derived recursively from the LPC coefficients as following.

c(0) = log(G)

m-1  k
c(m) = a(m) + SUM --- * c(k) * a(m-k), 1 <= m <= M
k=1  m

m-1  k
c(m) = SUM --- * c(k) * a(m-k), m > M
k=1  m

See Fundamentals of Speech Recognition by Lawrence Rabiner and Biing-Hwang Juang, Prentice Hall, 1993.

PARAMETERS
The function takes the following arguments:

cepst	 The cepstral coefficients.

cscale	 The scaling factor of the cepstral coefficients, where actual_data = output_data * 2**(-scaling_factor).

lpc	 The linear prediction coefficients.

lscale	 The scaling factor of the linear prediction coefficients, where actual_data = input_data * 2**(-scaling_factor).

gain	 The gain of the LPC model.

gscale	 The scaling factor of the gain of the LPC model, where actual_data = input_data * 2**(-scaling_factor).

length	 The length of the cepstral coefficients.

order	 The order of the linear prediction filter.

RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE.

ATTRIBUTES
See attributes(5) for descriptions of the following attributes:

+-----------------------------+-----------------------------+
|      ATTRIBUTE TYPE	     |	    ATTRIBUTE VALUE	   |
+-----------------------------+-----------------------------+
|Interface Stability	     |Committed 		   |
+-----------------------------+-----------------------------+
|MT-Level		     |MT-Safe			   |
+-----------------------------+-----------------------------+