Jamoma API  0.6.0.a19
TTAllpass1b.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspFilterLib
4  *
5  * @brief #TTAllpass1b is a first-order building-block allpass filter.
6  *
7  * @details This allpass filter uses a fixed delay of 2 samples (M=2).
8  *
9  * @authors Timothy Place, Trond Lossius
10  *
11  * @copyright Copyright © 2010, Timothy Place @n
12  * This code is licensed under the terms of the "New BSD License" @n
13  * http://creativecommons.org/licenses/BSD/
14  */
15 
16 
17 #ifndef __TT_ALLPASS1B_H__
18 #define __TT_ALLPASS1B_H__
19 
20 #include "TTDSP.h"
21 
22 
23 /** A first-order building-block allpass filter.
24  This allpass filter uses a fixed delay of 2 samples (M=2). */
27 
28 protected:
29 
30  TTFloat64 mAlpha; ///< single coefficient for the first-order allpass
31  TTSampleVector mX1; ///< previous input sample (n-1) for each channel
32  TTSampleVector mX2; ///< previous input sample (n-2) for each channel
33  TTSampleVector mY1; ///< previous output sample (n-1) for each channel
34  TTSampleVector mY2; ///< previous output sample (n-2) for each channel
35 
36  // Notifications
37  TTErr updateMaxNumChannels(const TTValue& oldMaxNumChannels, TTValue&);
38 
39  // Zero filter history
40  TTErr clear();
41 
42  // Do the processing
43  TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs);
44 
45  /** Unit Tests
46  @param returnedTestInfo Used to return test information
47  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
48  */
49  virtual TTErr test(TTValue& returnedTestInfo);
50 
51 public:
52  TTErr calculateValue(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt channel=0);
53 };
54 
55 
56 #endif // __TT_ALLPASS1B_H__
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
virtual TTErr test(TTValue &returnedTestInfo)
Unit Tests.
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
std::vector< TTSampleValue > TTSampleVector
A TTSampleVector is simply a pointer to the first of an array of TTSampleValues.
Definition: TTBase.h:233
TTFloat64 mAlpha
single coefficient for the first-order allpass
Definition: TTAllpass1b.h:30
TTSampleVector mX1
previous input sample (n-1) for each channel
Definition: TTAllpass1b.h:31
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
A first-order building-block allpass filter.
Definition: TTAllpass1b.h:25
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
TTSampleVector mY2
previous output sample (n-2) for each channel
Definition: TTAllpass1b.h:34
TTSampleVector mY1
previous output sample (n-1) for each channel
Definition: TTAllpass1b.h:33
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
TTSampleVector mX2
previous input sample (n-2) for each channel
Definition: TTAllpass1b.h:32