qm-dsp
1.8
|
#include <PhaseVocoder.h>
Public Member Functions | |
PhaseVocoder (int size, int hop) | |
virtual | ~PhaseVocoder () |
void | processTimeDomain (const double *src, double *mag, double *phase, double *unwrapped) |
Given one frame of time-domain samples, FFT and return the magnitudes, instantaneous phases, and unwrapped phases. More... | |
void | processFrequencyDomain (const double *reals, const double *imags, double *mag, double *phase, double *unwrapped) |
Given one frame of frequency-domain samples, return the magnitudes, instantaneous phases, and unwrapped phases. More... | |
void | reset () |
Reset the stored phases to zero. More... | |
Protected Member Functions | |
void | FFTShift (double *src) |
void | getMagnitudes (double *mag) |
void | getPhases (double *theta) |
void | unwrapPhases (double *theta, double *unwrapped) |
Protected Attributes | |
int | m_n |
int | m_hop |
FFTReal * | m_fft |
double * | m_time |
double * | m_imag |
double * | m_real |
double * | m_phase |
double * | m_unwrapped |
Detailed Description
Definition at line 21 of file PhaseVocoder.h.
Constructor & Destructor Documentation
PhaseVocoder::PhaseVocoder | ( | int | size, |
int | hop | ||
) |
Definition at line 27 of file PhaseVocoder.cpp.
References m_fft, m_imag, m_n, m_phase, m_real, m_time, m_unwrapped, and reset().
|
virtual |
Definition at line 46 of file PhaseVocoder.cpp.
References m_fft, m_imag, m_phase, m_real, m_time, and m_unwrapped.
Member Function Documentation
void PhaseVocoder::processTimeDomain | ( | const double * | src, |
double * | mag, | ||
double * | phase, | ||
double * | unwrapped | ||
) |
Given one frame of time-domain samples, FFT and return the magnitudes, instantaneous phases, and unwrapped phases.
src must have size values (where size is the frame size value as passed to the PhaseVocoder constructor), and should have been windowed as necessary by the caller (but not fft-shifted).
mag, phase, and unwrapped must each be non-NULL and point to enough space for size/2 + 1 values. The redundant conjugate half of the output is not returned.
Definition at line 66 of file PhaseVocoder.cpp.
References FFTShift(), FFTReal::forward(), getMagnitudes(), getPhases(), m_fft, m_imag, m_n, m_real, m_time, and unwrapPhases().
Referenced by DetectionFunction::processTimeDomain().
void PhaseVocoder::processFrequencyDomain | ( | const double * | reals, |
const double * | imags, | ||
double * | mag, | ||
double * | phase, | ||
double * | unwrapped | ||
) |
Given one frame of frequency-domain samples, return the magnitudes, instantaneous phases, and unwrapped phases.
reals and imags must each contain size/2+1 values (where size is the frame size value as passed to the PhaseVocoder constructor).
mag, phase, and unwrapped must each be non-NULL and point to enough space for size/2+1 values.
Definition at line 80 of file PhaseVocoder.cpp.
References getMagnitudes(), getPhases(), m_imag, m_n, m_real, and unwrapPhases().
Referenced by DetectionFunction::processFrequencyDomain().
void PhaseVocoder::reset | ( | ) |
Reset the stored phases to zero.
Note that this may be necessary occasionally (depending on the application) to avoid loss of floating-point precision in the accumulated unwrapped phase values as they grow.
Definition at line 94 of file PhaseVocoder.cpp.
References m_hop, m_n, m_phase, and m_unwrapped.
Referenced by PhaseVocoder().
|
protected |
|
protected |
Definition at line 107 of file PhaseVocoder.cpp.
References m_imag, m_n, and m_real.
Referenced by processFrequencyDomain(), and processTimeDomain().
|
protected |
Definition at line 114 of file PhaseVocoder.cpp.
References m_imag, m_n, and m_real.
Referenced by processFrequencyDomain(), and processTimeDomain().
|
protected |
Definition at line 121 of file PhaseVocoder.cpp.
References m_hop, m_n, m_phase, m_unwrapped, and MathUtilities::princarg().
Referenced by processFrequencyDomain(), and processTimeDomain().
Member Data Documentation
|
protected |
Definition at line 70 of file PhaseVocoder.h.
Referenced by FFTShift(), getMagnitudes(), getPhases(), PhaseVocoder(), processFrequencyDomain(), processTimeDomain(), reset(), and unwrapPhases().
|
protected |
Definition at line 71 of file PhaseVocoder.h.
Referenced by reset(), and unwrapPhases().
|
protected |
Definition at line 72 of file PhaseVocoder.h.
Referenced by PhaseVocoder(), processTimeDomain(), and ~PhaseVocoder().
|
protected |
Definition at line 73 of file PhaseVocoder.h.
Referenced by PhaseVocoder(), processTimeDomain(), and ~PhaseVocoder().
|
protected |
Definition at line 74 of file PhaseVocoder.h.
Referenced by getMagnitudes(), getPhases(), PhaseVocoder(), processFrequencyDomain(), processTimeDomain(), and ~PhaseVocoder().
|
protected |
Definition at line 75 of file PhaseVocoder.h.
Referenced by getMagnitudes(), getPhases(), PhaseVocoder(), processFrequencyDomain(), processTimeDomain(), and ~PhaseVocoder().
|
protected |
Definition at line 76 of file PhaseVocoder.h.
Referenced by PhaseVocoder(), reset(), unwrapPhases(), and ~PhaseVocoder().
|
protected |
Definition at line 77 of file PhaseVocoder.h.
Referenced by PhaseVocoder(), reset(), unwrapPhases(), and ~PhaseVocoder().
The documentation for this class was generated from the following files:
Generated by 1.8.11