Cinder  0.9.1
Namespaces | Classes | Typedefs | Enumerations | Functions
cinder::audio::dsp Namespace Reference

Namespaces

 ooura
 

Classes

class  Biquad
 
class  Converter
 
class  ConverterImplR8brain
 
class  Fft
 
class  RingBufferT
 

Typedefs

typedef RingBufferT< float > RingBuffer
 

Enumerations

enum  WindowType { WindowType::BLACKMAN, WindowType::HAMMING, WindowType::HANN, WindowType::RECT }
 

Functions

void mixBuffers (const Buffer *sourceBuffer, Buffer *destBuffer, size_t numFrames)
 
void mixBuffers (const Buffer *sourceBuffer, Buffer *destBuffer)
 
void sumBuffers (const Buffer *sourceBuffer, Buffer *destBuffer, size_t numFrames)
 
void sumBuffers (const Buffer *sourceBuffer, Buffer *destBuffer)
 
template<typename SourceT , typename DestT >
void convert (const SourceT *sourceArray, DestT *destArray, size_t length)
 
template<typename SourceT , typename DestT >
void convertBuffer (const BufferT< SourceT > *sourceBuffer, BufferT< DestT > *destBuffer)
 
template<typename FloatT >
void convertInt24ToFloat (const char *sourceArray, FloatT *destArray, size_t length)
 
template<typename FloatT >
void convertFloatToInt24 (const FloatT *sourceArray, char *destArray, size_t length)
 
template<typename T >
void interleave (const T *nonInterleavedSourceArray, T *interleavedDestArray, size_t numFramesPerChannel, size_t numChannels, size_t numCopyFrames)
 
template<typename FloatT >
void interleave (const FloatT *nonInterleavedFloatSourceArray, int16_t *interleavedInt16DestArray, size_t numFramesPerChannel, size_t numChannels, size_t numCopyFrames)
 
template<typename T >
void deinterleave (const T *interleavedSourceArray, T *nonInterleavedDestArray, size_t numFramesPerChannel, size_t numChannels, size_t numCopyFrames)
 
template<typename FloatT >
void deinterleave (const int16_t *interleavedInt16SourceArray, FloatT *nonInterleavedFloatDestArray, size_t numFramesPerChannel, size_t numChannels, size_t numCopyFrames)
 
template<typename T >
void interleaveBuffer (const BufferT< T > *nonInterleavedSource, BufferInterleavedT< T > *interleavedDest)
 
template<typename T >
void deinterleaveBuffer (const BufferInterleavedT< T > *interleavedSource, BufferT< T > *nonInterleavedDest)
 
template<typename T >
void interleaveStereoBuffer (const BufferT< T > *nonInterleavedSource, BufferInterleavedT< T > *interleavedDest)
 
template<typename T >
void deinterleaveStereoBuffer (const BufferInterleavedT< T > *interleavedSource, BufferT< T > *nonInterleavedDest)
 
void generateBlackmanWindow (float *window, size_t length)
 
void generateHammingWindow (float *window, size_t length)
 
void generateHannWindow (float *window, size_t length)
 
void generateWindow (WindowType windowType, float *window, size_t length)
 
void fill (float value, float *array, size_t length)
 
void add (const float *array, float scalar, float *result, size_t length)
 
void add (const float *arrayA, const float *arrayB, float *result, size_t length)
 
void sub (const float *array, float scalar, float *result, size_t length)
 
void sub (const float *arrayA, const float *arrayB, float *result, size_t length)
 
void mul (const float *array, float scalar, float *result, size_t length)
 
void mul (const float *arrayA, const float *arrayB, float *result, size_t length)
 
void divide (const float *array, float scalar, float *result, size_t length)
 
void divide (const float *arrayA, const float *arrayB, float *result, size_t length)
 
void addMul (const float *arrayA, const float *arrayB, float scalar, float *result, size_t length)
 
float sum (const float *array, size_t length)
 
float rms (const float *array, size_t length)
 
void normalize (float *array, size_t length, float maxValue=1)
 

Typedef Documentation

Enumeration Type Documentation

