gtkIOStream  1.6.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WSOLA Class Reference

#include <WSOLA.H>

Inheritance diagram for WSOLA:
[legend]
Collaboration diagram for WSOLA:
[legend]

Public Member Functions

 WSOLA ()
 
 WSOLA (int chCnt)
 
virtual ~WSOLA ()
 Destructor. More...
 
template<typename Derived >
int process (FP_TYPE timeScale, const DenseBase< Derived > &input)
 
void processInner (void)
 
int getMaxInputSamplesRequired (void)
 
int getSamplesRequired (void)
 
int getOutputSize (void)
 
void reset (int chCnt)
 
int noMoreAudio ()
 

Public Attributes

Array< FP_TYPE, Dynamic, Dynamic > output
 The output vector, each row is a channel. More...
 
Array< FP_TYPE, Dynamic, Dynamic > input
 The input vector, each row is a channel. More...
 

Private Member Functions

template<typename Derived >
int findSimilarityInBuffer (const DenseBase< Derived > &buffer)
 
template<typename Derived >
FP_TYPE findSimilarity (const ArrayBase< Derived > &outputIn)
 
template<typename Derived >
FP_TYPE rms (const ArrayBase< Derived > &s)
 
void OLAWnd (void)
 Generate the overlap add window based on the window size N. More...
 
void init (void)
 

Private Attributes

int N
 The size of the window. More...
 
int NO2
 Half the window size. More...
 
int M
 The number of windows in the search buffer. More...
 
int m
 The current row index into the buffer. More...
 
