Jamoma API  0.6.0.a19
TTBlackmanHarrisWindow.cpp
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspWindowFunctionLib
4  *
5  * @brief Blackman-Harris Window Function Unit for Jamoma DSP
6  *
7  * @details The Blackman-Harris is a generalization of the Hamming family, produced by adding more shifted sinc functions, meant to minimize side-lobe levels. @n
8  *
9  * @authors Nils Peters, Trond Lossius, Tim Place, Nathan Wolek
10  *
11  * @copyright © 2011 by Nils Peters @n
12  * This code is licensed under the terms of the "New BSD License" @n
13  * http://creativecommons.org/licenses/BSD/
14  */
15 
16 #include "TTBlackmanHarrisWindow.h"
17 
18 
19 #define thisTTClass BlackmanHarrisWindow
20 #define thisTTClassName "blackmanHarris"
21 #define thisTTClassTags "dspWindowFunctionLib, audio, processor, function, window"
22 
23 
24 TT_AUDIO_CONSTRUCTOR
25 {
26  setProcessMethod(processAudio);
27  setCalculateMethod(calculateValue);
28 }
29 
30 
31 BlackmanHarrisWindow::~BlackmanHarrisWindow()
32 {
33  ;
34 }
35 
36 
38 {
39  y = 0.35875 - 0.48829*cos(kTTTwoPi*x) + 0.14128*cos(2*kTTTwoPi*x) - 0.01168*cos(3*kTTTwoPi*x);
40  return kTTErrNone;
41 }
42 
43 
45 {
46  TT_WRAP_CALCULATE_METHOD(calculateValue);
47 }
48 
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.
TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
A standard audio processing method as used by TTBlue objects.
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
TTErr calculateValue(const TTFloat64 &x, TTFloat64 &y, TTPtrSizedInt data)
Calculate y = f(x) for a single value.
Blackman-Harris Window Function Unit for Jamoma DSP.