Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Namespaces | Classes | Typedefs | Enumerations | Functions
cinder::audio::dsp Namespace Reference

Namespaces

 ooura
 

Classes

class  Biquad
 General filtering class (two-pole, two-zero). More...
 
class  Converter
 A platform-specific converter that supports samplerate and channel conversion. More...
 
class  ConverterImplR8brain
 Converter implementation using the r8brain samplerate conversion library by designed by Aleksey Vaneev. More...
 
class  Fft
 Real Discrete Fourier Transform (DFT). More...
 
class  RingBufferT
 Ringbuffer (aka circular buffer) data structure for use in concurrent audio scenarios. More...
 

Typedefs

typedef RingBufferT< float > RingBuffer
 

Enumerations

enum  WindowType { WindowType::BLACKMAN, WindowType::HAMMING, WindowType::HANN, WindowType::RECT }
 Describes the avaiable windowing functions. More...
 

Functions

void 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. More...
 
void 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). More...
 
void 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. More...
 
void 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). More...
 
template<typename SourceT , typename DestT >
void convert (const SourceT *sourceArray, DestT *destArray, size_t length)
 Converts between two arrays of different precision (ex. float to double). length samples are converted. More...
 
template<typename SourceT , typename DestT >
void 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. More...
 
template<typename FloatT >
void 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. More...
 
template<typename FloatT >
void 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. More...
 
template<typename T >
void 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. More...
 
template<typename FloatT >
void interleave (const FloatT *nonInterleavedFloatSourceArray, int16_t *interleavedInt16DestArray, size_t numFramesPerChannel, size_t numChannels, size_t numCopyFrames)
 Interleaves numCopyFrames of nonInterleavedSourceArray and converts from floating point to 16-bit int precision at the same time, placing the result in interleavedDestArray. numFramesPerChannel and numChannels describe the layout of the non-interleaved array. More...
 
template<typename T >
void 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. More...
 
template<typename FloatT >
void deinterleave (const int16_t *interleavedInt16SourceArray, FloatT *nonInterleavedFloatDestArray, size_t numFramesPerChannel, size_t numChannels, size_t numCopyFrames)
 De-interleaves numCopyFrames of interleavedSourceArray and converts from 16-bit int to floating point precision at the same time, placing the result in nonInterleavedDestArray. numFramesPerChannel and numChannels describe the layout of the non-interleaved array. More...
 
template<typename T >
void interleaveBuffer (const BufferT< T > *nonInterleavedSource, BufferInterleavedT< T > *interleavedDest)
 Interleaves nonInterleavedSource, placing the result in interleavedDest. More...
 
template<typename T >
void deinterleaveBuffer (const BufferInterleavedT< T > *interleavedSource, BufferT< T > *nonInterleavedDest)
 De-interleaves interleavedSource, placing the result in nonInterleavedDest. More...
 
template<typename T >
void 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. More...
 
template<typename T >
void 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. More...
 
void generateBlackmanWindow (float *window, size_t length)
 Fills length samples of window with a Blackmann windowing function. More...
 
void generateHammingWindow (float *window, size_t length)
 Fills length samples of window with a Hamming windowing function. More...
 
void generateHannWindow (float *window, size_t length)
 Fills length samples of window with a Hann windowing function. More...
 
void generateWindow (WindowType windowType, float *window, size_t length)
 fills window array with a windowing function specified by windowType More...
 
void fill (float value, float *array, size_t length)
 fills array with value value More...
 
void add (const float *array, float scalar, float *result, size_t length)
 add scalar to array of length length, into result. More...
 
void add (const float *arrayA, const float *arrayB, float *result, size_t length)
 add length elements of arrayA and arrayB (element-wise) into result. More...
 
void sub (const float *array, float scalar, float *result, size_t length)
 subtract scalar from array of length length, into result. More...
 
void sub (const float *arrayA, const float *arrayB, float *result, size_t length)
 subtract length elements of arrayB from arrayA (element-wise) into result. More...
 
void mul (const float *array, float scalar, float *result, size_t length)
 multiplies length elements of array by scalar and places the result at result. More...
 
void 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. More...
 
void divide (const float *array, float scalar, float *result, size_t length)
 divides length elements of array by scalar and places the result at result. More...
 
void 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. More...
 
void 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. More...
 
float sum (const float *array, size_t length)
 returns the sum of array More...
 
float rms (const float *array, size_t length)
 returns the Root-Mean-Squared value of array More...
 
void normalize (float *array, size_t length, float maxValue=1)
 normalizes array to maxValue (default = 1) More...
 

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 nonInterleavedSourceArray and converts from floating point to 16-bit int precision at the same time, placing the result in interleavedDestArray. 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 interleavedSourceArray and converts from 16-bit int to floating point precision at the same time, placing the result in nonInterleavedDestArray. 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)