Ardour  9.0-pre0-386-g96ef4d20f2
PhaseVocoder Class Reference

#include <PhaseVocoder.h>

Public Member Functions

 PhaseVocoder (int size, int hop)
 
virtual ~PhaseVocoder ()
 
void processTimeDomain (const double *src, double *mag, double *phase, double *unwrapped)
 
void processFrequencyDomain (const double *reals, const double *imags, double *mag, double *phase, double *unwrapped)
 
void reset ()
 

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
 
FFTRealm_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::PhaseVocoder ( int  size,
int  hop 
)

◆ ~PhaseVocoder()

virtual PhaseVocoder::~PhaseVocoder ( )
virtual

Member Function Documentation

◆ FFTShift()

void PhaseVocoder::FFTShift ( double *  src)
protected

◆ getMagnitudes()

void PhaseVocoder::getMagnitudes ( double *  mag)
protected

◆ getPhases()

void PhaseVocoder::getPhases ( double *  theta)
protected

◆ processFrequencyDomain()

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.

◆ processTimeDomain()

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.

◆ reset()

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.

◆ unwrapPhases()

void PhaseVocoder::unwrapPhases ( double *  theta,
double *  unwrapped 
)
protected

Member Data Documentation

◆ m_fft

FFTReal* PhaseVocoder::m_fft
protected

Definition at line 72 of file PhaseVocoder.h.

◆ m_hop

int PhaseVocoder::m_hop
protected

Definition at line 71 of file PhaseVocoder.h.

◆ m_imag

double* PhaseVocoder::m_imag
protected

Definition at line 74 of file PhaseVocoder.h.

◆ m_n

int PhaseVocoder::m_n
protected

Definition at line 70 of file PhaseVocoder.h.

◆ m_phase

double* PhaseVocoder::m_phase
protected

Definition at line 76 of file PhaseVocoder.h.

◆ m_real

double* PhaseVocoder::m_real
protected

Definition at line 75 of file PhaseVocoder.h.

◆ m_time

double* PhaseVocoder::m_time
protected

Definition at line 73 of file PhaseVocoder.h.

◆ m_unwrapped

double* PhaseVocoder::m_unwrapped
protected

Definition at line 77 of file PhaseVocoder.h.


The documentation for this class was generated from the following file: