Jamoma API  0.6.0.a19
TTHammingWindow.cpp
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 © 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 #include "TTHammingWindow.h"
21 
22 
23 #define thisTTClass HammingWindow
24 #define thisTTClassName "hamming"
25 #define thisTTClassTags "dspWindowFunctionLib, audio, processor, function, window"
26 
27 
28 TT_AUDIO_CONSTRUCTOR
29 {
30  setProcessMethod(processAudio);
31  setCalculateMethod(calculateValue);
32 }
33 
34 
35 HammingWindow::~HammingWindow()
36 {
37  ;
38 }
39 
40 
42 {
43  y = 0.54 + 0.46*cos(kTTTwoPi*(x-0.5));
44  return kTTErrNone;
45 }
46 
47 
49 {
50  TT_WRAP_CALCULATE_METHOD(calculateValue);
51 }
52 
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.
TTFOUNDATION_EXPORT const TTFloat64 kTTTwoPi
Pre-calculated value of pi * 2.
Definition: TTBase.cpp:24
#define setProcessMethod(methodName)
A convenience macro to be used by subclasses for setting the process method.
double TTFloat64
64 bit floating point number
Definition: TTBase.h:188
#define setCalculateMethod(methodName)
A convenience macro to be used by subclasses for setting the calculate method.
A simple container for an array of TTAudioSignal pointers.
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
No Error.
Definition: TTBase.h:343
Hamming Window Function Unit for Jamoma DSP.