GClasses
GClasses::GFourierWaveProcessor Class Referenceabstract

Detailed Description

This is an abstract class that processes a wave file in blocks. Specifically, it divides the wave file up into overlapping blocks, converts them into Fourier space, calls the abstract "process" method with each block, converts back from Fourier space, and then interpolates to create the wave output.

#include <GWave.h>

Public Member Functions

 GFourierWaveProcessor (size_t blockSize)
 blockSize must be a power of 2. More...
 
virtual ~GFourierWaveProcessor ()
 
void reduce (GWave &signal)
 Transforms signal. More...
 

Protected Member Functions

void decodeBlock (GWaveIterator &it, unsigned short chan)
 Convert an array of complex numbers (in temporal space) to the specified channel of a wave file. More...
 
void encodeBlock (GWaveIterator &it, struct ComplexNumber *pBuf, unsigned short chan)
 Convert the specified channel from an iterator to an array of complex numbers (in temporal space). More...
 
void interpolate (struct ComplexNumber *pPre, struct ComplexNumber *pCur, struct ComplexNumber *pPost, size_t graftSamples)
 Given 3 overlapping blocks (in temporal space), interpolate to create a final block of values. More...
 
virtual void process (struct ComplexNumber *pBuf)=0
 pBuf represents a block of m_blockSize complex numbers in Fourier space. This method should transform the block in some way. More...
 

Protected Attributes

size_t m_blockSize
 
struct ComplexNumberm_pBufA
 
struct ComplexNumberm_pBufB
 
struct ComplexNumberm_pBufC
 
struct ComplexNumberm_pBufD
 
struct ComplexNumberm_pBufE
 
struct ComplexNumberm_pBufFinal
 

Constructor & Destructor Documentation

GClasses::GFourierWaveProcessor::GFourierWaveProcessor ( size_t  blockSize)

blockSize must be a power of 2.

virtual GClasses::GFourierWaveProcessor::~GFourierWaveProcessor ( )
virtual

Member Function Documentation

void GClasses::GFourierWaveProcessor::decodeBlock ( GWaveIterator it,
unsigned short  chan 
)
protected

Convert an array of complex numbers (in temporal space) to the specified channel of a wave file.

void GClasses::GFourierWaveProcessor::encodeBlock ( GWaveIterator it,
struct ComplexNumber pBuf,
unsigned short  chan 
)
protected

Convert the specified channel from an iterator to an array of complex numbers (in temporal space).

void GClasses::GFourierWaveProcessor::interpolate ( struct ComplexNumber pPre,
struct ComplexNumber pCur,
struct ComplexNumber pPost,
size_t  graftSamples 
)
protected

Given 3 overlapping blocks (in temporal space), interpolate to create a final block of values.

virtual void GClasses::GFourierWaveProcessor::process ( struct ComplexNumber pBuf)
protectedpure virtual

pBuf represents a block of m_blockSize complex numbers in Fourier space. This method should transform the block in some way.

void GClasses::GFourierWaveProcessor::reduce ( GWave signal)

Transforms signal.

Member Data Documentation

size_t GClasses::GFourierWaveProcessor::m_blockSize
protected
struct ComplexNumber* GClasses::GFourierWaveProcessor::m_pBufA
protected
struct ComplexNumber* GClasses::GFourierWaveProcessor::m_pBufB
protected
struct ComplexNumber* GClasses::GFourierWaveProcessor::m_pBufC
protected
struct ComplexNumber* GClasses::GFourierWaveProcessor::m_pBufD
protected
struct ComplexNumber* GClasses::GFourierWaveProcessor::m_pBufE
protected
struct ComplexNumber* GClasses::GFourierWaveProcessor::m_pBufFinal
protected