Jamoma API  0.6.0.a19
TTHammingWindow.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspWindowFunctionLib
4  *
5  * @brief Hamming Window Function Unit for Jamoma DSP
6  *
7  * @details The Hamming window is optimized to minimize the maximum (nearest) side lobe, giving it a height of about one-fifth that of the Hanning window.@n
8  *
9  * Implementation is according to @
10  * http://local.wasp.uwa.edu.au/~pbourke/miscellaneous/windows/ @n
11  * hamming(x) = 0.54 + 0.46*cos(2*PI*(x-0.5))
12  *
13  * @authors Trond Lossius, Tim Place, Nathan Wolek
14  *
15  * @copyright Copyright © 2010 by Trond Lossius @n
16  * This code is licensed under the terms of the "New BSD License" @n
17  * http://creativecommons.org/licenses/BSD/
18  */
19 
20 
21 #ifndef __HAMMINGWINDOW_H__
22 #define __HAMMINGWINDOW_H__
23 
24 #include "TTDSP.h"
25 
26 
27 /** This implements a window function as described @
28  http://local.wasp.uwa.edu.au/~pbourke/miscellaneous/windows/
29  hamming(x) = 0.54 + 0.46*cos(2*PI*(x-0.5))
30  */
33 
34 protected:
35 
36  /** Calculate y = f(x) for a single value.
37  @param x The input value to the window function.
38  @param y The resulting value for the window function.
39  @param data Not used.
40  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
41  */
42  inline TTErr calculateValue(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt data);
43 
44 
45  /** A standard audio processing method as used by TTBlue objects.
46  @param inputs The input vector that is to be processed.
47  @param outputs The resulting windowed vector.
48  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
49  */
51 
52 
53  /** Unit test for the window function unit.
54  @param returnedTestInfo The outcome from the performed unit test.
55  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
56  */
57  virtual TTErr test(TTValue& returnedTestInfo);
58 };
59 
60 
61 #endif // __HAMMINGWINDOW_H__
TTErr calculateValue(const TTFloat64 &x, TTFloat64 &y, TTPtrSizedInt data)
Calculate y = f(x) for a single value.
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
virtual TTErr test(TTValue &returnedTestInfo)
Unit test for the window function unit.
A simple container for an array of TTAudioSignal pointers.
This implements a window function as described @ http://local.wasp.uwa.edu.au/~pbourke/miscellaneous/...
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
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34