Describes the avaiable windowing functions.

Enumerator
BLACKMAN 
HAMMING 
HANN 
RECT 

no window

Function Documentation

void cinder::audio::dsp::mixBuffers ( const Buffer sourceBuffer,
Buffer destBuffer,
size_t  numFrames 
)

Mixes numFrames frames of sourceBuffer to destBuffer's layout, replacing its content. Channel up or down mixing is applied if necessary.

void cinder::audio::dsp::mixBuffers ( const Buffer sourceBuffer,
Buffer destBuffer 
)

Mixes sourceBuffer to destBuffer's layout, replacing its content. Channel up or down mixing is applied if necessary. Unequal frame counts are permitted (the minimum size will be used).

void cinder::audio::dsp::sumBuffers ( const Buffer sourceBuffer,
Buffer destBuffer,
size_t  numFrames 
)

Sums numFrames frames of sourceBuffer into destBuffer. Channel up or down mixing is applied if necessary.

void cinder::audio::dsp::sumBuffers ( const Buffer sourceBuffer,
Buffer destBuffer 
)

Sums sourceBuffer into destBuffer. Channel up or down mixing is applied if necessary. Unequal frame counts are permitted (the minimum size will be used).

template<typename SourceT , typename DestT >
void cinder::audio::dsp::convert ( const SourceT *  sourceArray,
DestT *  destArray,
size_t  length 
)

Converts between two arrays of different precision (ex. float to double). length samples are converted.

template<typename SourceT , typename DestT >
void cinder::audio::dsp::convertBuffer ( const BufferT< SourceT > *  sourceBuffer,
BufferT< DestT > *  destBuffer 
)

Converts between two BufferT's of different precision (ex. float to double). The number of frames converted is the lesser of the two. The number of channels converted is the lesser of the two.

template<typename FloatT >
void cinder::audio::dsp::convertInt24ToFloat ( const char *  sourceArray,
FloatT *  destArray,
size_t  length 
)

Converts the 24-bit int sourceArray to floating point precision, placing the result in destArray. length samples are converted.

template<typename FloatT >
void cinder::audio::dsp::convertFloatToInt24 ( const FloatT *  sourceArray,
char *  destArray,
size_t  length 
)

Converts the floating point sourceArray to 24-bit int precision, placing the result in destArray. length samples are converted.

template<typename T >
void cinder::audio::dsp::interleave ( const T *  nonInterleavedSourceArray,
T *  interleavedDestArray,
size_t  numFramesPerChannel,
size_t  numChannels,
size_t  numCopyFrames 
)

Interleaves numCopyFrames of nonInterleavedSourceArray, placing the result in interleavedDestArray. numFramesPerChannel and numChannels describe the layout of the non-interleaved array.

template<typename FloatT >
void cinder::audio::dsp::interleave ( const FloatT *  nonInterleavedFloatSourceArray,
int16_t *  interleavedInt16DestArray,
size_t  numFramesPerChannel,
size_t  numChannels,
size_t  numCopyFrames 
)

Interleaves numCopyFrames of nonInterleavedFloatSourceArray and converts from floating point to 16-bit int precision at the same time, placing the result in interleavedInt16DestArray. numFramesPerChannel and numChannels describe the layout of the non-interleaved array.

template<typename T >
void cinder::audio::dsp::deinterleave ( const T *  interleavedSourceArray,
T *  nonInterleavedDestArray,
size_t  numFramesPerChannel,
size_t  numChannels,
size_t  numCopyFrames 
)

De-interleaves numCopyFrames of interleavedSourceArray, placing the result in nonInterleavedDestArray. numFramesPerChannel and numChannels describe the layout of the non-interleaved array.

template<typename FloatT >
void cinder::audio::dsp::deinterleave ( const int16_t *  interleavedInt16SourceArray,
FloatT *  nonInterleavedFloatDestArray,
size_t  numFramesPerChannel,
size_t  numChannels,
size_t  numCopyFrames 
)

