Jamoma API  0.6.0.a19
TTAllpass2a.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspFilterLib
4  *
5  * @brief #TTAllpass1b is a second-order allpass filter.
6  *
7  * @details Based on Fredric J. Harris (2004): Multirate Signal Processing for Communication Systems, Prentice Hall, Chapter 10, Figure 35.
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_ALLPASS2A_H__
18 #define __TT_ALLPASS2A_H__
19 
20 #include "TTDSP.h"
21 
22 
23 /** A second-order building-block allpass filter.
24  Based on Multirate Signal Processing for Communication Systems, Chapter 10, Figure 35.
25  */
28 
29 protected:
30 
31  TTFloat64 mC1; ///< first coefficient
32  TTFloat64 mC2; ///< second coefficient
33 
34  TTSampleVector mX1; ///< previous input sample (n-1) for each channel
35  TTSampleVector mX2; ///< previous input sample (n-2) for each channel
36  TTSampleVector mY1; ///< previous output sample (n-1) for each channel
37  TTSampleVector mY2; ///< previous output sample (n-2) for each channel
38 
39  // Notifications
40  TTErr updateMaxNumChannels(const TTValue& oldMaxNumChannels, TTValue&);
41 
42  // Zero filter history
43  TTErr clear();
44 
45  // Do the processing
46  TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs);
47 
48  /** Unit Tests
49  @param returnedTestInfo Used to return test information
50  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
51  */
52  virtual TTErr test(TTValue& returnedTestInfo);
53 
54 public:
55  TTErr calculateValue(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt channel=0);
56 };
57 
58 
59 #endif // __TT_ALLPASS2A_H__
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
TTSampleVector mX1
previous input sample (n-1) for each channel
Definition: TTAllpass2a.h:34
TTFloat64 mC1
first coefficient
Definition: TTAllpass2a.h:31
TTFloat64 mC2
second coefficient
Definition: TTAllpass2a.h:32
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
A second-order building-block allpass filter.
Definition: TTAllpass2a.h:26
TTSampleVector mX2
previous input sample (n-2) for each channel
Definition: TTAllpass2a.h:35
A simple container for an array of TTAudioSignal pointers.
TTSampleVector mY2
previous output sample (n-2) for each channel
Definition: TTAllpass2a.h:37
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
virtual TTErr test(TTValue &returnedTestInfo)
Unit Tests.
TTSampleVector mY1
previous output sample (n-1) for each channel
Definition: TTAllpass2a.h:36
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34