Jamoma API  0.6.0.a19
TTRectangularWindow.h
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 #ifndef __RECTANGULARWINDOW_H__
30 #define __RECTANGULARWINDOW_H__
31 
32 #include "TTDSP.h"
33 
34 
35 /** This implements a window function which basically does nothing:
36  y = 1.0
37 
38  It is the same as the Matlab function:
39  w=rectwin(L)
40  Which is an alias for:
41  w = ones(L,1);
42  http://www.mathworks.com/help/toolbox/signal/ref/rectwin.html
43 
44  This can be expressed also as:
45  w(n) = 1, 0 <= n <= N-1
46 
47  Values outside of this range could be set to zero, though (at least in theory)
48  we should never receive a request for out-of-range values.
49  */
50 
53 
54 protected:
55 
56  /** Calculate y = f(x) for a single value.
57  @param x The input value to the window function.
58  @param y The resulting value for the window function.
59  @param data Not used.
60  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
61  */
62  inline TTErr calculateValue(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt data);
63 
64 
65  /** A standard audio processing method as used by TTBlue objects.
66  @param inputs The input vector that is to be processed.
67  @param outputs The resulting windowed vector.
68  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
69  */
71 
72 
73  /** Unit test for the window function unit.
74  @param returnedTestInfo The outcome from the performed unit test.
75  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
76  */
77  TTErr test(TTValue& returnedTestInfo);
78 
79 };
80 
81 
82 #endif // __RECTANGULARWINDOW_H__
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
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
This implements a window function which basically does nothing: y = 1.0.
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.
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 test(TTValue &returnedTestInfo)
Unit test for the window function unit.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34