Jamoma API  0.6.0.a19
TTMirror5.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspFilterLib
4  *
5  * @brief #TTMirror5 is a 5th-order lowpass/highpass filter built up from a 2-path allpass structure
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_MIRROR5_H__
18 #define __TT_MIRROR5_H__
19 
20 #include "TTDSP.h"
21 #include "TTAllpass1a.h"
22 #include "TTAllpass2a.h"
23 
24 
25 /** A 5th-order lowpass/highpass filter with arbitrary Fc built-up from allpass building blocks.
26  Based on Multirate Signal Processing for Communication Systems, Chapter 10, Page 31.
27  */
30 
31 protected:
32 
33  TTAudioObject mF0; ///< filter0 (in the upper path)
34  TTAudioObject mF1; ///< filter1 (in the lower path, first block)
35  TTAudioObject mF2; ///< filter2 (in the lower path, second block)
36  TTFloat64 mFrequency; ///< attribute: in hertz
37  TTSymbol mMode; ///< attribute: lowpass or highpass
38 
39  // Notifications
40  TTErr updateMaxNumChannels(const TTValue& oldMaxNumChannels, TTValue&);
41 
42  // Zero filter history
43  TTErr clear();
44 
45  // attribute accessor
46  TTErr setMode(const TTValue& newValue);
47  TTErr setFrequency(const TTValue& newValue);
48 
49  inline void filterKernel(const TTFloat64& input, TTFloat64& outputPath0, TTFloat64& outputPath1, TTPtrSizedInt channel);
50 
51  // Do the processing
52  TTErr processLowpass(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs);
53  TTErr processHighpass(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs);
54 
55  /** Unit Tests
56  @param returnedTestInfo Used to return test information
57  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
58  */
59  virtual TTErr test(TTValue& returnedTestInfo);
60 
61 public:
62  TTErr calculateLowpass(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt channel=0);
63  TTErr calculateHighpass(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt channel=0);
64 };
65 
66 
67 #endif // __TT_MIRROR5_H__
TTAllpass1b is a second-order allpass filter.
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
Wrap audio objects for convenience.
virtual TTErr test(TTValue &returnedTestInfo)
Unit Tests.
Jamoma DSP Library.
double TTFloat64
64 bit floating point number
Definition: TTBase.h:188
TTAudioObject mF2
filter2 (in the lower path, second block)
Definition: TTMirror5.h:35
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
TTAudioObject mF0
filter0 (in the upper path)
Definition: TTMirror5.h:33
TTAudioObject mF1
filter1 (in the lower path, first block)
Definition: TTMirror5.h:34
TTFloat64 mFrequency
attribute: in hertz
Definition: TTMirror5.h:36
A simple container for an array of TTAudioSignal pointers.
A 5th-order lowpass/highpass filter with arbitrary Fc built-up from allpass building blocks...
Definition: TTMirror5.h:28
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
TTAllpass1a is a first-order building-block allpass filter.
TTSymbol mMode
attribute: lowpass or highpass
Definition: TTMirror5.h:37
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34