Jamoma API  0.6.0.a19
TTAllpass4a.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspFilterLib
4  *
5  * @brief #TTAllpass4a is a fourth-order allpass filter.
6  *
7  * @details Essentially the same as #TTAllpass2a, but with some signs flipped.
8  * Based on Fredric J. Harris (2004): Multirate Signal Processing for Communication Systems, Prentice Hall, Chapter 10, Figure 42.
9  *
10  *
11  * @authors Timothy Place, Trond Lossius
12  *
13  * @copyright Copyright © 2010, Timothy Place @n
14  * This code is licensed under the terms of the "New BSD License" @n
15  * http://creativecommons.org/licenses/BSD/
16  */
17 
18 
19 #ifndef __TT_ALLPASS4A_H__
20 #define __TT_ALLPASS4A_H__
21 
22 #include "TTDSP.h"
23 
24 
25 /** A second-order building-block allpass filter.
26  Based on Multirate Signal Processing for Communication Systems, Chapter 10, Figure 42.
27  */
30 
31 protected:
32 
33  TTFloat64 mD1; ///< first coefficient
34  TTFloat64 mD2; ///< second coefficient
35  TTFloat64 mD3; ///< third coefficient
36  TTFloat64 mD4; ///< fourth coefficient
37 
38  TTSampleVector mX1; ///< previous input sample (n-1) for each channel
39  TTSampleVector mX2; ///< previous input sample (n-2) for each channel
40  TTSampleVector mX3; ///< previous input sample (n-3) for each channel
41  TTSampleVector mX4; ///< previous input sample (n-4) for each channel
42  TTSampleVector mY1; ///< previous output sample (n-1) for each channel
43  TTSampleVector mY2; ///< previous output sample (n-2) for each channel
44  TTSampleVector mY3; ///< previous output sample (n-3) for each channel
45  TTSampleVector mY4; ///< previous output sample (n-4) for each channel
46 
47  // Notifications
48  TTErr updateMaxNumChannels(const TTValue& oldMaxNumChannels, TTValue&);
49 
50  // Zero filter history
51  TTErr clear();
52 
53  // Do the processing
54  TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs);
55 
56  /** Unit Tests
57  @param returnedTestInfo Used to return test information
58  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
59  */
60  virtual TTErr test(TTValue& returnedTestInfo);
61 
62 public:
63  TTErr calculateValue(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt channel=0);
64 };
65 
66 
67 #endif // __TT_ALLPASS4A_H__
TTSampleVector mY4
previous output sample (n-4) for each channel
Definition: TTAllpass4a.h:45
TTSampleVector mY1
previous output sample (n-1) for each channel
Definition: TTAllpass4a.h:42
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
TTSampleVector mY3
previous output sample (n-3) for each channel
Definition: TTAllpass4a.h:44
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
TTFloat64 mD4
fourth coefficient
Definition: TTAllpass4a.h:36
TTSampleVector mX3
previous input sample (n-3) for each channel
Definition: TTAllpass4a.h:40
std::vector< TTSampleValue > TTSampleVector
A TTSampleVector is simply a pointer to the first of an array of TTSampleValues.
Definition: TTBase.h:233
TTFloat64 mD1
first coefficient
Definition: TTAllpass4a.h:33
A second-order building-block allpass filter.
Definition: TTAllpass4a.h:28
TTFloat64 mD2
second coefficient
Definition: TTAllpass4a.h:34
TTSampleVector mY2
previous output sample (n-2) for each channel
Definition: TTAllpass4a.h:43
TTSampleVector mX4
previous input sample (n-4) for each channel
Definition: TTAllpass4a.h:41
A simple container for an array of TTAudioSignal pointers.
TTSampleVector mX2
previous input sample (n-2) for each channel
Definition: TTAllpass4a.h:39
virtual TTErr test(TTValue &returnedTestInfo)
Unit Tests.
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
TTSampleVector mX1
previous input sample (n-1) for each channel
Definition: TTAllpass4a.h:38
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
TTFloat64 mD3
third coefficient
Definition: TTAllpass4a.h:35