/Users/richardeakin/projects/libsms/trunk/src/cepstrum.c File Reference

routines for different Fast Fourier Transform Algorithms More...

#include "sms.h"
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_linalg.h>
#include <gsl/gsl_blas.h>
Include dependency graph for cepstrum.c:

Defines

#define COEF   ( 8 * powf(PI, 2))
#define CHOLESKY   1

Functions

void FreeDCepstrum (CepstrumMatrices *m)
void AllocateDCepstrum (int nPoints, int nCoeff, CepstrumMatrices *m)
void sms_dCepstrum (int sizeCepstrum, sfloat *pCepstrum, int sizeFreq, sfloat *pFreq, sfloat *pMag, sfloat fLambda, int iMaxFreq)
 Discrete Cepstrum Transform.
void sms_dCepstrumEnvelope (int sizeCepstrum, sfloat *pCepstrum, int sizeEnv, sfloat *pEnv)
 Spectrum Envelope from Cepstrum.
void sms_spectralEnvelope (SMS_Data *pSmsData, SMS_SEnvParams *pSpecEnvParams)
 main function for computing spectral envelope from sinusoidal peaks

Detailed Description

routines for different Fast Fourier Transform Algorithms


Define Documentation

#define CHOLESKY   1
#define COEF   ( 8 * powf(PI, 2))

Referenced by sms_dCepstrum().


Function Documentation

void AllocateDCepstrum ( int  nPoints,
int  nCoeff,
CepstrumMatrices *  m 
)

References FreeDCepstrum().

Referenced by sms_dCepstrum().

Here is the call graph for this function:

void FreeDCepstrum ( CepstrumMatrices *  m  ) 

Referenced by AllocateDCepstrum().

void sms_dCepstrum ( int  sizeCepstrum,
sfloat *  pCepstrum,
int  sizeFreq,
sfloat *  pFreq,
sfloat *  pMag,
sfloat  fLambda,
int  iMaxFreq 
)

Discrete Cepstrum Transform.

method for computing cepstrum aenalysis from a discrete set of partial peaks (frequency and amplitude)

This implementation is owed to the help of Jordi Janer (thanks!) from the MTG, along with the following paper: "Regularization Techniques for Discrete Cepstrum Estimation" Olivier Cappe and Eric Moulines, IEEE Signal Processing Letters, Vol. 3 No.4, April 1996

Todo:
add anchor point add at frequency = 0 with the same magnitude as the first peak in pMag. This does not change the size of the cepstrum, only helps to smoothen it at the very beginning.
Parameters:
sizeCepstrum order+1 of the discrete cepstrum
pCepstrum pointer to output array of cepstrum coefficients
sizeFreq number of partials peaks (the size of pFreq should be the same as pMag
pFreq pointer to partial peak frequencies (hertz)
pMag pointer to partial peak magnitudes (linear)
fLambda regularization factor
iMaxFreq maximum frequency of cepstrum

References AllocateDCepstrum(), COEF, PI, PI_2, sfloat, and sms_sine().

Referenced by sms_spectralEnvelope().

Here is the call graph for this function:

void sms_dCepstrumEnvelope ( int  sizeCepstrum,
sfloat *  pCepstrum,
int  sizeEnv,
sfloat *  pEnv 
)

Spectrum Envelope from Cepstrum.

from a set of cepstrum coefficients, compute the spectrum envelope

Parameters:
sizeCepstrum order + 1 of the cepstrum
pCepstrum pointer to array of cepstrum coefficients
sizeEnv size of spectrum envelope (max frequency in bins)
Todo:
does this have to be a pow2
Parameters:
pEnv pointer to output spectrum envelope (real part only)

References EXP, sfloat, sms_error(), sms_fft(), and sms_power2().

Referenced by sms_spectralEnvelope().

Here is the call graph for this function:

void sms_spectralEnvelope ( SMS_Data pSmsData,
SMS_SEnvParams pSpecEnvParams 
)

main function for computing spectral envelope from sinusoidal peaks

Magnitudes should already be in linear for this function. If pSmsData->iEnvelope == SMS_ENV_CEP, will return cepstrum coefficeints If pSmsData->iEnvelope == SMS_ENV_FBINS, will return linear magnitude spectrum

Parameters:
pSmsData pointer to SMS_Data structure with all the arrays necessary
pSpecEnvParams pointer to a structure of parameters for spectral enveloping

References SMS_SEnvParams::fLambda, SMS_SEnvParams::iAnchor, SMS_SEnvParams::iMaxFreq, SMS_SEnvParams::iOrder, SMS_SEnvParams::iType, SMS_SEnvParams::nCoeff, SMS_Data::nEnvCoeff, SMS_Data::nTracks, SMS_Data::pFSinAmp, SMS_Data::pFSinFreq, SMS_Data::pSpecEnv, sfloat, sms_dCepstrum(), sms_dCepstrumEnvelope(), SMS_ENV_FBINS, and sms_error().

Referenced by sms_analyze().

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Thu Oct 29 04:08:06 2009 for libsms by  doxygen 1.6.1