Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Public Member Functions | List of all members
Convolver Class Reference

#include <Convolver.h>

Public Member Functions

int setup (const std::string &filename, unsigned int blockSize, unsigned int maxLength=0)
 
int setup (const std::vector< std::vector< float >> &irs, unsigned int blockSize)
 
void process (float *out, const float *in, unsigned int frames, unsigned int channel=0)
 
void processInterleaved (float *out, const float *in, unsigned int frames, unsigned int outChannels, unsigned int inChannels)
 
void cleanup ()
 
unsigned int getChannels ()
 

Detailed Description

Convolve a monophonic input signal with one or more impulse responses.

Examples:
terminal-only/filter-FIR/render.cpp.

Member Function Documentation

int Convolver::setup ( const std::string &  filename,
unsigned int  blockSize,
unsigned int  maxLength = 0 
)

Use this to load an impulse response from an audio file. Every channel in the audio file corresponds to a convolution channel.

Parameters
pathto the audio file to use as an impulse response
blockSizethe maximum number of frames passed to process...()
maxLengththe max length of the impulse response. If filename contains more than maxLength frames, it will be truncated.
Examples:
terminal-only/filter-FIR/render.cpp.
int Convolver::setup ( const std::vector< std::vector< float >> &  irs,
unsigned int  blockSize 
)

Use this to set up a multi-channel impulse response from memory.

Parameters
irsa vector of vectors, each of which correponds to the impulse response for one channel. The length of irs is the maximum number of input channels to be passed to process...().
blockSizethe maximum number of frames passed to process...()
void Convolver::process ( float *  out,
const float *  in,
unsigned int  frames,
unsigned int  channel = 0 
)

Process a block of samples through the specified convolution channel.

Parameters
outpointer to the output buffer.
inpointer to the input buffer.
framesthe number of frames to process.
channelwhich convolution channel to use.
Examples:
terminal-only/filter-FIR/render.cpp.
void Convolver::processInterleaved ( float *  out,
const float *  in,
unsigned int  frames,
unsigned int  outChannels,
unsigned int  inChannels 
)

Process a block of interleaved samples. Each input channel is processed through the convolver channels, and the output of each convolution is written into the respective channel of out.

Parameters
outpointer to the output buffer.
inpointer to the input buffer.
framesthe number of frames to process.
outChannelsthe number of channels in out.
inChannelsthe number of input channels in in.
unsigned int Convolver::getChannels ( )
inline

Return the number of channels in the convolver.


The documentation for this class was generated from the following files: