GClasses
|
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>
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 ComplexNumber * | m_pBufA |
struct ComplexNumber * | m_pBufB |
struct ComplexNumber * | m_pBufC |
struct ComplexNumber * | m_pBufD |
struct ComplexNumber * | m_pBufE |
struct ComplexNumber * | m_pBufFinal |
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.
GClasses::GFourierWaveProcessor::GFourierWaveProcessor | ( | size_t | blockSize | ) |
blockSize must be a power of 2.
virtual GClasses::GFourierWaveProcessor::~GFourierWaveProcessor | ( | ) | [virtual] |
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.
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] |