Jamoma API  0.6.0.a19
TTHilbert9.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspFilterLib
4  *
5  * @brief #TTHilbert9 is a 9th-order Hilbert Transform filter built up from a 2-path allpass structure
6  *
7  * @details A 9th-order Hilber Transform filter built-up from allpass building blocks. Based on Multirate Signal Processing for Communication Systems, Chapter 10 and "The Digital All-Pass Filter: A Versatile Signal Processing Building Block" by REGALIA, MITRA, and P.VAIDYANATHAN, 1988. @n
8  * @n
9  * This filter is so-named because we base this filter on TTHalfband9 filter, which we transform to produce the phase quadrature by flipping coefficient signs and decoupling the output of the two paths. @n
10  * @n
11  * This particular Hilbert filter may be a bit too crude for many applications, as the distortion to the phase quadrature (perfect 90º) begins to distort somewhat rapidly as the frequencies at the input get further and further away from f_s/2. Because of this, a higher-order filter would be a better match for most applications. For example, TTHilbert17 will offer more accurate results, albeit at a higher computational cost. @n
12  * @n
13  * An additional caveat regards phase linearity with regard to the input signal. While the output phases of the real and imaginary signals from this filter are 90º to each other, the phase response of both in relation to the input signal is non-linear. To acheive a linear-phase version, a linear halfband filter needs to serve as the base from which to transform. E.g. TTHalfbandLinear33 could be modified to become TTHilbertLinear33. @n
14  * @n
15  * Current implementation does not perform resampling. As with the halfband filters, we could make a version of this object that has downsampling and upsampling (e.g. for inverse hilber transforms) built-in. @n
16  * @n
17  * At the moment, however, we do not have any applications in Jamoma which require the use of hilbert-transformed signals to be processed at a lower rate.
18  *
19  * @authors Timothy Place, Trond Lossius
20  *
21  * @copyright Copyright © 2010, Timothy Place @n
22  * This code is licensed under the terms of the "New BSD License" @n
23  * http://creativecommons.org/licenses/BSD/
24  */
25 
26 
27 #ifndef __TT_HILBERT9_H__
28 #define __TT_HILBERT9_H__
29 
30 #include "TTDSP.h"
31 #include "TTAllpass1a.h"
32 #include "TTAllpass1b.h"
33 
34 
35 /** A 9th-order Hilber Transform filter built-up from allpass building blocks.
36  Based on Multirate Signal Processing for Communication Systems, Chapter 10
37  and "The Digital All-Pass Filter: A Versatile Signal Processing Building Block"
38  by REGALIA, MITRA, and P.VAIDYANATHAN, 1988.
39 
40  This filter is so-named because we base this filter on TTHalfband9 filter,
41  which we transform to produce the phase quadrature by flipping coefficient signs and
42  decoupling the output of the two paths.
43 
44  This particular Hilbert filter may be a bit too crude for many applications, as the
45  distortion to the phase quadrature (perfect 90º) begins to distort somewhat rapidly
46  as the frequencies at the input get further and further away from f_s/2.
47  Because of this, a higher-order filter would be a better match for most applications.
48  For example, TTHilbert17 will offer more accurate results, albeit at a higher
49  computational cost.
50 
51  An additional caveat regards phase linearity with regard to the input signal.
52  While the output phases of the real and imaginary signals from this filter are
53  90º to each other, the phase response of both in relation to the input signal is non-linear.
54  To acheive a linear-phase version, a linear halfband filter needs to serve as the base
55  from which to transform.
56  E.g. TTHalfbandLinear33 could be modified to become TTHilbertLinear33.
57 
58  Current implementation does not perform resampling.
59  As with the halfband filters, we could make a version of this object that has
60  downsampling and upsampling (e.g. for inverse hilber transforms) built-in.
61 
62  At the moment, however, we do not have any applications in Jamoma which require the use
63  of hilbert-transformed signals to be processed at a lower rate.
64  */
67 
68 protected:
69 
70  TTAudioObject mF0; ///< path0
71  TTAudioObject mF2; ///< path0
72 
73  TTAudioObject mF1; ///< path1
74  TTAudioObject mF3; ///< path1
75  TTAudioObject mDelay; ///< path1
76 
77  // Notifications
78  TTErr updateMaxNumChannels(const TTValue& oldMaxNumChannels, TTValue&);
79 
80  // Zero filter history
81  TTErr clear();
82 
83  TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs);
84 
85 
86  /** Unit Tests
87  @param returnedTestInfo Used to return test information
88  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
89  */
90  virtual TTErr test(TTValue& returnedTestInfo);
91 };
92 
93 
94 #endif // __TT_HILBERT9_H__
TTAudioObject mF1
path1
Definition: TTHilbert9.h:73
A 9th-order Hilber Transform filter built-up from allpass building blocks.
Definition: TTHilbert9.h:65
virtual TTErr test(TTValue &returnedTestInfo)
Unit Tests.
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
TTAudioObject mF0
path0
Definition: TTHilbert9.h:70
Wrap audio objects for convenience.
Jamoma DSP Library.
TTAudioObject mDelay
path1
Definition: TTHilbert9.h:75
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
TTAudioObject mF2
path0
Definition: TTHilbert9.h:71
A simple container for an array of TTAudioSignal pointers.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
TTAudioObject mF3
path1
Definition: TTHilbert9.h:74
TTAllpass1a is a first-order building-block allpass filter.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
TTAllpass1b is a first-order building-block allpass filter.