Jamoma API  0.6.0.a19
TTKaiserWindow.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspWindowFunctionLib
4  *
5  * @brief Kaiser Window Function Unit for Jamoma DSP
6  *
7  * @details This implements a window function as described @n
8  https://ccrma.stanford.edu/~jos/sasp/Kaiser_Window.html @n
9  http://en.wikipedia.org/wiki/Window_function#Kaiser_windows
10  *
11  * @authors Nils Peters, Trond Lossius, Tim Place, Nathan Wolek
12  *
13  * @copyright 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 
19 #ifndef __KAISERWINDOW_H__
20 #define __KAISERWINDOW_H__
21 
22 #include "TTDSP.h"
23 
24 
25 /** This implements a window function as described @
26  https://ccrma.stanford.edu/~jos/sasp/Kaiser_Window.html @n
27  http://en.wikipedia.org/wiki/Window_function#Kaiser_windows
28  */
31 
32 protected:
33 
34  /**
35  alpha and beta atributes are linked to allow congruence with both references above.
36  setting one updates the other so that the following relationship is always true:
37  beta = alpha * pi
38  */
39  TTFloat64 mAlpha; ///< attribute: alpha parameter for the Kaiser function
40  TTFloat64 mBeta; ///< attribute: beta parameter for the Kaiser function
41  TTFloat64 mBesselIOofBeta; ///< calculated from the beta attribute
42 
43 
44  /** internal use: calculate zeroth-order bessel function of the first kind */
46 
47 
48  /** Set the alpha attribute of the Kaiser window function.
49  @param newValue The new value to apply.
50  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
51  */
52  TTErr setAlpha(const TTValue& newValue);
53 
54 
55  /** Set the beta attribute of the Kaiser window function.
56  @param newValue The new value to apply.
57  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
58  */
59  TTErr setBeta(const TTValue& newValue);
60 
61 
62  /** Calculate y = f(x) for a single value.
63  @param x The input value to the window function.
64  @param y The resulting value for the window function.
65  @param data Not used.
66  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
67  */
68  inline TTErr calculateValue(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt data);
69 
70 
71  /** A standard audio processing method as used by TTBlue objects.
72  @param inputs The input vector that is to be processed.
73  @param outputs The resulting windowed vector.
74  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
75  */
77 
78 
79  /** Unit test for the window function unit.
80  @param returnedTestInfo The outcome from the performed unit test.
81  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
82  */
83  virtual TTErr test(TTValue& returnedTestInfo);
84 
85 };
86 
87 
88 #endif // __KAISERWINDOW_H__
This implements a window function as described @ https://ccrma.stanford.edu/~jos/sasp/Kaiser_Window.html http://en.wikipedia.org/wiki/Window_function#Kaiser_windows.
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
TTFloat64 mAlpha
alpha and beta atributes are linked to allow congruence with both references above.
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
TTErr setBeta(const TTValue &newValue)
Set the beta attribute of the Kaiser window function.
TTFloat64 BesselFunctionI0(TTFloat64 x)
internal use: calculate zeroth-order bessel function of the first kind
TTFloat64 mBeta
attribute: beta parameter for the Kaiser function
virtual TTErr test(TTValue &returnedTestInfo)
Unit test for the window function unit.
TTFloat64 mBesselIOofBeta
calculated from the beta attribute
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
TTErr setAlpha(const TTValue &newValue)
Set the alpha attribute of the Kaiser window function.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
A standard audio processing method as used by TTBlue objects.