Jamoma API  0.6.0.a19
TTAllpass1aCascade2.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspFilterLib
4  *
5  * @brief #TTAllpass1aCascade2 is a first-order filter cascade
6  *
7  * @details
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_ALLPASS1A_CASCADE2_H__
18 #define __TT_ALLPASS1A_CASCADE2_H__
19 
20 #include "TTDSP.h"
21 
22 
23 /** A first-order allpass filter cascade. */
26 
27 protected:
28 
29  TTFloat64 mAlpha0; ///< coefficient for filter 0
30  TTFloat64 mAlpha1; ///< coefficient for filter 1
31  TTSampleVector mX1; ///< previous input sample (n-1) for each channel of the cascade
32  TTSampleVector mD2; ///< previous output sample for each channel of the first stage, and previous input sample for each channel of the second stage
33  TTSampleVector mY1; ///< previous output sample (n-1) for each channel of the cascade
34 
35  // Notifications
36  TTErr updateMaxNumChannels(const TTValue& oldMaxNumChannels, TTValue&);
37 
38  // Zero filter history
39  TTErr clear();
40 
41  // Do the processing
42  TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs);
43 
44  /** Unit Tests
45  @param returnedTestInfo Used to return test information
46  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
47  */
48  virtual TTErr test(TTValue& returnedTestInfo);
49 
50 public:
51  TTErr calculateValue(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt channel=0);
52 };
53 
54 
55 #endif // __TT_ALLPASS1A_CASCADE2_H__
TTSampleVector mX1
previous input sample (n-1) for each channel of the cascade
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
TTSampleVector mY1
previous output sample (n-1) for each channel of the cascade
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 mAlpha1
coefficient for filter 1
virtual TTErr test(TTValue &returnedTestInfo)
Unit Tests.
TTSampleVector mD2
previous output sample for each channel of the first stage, and previous input sample for each channe...
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
TTFloat64 mAlpha0
coefficient for filter 0
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
A first-order allpass filter cascade.