Jamoma API  0.6.0.a19
TTFFT.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspFftLib
4  *
5  * @brief ##TTfft - Fast Fourier Transforms
6  *
7  * @details If a channel is simultaneously muted and soloed, soloing takes presedence.
8  *
9  * @authors Tim Place, Trond Lossius
10  *
11  * @copyright Copyright © 2010, Tim 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_FFT_H__
18 #define __TT_FFT_H__
19 
20 #include "TTDSP.h"
21 
22 
23 /** TTOperator performs basic mathematical operations on an input signal, or a pair of input signals */
26 
27 protected:
28 
29  static const int kTTFFTPerformFFT;
30  static const int kTTFFTPerformIFFT;
31 
32  TTSampleVector mBuffer; // the samples we pass to the fft routine for processing
33  std::vector<int> mWorkArea; // work area for bit reversal
34  std::vector<double> mCosSinTable; // cos/sin table
35  TTUInt16 mVectorSize; // cached vector size
36  TTFloat64 mRVectorSize; // reciprocal of vector size
37  TTBoolean mInverse; // true = IFFT, false = FFT
38  TTInt16 mInverseValue; // -1 means IFFT, +1 means FFT
39  TTSymbol mMode; // 'real' or 'complex'
40  TTSymbol mAlgorithm; // 'ooura' or 'mayer'
41 
42  /** Attribute accessor. */
43  TTErr setInverse(const TTValue& newValue);
44 
45  /** Attribute accessor. */
46  TTErr setMode(const TTValue& newValue);
47 
48  /** Attribute accessor. */
49  TTErr setAlgorithm(const TTValue& newValue);
50 
51  // Internal -- used by attr accessors
52  TTErr updateProcessPointers();
53 
54 
55  /** FFT Audio Process Routine.
56  Some important notes:
57  * The vector size of the inputs determines the frame size of the FFT.
58  * The input currently assumes that we treat each channel as the input for a Real FFT (not complex).
59  * The output is currently adapts the output to twice the number of channels as is present at the input.
60  */
62  TTErr processRealOoura(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs);
63  TTErr processComplexMayer(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs);
64  TTErr processRealMayer(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs);
65 
66 };
67 
68 
69 #endif // __TT_FFT_H__
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
Definition: TTBase.h:167
std::uint16_t TTUInt16
16 bit unsigned integer
Definition: TTBase.h:176
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
TTErr setMode(const TTValue &newValue)
Attribute accessor.
Definition: TTFFT.cpp:67
TTErr setInverse(const TTValue &newValue)
Attribute accessor.
Definition: TTFFT.cpp:56
TTOperator performs basic mathematical operations on an input signal, or a pair of input signals...
Definition: TTFFT.h:24
TTErr setAlgorithm(const TTValue &newValue)
Attribute accessor.
Definition: TTFFT.cpp:74
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::int16_t TTInt16
16 bit signed integer
Definition: TTBase.h:175
std::vector< TTSampleValue > TTSampleVector
A TTSampleVector is simply a pointer to the first of an array of TTSampleValues.
Definition: TTBase.h:233
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
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
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
TTErr processComplexOoura(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
FFT Audio Process Routine.
Definition: TTFFT.cpp:146