Jamoma API  0.6.0.a19
TTGaussWindow.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspWindowFunctionLib
4  *
5  * @brief Gauss Window Function Unit for Jamoma DSP
6  *
7  * @details This implements the Gauss window function described here: @n
8  http://en.wikipedia.org/wiki/File:Window_function_(gauss).png @n
9  Be aware that when higher values are used for mSigma, minimum sample value will approach -17 dB @n
10  @n
11  Where 0. <= x <= 1. and 0. <= mSigma <= 0.5: @n
12  superscript = -0.5 * ( ( (2 * x) - 1 ) / mSigma )^2 @n
13  y = e^ superscript @n
14  *
15  * @authors Nathan Wolek, Tim Place, Trond Lossius
16  *
17  * @copyright Copyright © 2011 by Nathan Wolek @n
18  * This code is licensed under the terms of the "New BSD License" @n
19  * http://creativecommons.org/licenses/BSD/
20  */
21 
22 #ifndef __GAUSSWINDOW_H__
23 #define __GAUSSWINDOW_H__
24 
25 #include "TTDSP.h"
26 
27 
28 /** This implements the Gauss window function described here: @n
29  http://en.wikipedia.org/wiki/File:Window_function_(gauss).png @n
30  Be aware that when higher values are used for mSigma, minimum sample value will approach -17 dB @n
31  @n
32  Where 0. <= x <= 1. and 0. <= mSigma <= 0.5: @n
33  superscript = -0.5 * ( ( (2 * x) - 1 ) / mSigma )^2 @n
34  y = e^ superscript @n
35 */
36 
39 
40 protected:
41 
42  TTFloat64 mSigma; ///< sigma effects the width of the Gaussion window. 0. <= sigma <= 0.5
43 
44 
45  /** Calculate y = f(x) for a single value.
46  @param x The input value to the window function.
47  @param y The resulting value for the window function.
48  @param data Not used.
49  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
50  */
51  inline TTErr calculateValue(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt data);
52 
53 
54  /** A standard audio processing method as used by TTBlue objects.
55  @param inputs The input vector that is to be processed.
56  @param outputs The resulting windowed vector.
57  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
58  */
60 
61 
62  /** Unit test for the window function unit.
63  @param returnedTestInfo The outcome from the performed unit test.
64  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
65  */
66  TTErr test(TTValue& returnedTestInfo);
67 
68 };
69 
70 #endif // __GAUSSWINDOW_H__
TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
A standard audio processing method as used by TTBlue objects.
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
Jamoma DSP Library.
double TTFloat64
64 bit floating point number
Definition: TTBase.h:188
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
TTErr calculateValue(const TTFloat64 &x, TTFloat64 &y, TTPtrSizedInt data)
Calculate y = f(x) for a single value.
This implements the Gauss window function described here: http://en.wikipedia.org/wiki/File:Window_f...
Definition: TTGaussWindow.h:37
A simple container for an array of TTAudioSignal pointers.
TTErr test(TTValue &returnedTestInfo)
Unit test for the window function unit.
long TTPtrSizedInt
An integer that is the same size as a pointer.
Definition: TTBase.h:240
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
TTFloat64 mSigma
sigma effects the width of the Gaussion window. 0. <= sigma <= 0.5
Definition: TTGaussWindow.h:42
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34