Jamoma API  0.6.0.a19
TTBlackmanWindow.cpp
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspWindowFunctionLib
4  *
5  * @brief Blackman Window Function Unit for Jamoma DSP
6  *
7  * @details Implemented according to: @n
8  * http://en.wikipedia.org/wiki/File:Window_function_(blackman).png @n
9  * w = 0.42 - 0.5*cos(2*pi*k/(N-1)) + 0.08*cos(4*pi*k/(N-1));
10  *
11  * @authors Tim Place, Nathan Wolek, Trond Lossius
12  *
13  * @copyright © 2010 by Timothy Place @n
14  * This code is licensed under the terms of the "New BSD License" @n
15  * http://creativecommons.org/licenses/BSD/
16  */
17 
18 #include "TTBlackmanWindow.h"
19 
20 
21 #define thisTTClass BlackmanWindow
22 #define thisTTClassName "blackman"
23 #define thisTTClassTags "dspWindowFunctionLib, audio, processor, function, window"
24 
25 
26 TT_AUDIO_CONSTRUCTOR
27 {
28  setProcessMethod(processAudio);
29  setCalculateMethod(calculateValue);
30 }
31 
32 
33 BlackmanWindow::~BlackmanWindow()
34 {
35  ;
36 }
37 
38 
39 TTErr BlackmanWindow::calculateValue(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt data)
40 {
41  y = 0.42 - 0.5 * cos(kTTTwoPi * x) + 0.08 * cos(4.0 * kTTPi * x);
42  return kTTErrNone;
43 }
44 
45 
46 TTErr BlackmanWindow::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
47 {
48  TT_WRAP_CALCULATE_METHOD(calculateValue);
49 }
50 
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
Blackman Window Function Unit for Jamoma DSP.
#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
TTFOUNDATION_EXPORT const TTFloat64 kTTPi
[doxygenAppendixC_constExample]
Definition: TTBase.cpp:23