De-interleaves numCopyFrames of interleavedInt16SourceArray and converts from 16-bit int to floating point precision at the same time, placing the result in nonInterleavedFloatDestArray. numFramesPerChannel and numChannels describe the layout of the non-interleaved array.

template<typename T >
void cinder::audio::dsp::interleaveBuffer ( const BufferT< T > *  nonInterleavedSource,
BufferInterleavedT< T > *  interleavedDest 
)

Interleaves nonInterleavedSource, placing the result in interleavedDest.

template<typename T >
void cinder::audio::dsp::deinterleaveBuffer ( const BufferInterleavedT< T > *  interleavedSource,
BufferT< T > *  nonInterleavedDest 
)

De-interleaves interleavedSource, placing the result in nonInterleavedDest.

template<typename T >
void cinder::audio::dsp::interleaveStereoBuffer ( const BufferT< T > *  nonInterleavedSource,
BufferInterleavedT< T > *  interleavedDest 
)

Interleaves nonInterleavedSource, placing the result in interleavedDest. This method is only slightly faster than interleaveBuffer(), which can handle an arbitrary number of channels.

template<typename T >
void cinder::audio::dsp::deinterleaveStereoBuffer ( const BufferInterleavedT< T > *  interleavedSource,
BufferT< T > *  nonInterleavedDest 
)

De-interleaves interleavedSource, placing the result in nonInterleavedDest. This method is only slightly faster than deinterleaveStereoBuffer(), which can handle an arbitrary number of channels.

void cinder::audio::dsp::generateBlackmanWindow ( float *  window,
size_t  length 
)

Fills length samples of window with a Blackmann windowing function.

void cinder::audio::dsp::generateHammingWindow ( float *  window,
size_t  length 
)

Fills length samples of window with a Hamming windowing function.

void cinder::audio::dsp::generateHannWindow ( float *  window,
size_t  length 
)

Fills length samples of window with a Hann windowing function.

void cinder::audio::dsp::generateWindow ( WindowType  windowType,
float *  window,
size_t  length 
)

fills window array with a windowing function specified by windowType

void cinder::audio::dsp::fill ( float  value,
float *  array,
size_t  length 
)

fills array with value value

void cinder::audio::dsp::add ( const float *  array,
float  scalar,
float *  result,
size_t  length 
)

add scalar to array of length length, into result.

void cinder::audio::dsp::add ( const float *  arrayA,
const float *  arrayB,
float *  result,
size_t  length 
)

add length elements of arrayA and arrayB (element-wise) into result.

void cinder::audio::dsp::sub ( const float *  array,
float  scalar,
float *  result,
size_t  length 
)

subtract scalar from array of length length, into result.

void cinder::audio::dsp::sub ( const float *  arrayA,
const float *  arrayB,
float *  result,
size_t  length 
)

subtract length elements of arrayB from arrayA (element-wise) into result.

void cinder::audio::dsp::mul ( const float *  array,
float  scalar,
float *  result,
size_t  length 
)

multiplies length elements of array by scalar and places the result at result.

void cinder::audio::dsp::mul ( const float *  arrayA,
const float *  arrayB,
float *  result,
size_t  length 
)

multiplies length elements of arrayA by arrayB and places the result at result.

void cinder::audio::dsp::divide ( const float *  array,
float  scalar,
float *  result,
size_t  length 
)

divides length elements of array by scalar and places the result at result.

void cinder::audio::dsp::divide ( const float *  arrayA,
const float *  arrayB,
float *  result,
size_t  length 
)

divides length elements of arrayA by arrayB and places the result at result.

void cinder::audio::dsp::addMul ( const float *  arrayA,
const float *  arrayB,
float  scalar,
float *  result,
size_t  length 
)

sums length elements of arrayA by arrayB (element-wise), then scales by scalar and places the result at result.

float cinder::audio::dsp::sum ( const float *  array,
size_t  length 
)

returns the sum of array

float cinder::audio::dsp::rms ( const float *  array,
size_t  length 
)

returns the Root-Mean-Squared value of array

void cinder::audio::dsp::normalize ( float *  array,
size_t  length,
float  maxValue = 1 
)

normalizes array to maxValue (default = 1)