Jamoma API  0.6.0.a19
WindowFunction Class Reference

Generalized Window Function Wrapper. More...

#include <TTWindowFunction.h>

+ Inheritance diagram for WindowFunction:
+ Collaboration diagram for WindowFunction:

Protected Member Functions

TTErr setFunction (const TTValue &function)
 Choose the window function. More...
 
TTErr setNumPoints (const TTValue &numPoints)
 Set the lookup table size. More...
 
TTErr doSetNumPoints (const TTUInt32 numPoints)
 Set the lookup table size. More...
 
TTErr setMode (const TTValue &mode)
 Set the process method. More...
 
TTErr setPadding (const TTValue &padding)
 Zero-padding applied to lookup table. More...
 
TTErr fill ()
 Internal method for filling the lookup table. More...
 
TTErr getFunctions (const TTValue &, TTValue &listOfWindowTypesToReturn)
 Return a list of all the available window functions. More...
 
TTErr setParameter (const TTValue &aParameterValueForTheFunction, TTValue &)
 Set an attribute of the internal window object (e.g. More...
 
TTErr calculateValue (const TTFloat64 &x, TTFloat64 &y, TTPtrSizedInt data)
 Calculate a single window function value y = f(x). More...
 
TTErr lookupValue (const TTFloat64 &x, TTFloat64 &y, TTPtrSizedInt data)
 Lookup a single function value y = f(x) from the stored table of window function values. More...
 
TTErr processGenerate (TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
 Generate a window function curve by means of calculations. More...
 
TTErr processLookup (TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
 Apply window function to the inputs signal using window function values from the stored lookup table. More...
 
TTErr processApply (TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
 Apply window function to the inputs signal using window function values that are calculated on the fly. More...
 

Protected Attributes

TTSymbol mFunction
 Name of the window function to use.
 
TTAudioObjectBasePtr mFunctionObject
 The actual window function object for mFunction.
 
TTUInt32 mNumPoints
 Number of Points in the lookup table.
 
TTSampleVector mLookupTable
 Cached table of size mNumPoints.
 
TTSymbol mMode
 Options: 'generate', 'lookup', 'apply'.
 
TTUInt32 mPadding
 for generating the lookup table - (e.g. padded welch window padded by 16 zeros on both sides)
 

Friends

class KaiserWindow
 

Detailed Description

Generalized Window Function Wrapper.

Definition at line 27 of file TTWindowFunction.h.

Member Function Documentation

TTErr WindowFunction::calculateValue ( const TTFloat64 x,
TTFloat64 y,
TTPtrSizedInt  data 
)
inlineprotected

Calculate a single window function value y = f(x).

Parameters
xThe input value that we want to calculate a window function value for.
yThe returned window function y value.
dataNot currently used.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 148 of file TTWindowFunction.cpp.

References TTAudioObjectBase::calculate(), and mFunctionObject.

Referenced by setMode().

+ Here is the call graph for this function:

TTErr WindowFunction::doSetNumPoints ( const TTUInt32  numPoints)
protected

Set the lookup table size.

The setNumPoints and doSetNumPoints methods perform the same action, and differs only in the type of the argument to the method.

Parameters
numPointsThe number of points to use.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.
See also
setNumPoints

Definition at line 102 of file TTWindowFunction.cpp.

References fill(), mLookupTable, and mNumPoints.

Referenced by processApply(), and setNumPoints().

+ Here is the call graph for this function:

TTErr WindowFunction::fill ( )
protected

Internal method for filling the lookup table.

Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 79 of file TTWindowFunction.cpp.

References TTAudioObjectBase::calculate(), kTTErrNone, mFunctionObject, mLookupTable, mNumPoints, and mPadding.

Referenced by doSetNumPoints(), setFunction(), setPadding(), and setParameter().

+ Here is the call graph for this function:

TTErr WindowFunction::getFunctions ( const TTValue ,
TTValue listOfWindowTypesToReturn 
)
protected

Return a list of all the available window functions.

Parameters
listOfWindowTypesToReturnPointer to an array that will be filled with a list of all available window functions.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 136 of file TTWindowFunction.cpp.

References TTObject::GetRegisteredClassNamesForTags(), and TT.

+ Here is the call graph for this function:

TTErr WindowFunction::lookupValue ( const TTFloat64 x,
TTFloat64 y,
TTPtrSizedInt  data 
)
inlineprotected

Lookup a single function value y = f(x) from the stored table of window function values.

Parameters
xThe input value that we want to calculate a window function value for.
yThe returned window function y value.
dataNot currently used.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 154 of file TTWindowFunction.cpp.

References kTTErrNone, mLookupTable, and mNumPoints.

Referenced by processLookup(), and setMode().

TTErr WindowFunction::processApply ( TTAudioSignalArrayPtr  inputs,
TTAudioSignalArrayPtr  outputs 
)
protected

Apply window function to the inputs signal using window function values that are calculated on the fly.

Parameters
inputsThe input signal to apply a window function on.
outputsThe resaulting windowed signal.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 173 of file TTWindowFunction.cpp.

References doSetNumPoints(), TTAudioSignal::getMinChannelCount(), kTTErrNone, mLookupTable, mNumPoints, and TTAudioSignal::mSampleVectors.

Referenced by setMode().

+ Here is the call graph for this function:

TTErr WindowFunction::processGenerate ( TTAudioSignalArrayPtr  inputs,
TTAudioSignalArrayPtr  outputs 
)
protected

Generate a window function curve by means of calculations.

Parameters
inputsThe input signal vector.
outputsThe resaulting window function.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 161 of file TTWindowFunction.cpp.

References mFunctionObject, and TTAudioObjectBase::process().

Referenced by setMode().

+ Here is the call graph for this function:

TTErr WindowFunction::processLookup ( TTAudioSignalArrayPtr  inputs,
TTAudioSignalArrayPtr  outputs 
)
protected

Apply window function to the inputs signal using window function values from the stored lookup table.

Parameters
inputsThe input signal to apply a window function on.
outputsThe resaulting windowed signal.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 167 of file TTWindowFunction.cpp.

References lookupValue().

Referenced by setMode().

+ Here is the call graph for this function:

TTErr WindowFunction::setFunction ( const TTValue function)
protected

Choose the window function.

Parameters
functionThe window function to use.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 47 of file TTWindowFunction.cpp.

References fill(), mFunction, mFunctionObject, TTAudioObjectBase::mMaxNumChannels, and TTObjectBaseInstantiate().

+ Here is the call graph for this function:

TTErr WindowFunction::setMode ( const TTValue mode)
protected

Set the process method.

The options are 'generate', 'lookup', 'apply'.

Parameters
modeThe processing mode to use. The options are 'generate', 'lookup', 'apply'.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 117 of file TTWindowFunction.cpp.

References calculateValue(), kTTErrNone, lookupValue(), mMode, processApply(), processGenerate(), processLookup(), setCalculateMethod, setProcessMethod, and TT.

+ Here is the call graph for this function:

TTErr WindowFunction::setNumPoints ( const TTValue numPoints)
protected

Set the lookup table size.

The setNumPoints and doSetNumPoints methods perform the same action, and differs only in the type of the argument to the method.

Parameters
numPointsThe number of points to use.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.
See also
doSetNumPoints

Definition at line 96 of file TTWindowFunction.cpp.

References doSetNumPoints().

+ Here is the call graph for this function:

TTErr WindowFunction::setPadding ( const TTValue padding)
protected

Zero-padding applied to lookup table.

Parameters
padding
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 110 of file TTWindowFunction.cpp.

References fill(), and mPadding.

+ Here is the call graph for this function:

TTErr WindowFunction::setParameter ( const TTValue aParameterValueForTheFunction,
TTValue  
)
protected

Set an attribute of the internal window object (e.g.

the 'beta' parameter to the Kaiser function).

Parameters
aParameterValueForTheFunctionSome functions have one or more parameters that can be set and that will alter the curve of the function. These parameters can be set using this method.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 59 of file TTWindowFunction.cpp.

References TTValue::copyFrom(), fill(), kTTErrWrongNumValues, mFunctionObject, TTObjectBase::setAttributeValue(), and TTValue::size().

+ Here is the call graph for this function:


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