double rem
 The remainder fraction of a sample to remember for next time (can't move on by fractions of a sample). More...
 
Array< FP_TYPE, Dynamic, Dynamic > buffer
 The buffer of audio, each channel on its own row. More...
 
Array< FP_TYPE, Dynamic, Dynamic > wnd
 The overlap add window. More...
 
Array< FP_TYPE, Dynamic, Dynamic > nextOutput
 The output vector to search for, each channel per row. More...
 
Array< FP_TYPE, Dynamic, Dynamic > simComp
 Temporary vector used for computation. More...
 
int inputSamplesRequired
 The number of audio samples required for the next call to process. More...
 

Detailed Description

Class which implements the Waveform Similarity Overlap Add (Embedded WSOLA).

This class allows you to time scale modify multi-channel audio. It speeds up or slows down audio without changing its pitch.

This Class uses Eigen to compute all vector operations in the aim of ensuring efficient hardware utilisation and speed.

Definition at line 72 of file WSOLA.H.

Constructor & Destructor Documentation

WSOLA::WSOLA ( )

Constructor, initialises the window size and buffer. Uses a default channel count.

Definition at line 21 of file WSOLA.C.

Here is the call graph for this function:

WSOLA::WSOLA ( int  chCnt)

Constructor, initialises the window size and buffer. int chCnt The number of channels to use.

Definition at line 26 of file WSOLA.C.

Here is the call graph for this function:

WSOLA::~WSOLA ( )
virtual

Destructor.

Definition at line 31 of file WSOLA.C.

Member Function Documentation

template<typename Derived >
FP_TYPE WSOLA::findSimilarity ( const ArrayBase< Derived > &  outputIn)
inlineprivate

Method to find the similarity between an output vector and the nextOutput.

Parameters
outputInThe vector to compare against the reference
Template Parameters
DerivedThe CRTP class operated on.

Definition at line 100 of file WSOLA.H.

Here is the caller graph for this function:

template<typename Derived >
int WSOLA::findSimilarityInBuffer ( const DenseBase< Derived > &  buffer)
private

Find the most similar vector in a buffer of vectors to the input reference.

Parameters
bufferThe matrix of vectors to compare against the reference
Template Parameters
DerivedThe CRTP class operated on.

Definition at line 55 of file WSOLA.C.

Here is the call graph for this function:

Here is the caller graph for this function:

int WSOLA::getMaxInputSamplesRequired ( void  )
inline

Find out what the largest possible request of input samples

Definition at line 189 of file WSOLA.H.

Here is the caller graph for this function:

int WSOLA::getOutputSize ( void  )
inline

Get the number of samples returned for each process.

Definition at line 202 of file WSOLA.H.

Here is the caller graph for this function:

int WSOLA::getSamplesRequired ( void  )
inline

Get the number of input samples WSOLA requires as input to process.

Returns
The number of required samples

Definition at line 196 of file WSOLA.H.

Here is the caller graph for this function:

void WSOLA::init ( void  )
private

Initialise the system.

Definition at line 34 of file WSOLA.C.

Here is the caller graph for this function:

int WSOLA::noMoreAudio ( )
inline

Indicate that there is no more input audio to process, begin rolling out the last of the buffer.

Returns
<= 0 to stop, any other number to continue.

Definition at line 215 of file WSOLA.H.

Here is the caller graph for this function:

void WSOLA::OLAWnd ( void  )
private

Generate the overlap add window based on the window size N.

Definition at line 42 of file WSOLA.C.

Here is the caller graph for this function:

template<typename Derived >
int WSOLA::process ( FP_TYPE  timeScale,
const DenseBase< Derived > &  input 
)
inline

Process the input vector and indicate how many samples are required to reload the input vector.

Parameters
timeScaleThe scaling factor for the time
inputThe input to load into the buffer for future use.
Returns
the number of samples required
Template Parameters
DerivedThe CRTP class operated on.

Definition at line 151 of file WSOLA.H.

Here is the call graph for this function:

Here is the caller graph for this function:

void WSOLA::processInner ( void  )

The inner process. Find the most similar block to the desired and overlap add.

Definition at line 100 of file WSOLA.C.

Here is the call graph for this function:

void WSOLA::reset ( int  chCnt)

Reset the system to start fresh.

Parameters
chCntThe number of channels to use.

Definition at line 133 of file WSOLA.C.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename Derived >
FP_TYPE WSOLA::rms ( const ArrayBase< Derived > &  s)
inlineprivate

Method to return the RMS power of the input vector/matrix

Parameters
sThe matrix or vector to find the 2 Norn of
Returns
The RMS (2 Norm) of s
Template Parameters
DerivedThe CRTP class operated on.

Definition at line 112 of file WSOLA.H.

Member Data Documentation

Array<FP_TYPE, Dynamic , Dynamic> WSOLA::buffer
private

The buffer of audio, each channel on its own row.

Definition at line 80 of file WSOLA.H.

Array<FP_TYPE, Dynamic, Dynamic> WSOLA::input

The input vector, each row is a channel.

Definition at line 130 of file WSOLA.H.

int WSOLA::inputSamplesRequired
private

The number of audio samples required for the next call to process.

Definition at line 122 of file WSOLA.H.

int WSOLA::M
private

The number of windows in the search buffer.

Definition at line 76 of file WSOLA.H.

int WSOLA::m
private

The current row index into the buffer.

Definition at line 77 of file WSOLA.H.

int WSOLA::N
private

The size of the window.

Definition at line 74 of file WSOLA.H.

Array<FP_TYPE, Dynamic, Dynamic> WSOLA::nextOutput
private

The output vector to search for, each channel per row.

Definition at line 84 of file WSOLA.H.

int WSOLA::NO2
private

Half the window size.

Definition at line 75 of file WSOLA.H.

Array<FP_TYPE, Dynamic, Dynamic> WSOLA::output

The output vector, each row is a channel.

Definition at line 129 of file WSOLA.H.

double WSOLA::rem
private

The remainder fraction of a sample to remember for next time (can't move on by fractions of a sample).

Definition at line 78 of file WSOLA.H.

Array<FP_TYPE, Dynamic, Dynamic> WSOLA::simComp
private

Temporary vector used for computation.

Definition at line 86 of file WSOLA.H.

Array<FP_TYPE, Dynamic, Dynamic> WSOLA::wnd
private

The overlap add window.

Definition at line 82 of file WSOLA.H.


The documentation for this class was generated from the following files:
gtkIOStream: WSOLA Class Reference
GTK+ IOStream  Beta
GTK+ << C++ IOStream operators for GTK+. Now with extra abilities ... like ORBing, numerical computation, audio clients and more...