GClasses

GClasses::GFourierWaveProcessor Class Reference

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. More...

#include <GWave.h>

List of all members.

Public Member Functions

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

Protected Member Functions

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.
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).
void decodeBlock (GWaveIterator &it, unsigned short chan)
 Convert an array of complex numbers (in temporal space) to the specified channel of a wave file.
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.

Protected Attributes

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

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.


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::doit ( GWave signal)

Transforms signal.

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) [protected, pure virtual]

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


Member Data Documentation