The PhaseVocoder provides a basic phase vocoder that is initialized to N = 4096 and 75% overlap; the de-facto standard for PSM algorithms. The analysis and sythesis hop sizes are identical.
More...
#include <fxobjects.h>
|
void | initialize (unsigned int _frameLength, unsigned int _hopSize, windowType _window) |
| initialize the Fast FFT object for operation More...
|
|
void | destroyFFTW () |
| destroys the FFTW arrays and plans. More...
|
|
double | processAudioSample (double input, bool &fftReady) |
| process one input sample throug the vocoder to produce one output sample More...
|
|
bool | addZeroPad (unsigned int count) |
| zero pad the input timeline More...
|
|
bool | advanceAndCheckFFT () |
| advance the sample counter and check to see if we need to do the FFT. More...
|
|
fftw_complex * | getFFTData () |
|
fftw_complex * | getIFFTData () |
|
void | doInverseFFT () |
| perform the inverse FFT on the processed data More...
|
|
void | doOverlapAdd (double *outputData=nullptr, int length=0) |
| perform the overlap/add on the IFFT data More...
|
|
unsigned int | getFrameLength () |
|
unsigned int | getHopSize () |
|
double | getOverlap () |
|
void | setOverlapAddOnly (bool b) |
|
void | initialize (unsigned int _frameLength, unsigned int _hopSize, windowType _window) |
|
void | destroyFFTW () |
|
double | processAudioSample (double input, bool &fftReady) |
|
bool | addZeroPad (unsigned int count) |
|
bool | advanceAndCheckFFT () |
|
fftw_complex * | getFFTData () |
|
fftw_complex * | getIFFTData () |
|
void | doInverseFFT () |
|
void | doOverlapAdd (double *outputData=nullptr, int length=0) |
|
unsigned int | getFrameLength () |
|
unsigned int | getHopSize () |
|
double | getOverlap () |
|
void | setOverlapAddOnly (bool b) |
|
void | initialize (unsigned int _frameLength, unsigned int _hopSize, windowType _window) |
|
void | destroyFFTW () |
|
double | processAudioSample (double input, bool &fftReady) |
|
bool | addZeroPad (unsigned int count) |
|
bool | advanceAndCheckFFT () |
|
fftw_complex * | getFFTData () |
|
fftw_complex * | getIFFTData () |
|
void | doInverseFFT () |
|
void | doOverlapAdd (double *outputData=nullptr, int length=0) |
|
unsigned int | getFrameLength () |
|
unsigned int | getHopSize () |
|
double | getOverlap () |
|
void | setOverlapAddOnly (bool b) |
|
void | initialize (unsigned int _frameLength, unsigned int _hopSize, windowType _window) |
|
void | destroyFFTW () |
|
double | processAudioSample (double input, bool &fftReady) |
|
bool | addZeroPad (unsigned int count) |
|
bool | advanceAndCheckFFT () |
|
fftw_complex * | getFFTData () |
|
fftw_complex * | getIFFTData () |
|
void | doInverseFFT () |
|
void | doOverlapAdd (double *outputData=nullptr, int length=0) |
|
unsigned int | getFrameLength () |
|
unsigned int | getHopSize () |
|
double | getOverlap () |
|
void | setOverlapAddOnly (bool b) |
|
The PhaseVocoder provides a basic phase vocoder that is initialized to N = 4096 and 75% overlap; the de-facto standard for PSM algorithms. The analysis and sythesis hop sizes are identical.
Audio I/O:
- processes mono input into mono output.
Control I/F:
- Author
- Will Pirkle http://www.willpirkle.com
- Version
- Revision : 1.0
- Date
- Date : 2018 / 09 / 7
◆ addZeroPad() [1/4]
bool PhaseVocoder::addZeroPad |
( |
unsigned int |
count | ) |
|
zero pad the input timeline
add zero-padding without advancing output read location, for fast convolution
- Parameters
-
count | the number of zero-valued samples to insert |
- Returns
- true if the zero-insertion triggered a FFT event, false otherwise
◆ addZeroPad() [2/4]
bool PhaseVocoder::addZeroPad |
( |
unsigned int |
count | ) |
|
add zero-padding without advancing output read location, for fast convolution
◆ addZeroPad() [3/4]
bool PhaseVocoder::addZeroPad |
( |
unsigned int |
count | ) |
|
add zero-padding without advancing output read location, for fast convolution
◆ addZeroPad() [4/4]
bool PhaseVocoder::addZeroPad |
( |
unsigned int |
count | ) |
|
add zero-padding without advancing output read location, for fast convolution
◆ advanceAndCheckFFT() [1/4]
bool PhaseVocoder::advanceAndCheckFFT |
( |
| ) |
|
advance the sample counter and check to see if we need to do the FFT.
increment the FFT counter and do the FFT if it is ready
- Returns
- true if the advancement triggered a FFT event, false otherwise
◆ advanceAndCheckFFT() [2/4]
bool PhaseVocoder::advanceAndCheckFFT |
( |
| ) |
|
increment the FFT counter and do the FFT if it is ready
◆ advanceAndCheckFFT() [3/4]
bool PhaseVocoder::advanceAndCheckFFT |
( |
| ) |
|
increment the FFT counter and do the FFT if it is ready
◆ advanceAndCheckFFT() [4/4]
bool PhaseVocoder::advanceAndCheckFFT |
( |
| ) |
|
increment the FFT counter and do the FFT if it is ready
◆ destroyFFTW() [1/4]
void PhaseVocoder::destroyFFTW |
( |
| ) |
|
destroys the FFTW arrays and plans.
destroy FFTW objects and plans
◆ destroyFFTW() [2/4]
void PhaseVocoder::destroyFFTW |
( |
| ) |
|
destroy FFTW objects and plans
◆ destroyFFTW() [3/4]
void PhaseVocoder::destroyFFTW |
( |
| ) |
|
destroy FFTW objects and plans
◆ destroyFFTW() [4/4]
void PhaseVocoder::destroyFFTW |
( |
| ) |
|
destroy FFTW objects and plans
◆ doInverseFFT() [1/4]
void PhaseVocoder::doInverseFFT |
( |
| ) |
|
perform the inverse FFT on the processed data
do the inverse FFT (optional; will be called automatically if not used)
- NOTES:
This function is optional - if you need to sequence the output (synthesis) stage yourself
then you can call this function at the appropriate time - see the PSMVocoder object for an example
◆ doInverseFFT() [2/4]
void PhaseVocoder::doInverseFFT |
( |
| ) |
|
do the inverse FFT (optional; will be called automatically if not used)
◆ doInverseFFT() [3/4]
void PhaseVocoder::doInverseFFT |
( |
| ) |
|
do the inverse FFT (optional; will be called automatically if not used)
◆ doInverseFFT() [4/4]
void PhaseVocoder::doInverseFFT |
( |
| ) |
|
do the inverse FFT (optional; will be called automatically if not used)
◆ doOverlapAdd() [1/4]
void PhaseVocoder::doOverlapAdd |
( |
double * |
outputData = nullptr , |
|
|
int |
length = 0 |
|
) |
| |
do the overlap-add operation
◆ doOverlapAdd() [2/4]
void PhaseVocoder::doOverlapAdd |
( |
double * |
outputData = nullptr , |
|
|
int |
length = 0 |
|
) |
| |
perform the overlap/add on the IFFT data
do the overlap-add operation
- NOTES:
This function is optional - if you need to sequence the output (synthesis) stage yourself
then you can call this function at the appropriate time - see the PSMVocoder object for an example
- Parameters
-
outputData | an array of data to overlap/add: if this is NULL then the IFFT data is used |
length | the lenght of the array of data to overlap/add: if this is -1, the normal IFFT length is used |
◆ doOverlapAdd() [3/4]
void PhaseVocoder::doOverlapAdd |
( |
double * |
outputData = nullptr , |
|
|
int |
length = 0 |
|
) |
| |
do the overlap-add operation
◆ doOverlapAdd() [4/4]
void PhaseVocoder::doOverlapAdd |
( |
double * |
outputData = nullptr , |
|
|
int |
length = 0 |
|
) |
| |
do the overlap-add operation
◆ getFFTData() [1/4]
fftw_complex* PhaseVocoder::getFFTData |
( |
| ) |
|
|
inline |
get FFT data for manipulation (yes, naked pointer so you can manipulate)
◆ getFFTData() [2/4]
fftw_complex* PhaseVocoder::getFFTData |
( |
| ) |
|
|
inline |
get FFT data for manipulation (yes, naked pointer so you can manipulate)
◆ getFFTData() [3/4]
fftw_complex* PhaseVocoder::getFFTData |
( |
| ) |
|
|
inline |
get FFT data for manipulation (yes, naked pointer so you can manipulate)
◆ getFFTData() [4/4]
fftw_complex* PhaseVocoder::getFFTData |
( |
| ) |
|
|
inline |
get FFT data for manipulation (yes, naked pointer so you can manipulate)
◆ getFrameLength() [1/4]
unsigned int PhaseVocoder::getFrameLength |
( |
| ) |
|
|
inline |
◆ getFrameLength() [2/4]
unsigned int PhaseVocoder::getFrameLength |
( |
| ) |
|
|
inline |
◆ getFrameLength() [3/4]
unsigned int PhaseVocoder::getFrameLength |
( |
| ) |
|
|
inline |
◆ getFrameLength() [4/4]
unsigned int PhaseVocoder::getFrameLength |
( |
| ) |
|
|
inline |
◆ getHopSize() [1/4]
unsigned int PhaseVocoder::getHopSize |
( |
| ) |
|
|
inline |
get current hop size ha = hs
◆ getHopSize() [2/4]
unsigned int PhaseVocoder::getHopSize |
( |
| ) |
|
|
inline |
get current hop size ha = hs
◆ getHopSize() [3/4]
unsigned int PhaseVocoder::getHopSize |
( |
| ) |
|
|
inline |
get current hop size ha = hs
◆ getHopSize() [4/4]
unsigned int PhaseVocoder::getHopSize |
( |
| ) |
|
|
inline |
get current hop size ha = hs
◆ getIFFTData() [1/4]
fftw_complex* PhaseVocoder::getIFFTData |
( |
| ) |
|
|
inline |
get IFFT data for manipulation (yes, naked pointer so you can manipulate)
◆ getIFFTData() [2/4]
fftw_complex* PhaseVocoder::getIFFTData |
( |
| ) |
|
|
inline |
get IFFT data for manipulation (yes, naked pointer so you can manipulate)
◆ getIFFTData() [3/4]
fftw_complex* PhaseVocoder::getIFFTData |
( |
| ) |
|
|
inline |
get IFFT data for manipulation (yes, naked pointer so you can manipulate)
◆ getIFFTData() [4/4]
fftw_complex* PhaseVocoder::getIFFTData |
( |
| ) |
|
|
inline |
get IFFT data for manipulation (yes, naked pointer so you can manipulate)
◆ getOverlap() [1/4]
double PhaseVocoder::getOverlap |
( |
| ) |
|
|
inline |
get current overlap as a raw value (75% = 0.75)
◆ getOverlap() [2/4]
double PhaseVocoder::getOverlap |
( |
| ) |
|
|
inline |
get current overlap as a raw value (75% = 0.75)
◆ getOverlap() [3/4]
double PhaseVocoder::getOverlap |
( |
| ) |
|
|
inline |
get current overlap as a raw value (75% = 0.75)
◆ getOverlap() [4/4]
double PhaseVocoder::getOverlap |
( |
| ) |
|
|
inline |
get current overlap as a raw value (75% = 0.75)
◆ initialize() [1/4]
void PhaseVocoder::initialize |
( |
unsigned int |
_frameLength, |
|
|
unsigned int |
_hopSize, |
|
|
windowType |
_window |
|
) |
| |
setup the FFT for a given framelength and window type
◆ initialize() [2/4]
void PhaseVocoder::initialize |
( |
unsigned int |
_frameLength, |
|
|
unsigned int |
_hopSize, |
|
|
windowType |
_window |
|
) |
| |
initialize the Fast FFT object for operation
setup the FFT for a given framelength and window type
- NOTES:
See notes on symmetrical window arrays in comments.
- Parameters
-
_frameLength | the FFT length - MUST be a power of 2 |
_hopSize | the hop size in samples: this object only supports ha = hs (pure real-time operation only) |
_window | the window type (note: may be set to windowType::kNoWindow) |
◆ initialize() [3/4]
void PhaseVocoder::initialize |
( |
unsigned int |
_frameLength, |
|
|
unsigned int |
_hopSize, |
|
|
windowType |
_window |
|
) |
| |
setup the FFT for a given framelength and window type
◆ initialize() [4/4]
void PhaseVocoder::initialize |
( |
unsigned int |
_frameLength, |
|
|
unsigned int |
_hopSize, |
|
|
windowType |
_window |
|
) |
| |
setup the FFT for a given framelength and window type
◆ processAudioSample() [1/4]
double PhaseVocoder::processAudioSample |
( |
double |
input, |
|
|
bool & |
fftReady |
|
) |
| |
process audio sample through vocode; check fftReady flag to access FFT output
◆ processAudioSample() [2/4]
double PhaseVocoder::processAudioSample |
( |
double |
input, |
|
|
bool & |
fftReady |
|
) |
| |
process audio sample through vocode; check fftReady flag to access FFT output
◆ processAudioSample() [3/4]
double PhaseVocoder::processAudioSample |
( |
double |
input, |
|
|
bool & |
fftReady |
|
) |
| |
process audio sample through vocode; check fftReady flag to access FFT output
◆ processAudioSample() [4/4]
double PhaseVocoder::processAudioSample |
( |
double |
input, |
|
|
bool & |
fftReady |
|
) |
| |
process one input sample throug the vocoder to produce one output sample
process audio sample through vocode; check fftReady flag to access FFT output
- Parameters
-
input | the input sample x(n) |
fftReady | a return flag indicating if the FFT has occurred and FFT data is ready to process |
- Returns
- the vocoder output sample y(n)
◆ setOverlapAddOnly() [1/4]
void PhaseVocoder::setOverlapAddOnly |
( |
bool |
b | ) |
|
|
inline |
set the vocoder for overlap add only without hop-size
◆ setOverlapAddOnly() [2/4]
void PhaseVocoder::setOverlapAddOnly |
( |
bool |
b | ) |
|
|
inline |
set the vocoder for overlap add only without hop-size
◆ setOverlapAddOnly() [3/4]
void PhaseVocoder::setOverlapAddOnly |
( |
bool |
b | ) |
|
|
inline |
set the vocoder for overlap add only without hop-size
◆ setOverlapAddOnly() [4/4]
void PhaseVocoder::setOverlapAddOnly |
( |
bool |
b | ) |
|
|
inline |
set the vocoder for overlap add only without hop-size
The documentation for this class was generated from the following files:
- C:/RackAFX_v7/ASPIK_SDK/samples/demo_custom_views/With FFTW/DemoCustomViews/project_source/source/PluginObjects/fxobjects.h
- C:/RackAFX_v7/ASPIK_SDK/samples/demo_custom_views/With FFTW/DemoCustomViews/project_source/source/PluginObjects/fxobjects.cpp