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