Jamoma API  0.6.0.a19
TTNuttallWindow.cpp
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspWindowFunctionLib
4  *
5  * @brief Nuttall Window Function Unit for Jamoma DSP
6  *
7  * @details This implements a window function as described at
8  http://en.wikipedia.org/wiki/Window_function#Nuttall_window.2C_continuous_first_derivative @n
9  *
10  * @authors Nils Peters, Nathan Wolek, Tim Place, Trond Lossius
11  *
12  * @copyright Copyright © 2011 by Nils Peters @n
13  * This code is licensed under the terms of the "New BSD License" @n
14  * http://creativecommons.org/licenses/BSD/
15  */
16 
17 #include "TTNuttallWindow.h"
18 
19 
20 #define thisTTClass NuttallWindow
21 #define thisTTClassName "nuttall"
22 #define thisTTClassTags "dspWindowFunctionLib, audio, processor, function, window"
23 
24 
25 TT_AUDIO_CONSTRUCTOR
26 {
27  setProcessMethod(processAudio);
28  setCalculateMethod(calculateValue);
29 }
30 
31 
32 NuttallWindow::~NuttallWindow()
33 {
34  ;
35 }
36 
37 
39 {
40  y = 0.3635819 - 0.4891775*cos(kTTTwoPi*x) + 0.1365995*cos(2*kTTTwoPi*x) - 0.0106411*cos(3*kTTTwoPi*x);
41  return kTTErrNone;
42 }
43 
44 
46 {
47  TT_WRAP_CALCULATE_METHOD(calculateValue);
48 }
49 
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.
Nuttall Window Function Unit for Jamoma DSP.
double TTFloat64
64 bit floating point number
Definition: TTBase.h:188
TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
A standard audio processing method as used by TTBlue objects.
#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.
TTErr calculateValue(const TTFloat64 &x, TTFloat64 &y, TTPtrSizedInt data)
Calculate y = f(x) for a single value.
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