Jamoma API  0.6.0.a19
TTRectangularWindow.cpp
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspWindowFunctionLib
4  *
5  * @brief Rectangular Window Function Unit for Jamomoma DSP
6  *
7  * @details This implements a window function which basically does nothing:
8  y = 1.0 @n
9  * @n
10  * It is the same as the Matlab function: @n
11  * w=rectwin(L) @n
12  * Which is an alias for: @n
13  * w = ones(L,1); @n
14  * http://www.mathworks.com/help/toolbox/signal/ref/rectwin.html @n
15  * @n
16  * This can be expressed also as: @n
17  * w(n) = 1, 0 <= n <= N-1 @n
18  * @n
19  * Values outside of this range could be set to zero, though (at least in theory)
20  * we should never receive a request for out-of-range values. @n
21  *
22  * @authors Trond Lossius, Tim Place, Nathan Wolek, Nils Peters
23  *
24  * @copyright Copyright © 2009 by Trond Lossius @n
25  * This code is licensed under the terms of the "New BSD License" @n
26  * http://creativecommons.org/licenses/BSD/
27  */
28 
29 #include "TTRectangularWindow.h"
30 
31 #define thisTTClass RectangularWindow
32 #define thisTTClassName "rectangular"
33 #define thisTTClassTags "dspWindowFunctionLib, audio, processor, function, window"
34 
35 
36 TT_AUDIO_CONSTRUCTOR
37 {
38  setProcessMethod(processAudio);
39  setCalculateMethod(calculateValue);
40 }
41 
42 
43 RectangularWindow::~RectangularWindow()
44 {
45  ;
46 }
47 
48 
50 {
51  y = 1.0;
52  return kTTErrNone;
53 }
54 
55 
57 {
58  TT_WRAP_CALCULATE_METHOD(calculateValue);
59 }
60 
#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 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.
A simple container for an array of TTAudioSignal pointers.
Rectangular Window Function Unit for Jamomoma DSP.
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