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

various filters More...

#include "sms.h"
Include dependency graph for filters.c:

Defines

#define SMS_EMPH_COEF   .9
 coefficient for pre_emphasis filter

Functions

sfloat sms_preEmphasis (float fInput)
sfloat sms_deEmphasis (sfloat fInput)
static sfloat ZeroPoleFilter (float *pFa, sfloat *pFb, int nCoeff, sfloat fInput)
 function to implement a zero-pole filter
void sms_filterHighPass (int sizeResidual, sfloat *pResidual, int iSamplingRate)
 function to filter a waveform with a high-pass filter
void sms_filterArray (sfloat *pFArray, int size1, int size2, sfloat *pFOutArray)
 a spectral filter

Detailed Description

various filters


Define Documentation

#define SMS_EMPH_COEF   .9

coefficient for pre_emphasis filter

Referenced by sms_deEmphasis(), and sms_preEmphasis().


Function Documentation

sfloat sms_deEmphasis ( sfloat  fInput  ) 

References sfloat, and SMS_EMPH_COEF.

Referenced by sms_synthesize(), and sms_writeResSound().

void sms_filterArray ( sfloat *  pFArray,
int  size1,
int  size2,
sfloat *  pFOutArray 
)

a spectral filter

filter each point of the current array by the surounding points using a triangular window

Parameters:
pFArray two dimensional input array
size1 vertical size of pFArray
size2 horizontal size of pFArray
pFOutArray output array of size size1

References sfloat.

Referenced by FilterMagEnv().

void sms_filterHighPass ( int  sizeResidual,
sfloat *  pResidual,
int  iSamplingRate 
)

function to filter a waveform with a high-pass filter

cutoff =1500 Hz

Todo:
this filter only works on sample rates up to 48k?
Parameters:
sizeResidual size of signal
pResidual pointer to residual signal
iSamplingRate sampling rate of signal

References sfloat, and ZeroPoleFilter().

Referenced by sms_analyze().

Here is the call graph for this function:

sfloat sms_preEmphasis ( float  fInput  ) 

References sfloat, and SMS_EMPH_COEF.

Referenced by sms_fillSoundBuffer().

static sfloat ZeroPoleFilter ( float *  pFa,
sfloat *  pFb,
int  nCoeff,
sfloat  fInput 
) [static]

function to implement a zero-pole filter

Todo:
will forgetting to reset pD to zero at the beginning of a new analysis (when there are multiple analyses within the life of one program) cause problems?
Parameters:
pFa pointer to numerator coefficients
pFb pointer to denominator coefficients
nCoeff number of coefficients
fInput input sample
Returns:
value is the filtered sample

References sfloat.

Referenced by sms_filterHighPass().

 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