Jamoma API  0.6.0.a19
TTLowpassButterworth4 Class Reference

4th order Butterworth lowpass filter; Butterworth filters have maximum flat frequency response in the pass band. More...

#include <TTLowpassButterworth4.h>

+ Inheritance diagram for TTLowpassButterworth4:
+ Collaboration diagram for TTLowpassButterworth4:

Protected Member Functions

TTErr updateMaxNumChannels (const TTValue &oldMaxNumChannels, TTValue &)
 Receives notifications when there are changes to the inherited mMaxNumChannels attribute. More...
 
TTErr clear ()
 This algorithm uses an IIR filter, meaning that it relies on feedback. More...
 
TTErr calculateValue (const TTFloat64 &x, TTFloat64 &y, TTPtrSizedInt channel)
 Standard single value calculate method as used by DSP objects. More...
 
TTErr processAudio (TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
 Standard audio processing method as used by TTBlue objects. More...
 
TTErr setFrequency (const TTValue &value)
 Setter for the frequency attribute. More...
 
virtual TTErr test (TTValue &returnedTestInfo)
 Unit Tests. More...
 

Protected Attributes

TTFloat64 mFrequency
 filter cutoff frequency
 
TTFloat64 mRadians4
 filter coefficients
 
TTFloat64 mA2
 filter coefficients for input samples
 
TTFloat64 mB4
 filter coefficients for output samples
 
TTSampleVector mX1
 Input sample n-1.
 
TTSampleVector mX2
 Input sample n-2.
 
TTSampleVector mX3
 Input sample n-3.
 
TTSampleVector mX4
 Input sample n-4.
 
TTSampleVector mY1
 Output sample n-1.
 
TTSampleVector mY2
 Output sample n-2.
 
TTSampleVector mY3
 Output sample n-3.
 
TTSampleVector mY4
 Output sample n-4.
 

Detailed Description

4th order Butterworth lowpass filter; Butterworth filters have maximum flat frequency response in the pass band.

Filter equations from:

Second-order IIR Filters will support cascade implementations By Rusty Allred, Texas Instruments, Dallas July 01, 2003 http://www.planetanalog.com/article/printableArticle.jhtml?articleID=12802683

Definition at line 40 of file TTLowpassButterworth4.h.

Member Function Documentation

TTErr TTLowpassButterworth4::calculateValue ( const TTFloat64 x,
TTFloat64 y,
TTPtrSizedInt  channel 
)
inlineprotected

Standard single value calculate method as used by DSP objects.

Definition at line 134 of file TTLowpassButterworth4.cpp.

References kTTErrNone, mA2, mB4, mX1, mX2, mX3, mX4, mY1, mY2, mY3, and mY4.

Referenced by processAudio().

TTErr TTLowpassButterworth4::clear ( )
protected

This algorithm uses an IIR filter, meaning that it relies on feedback.

If the filter should not be producing any signal (such as turning audio off and then back on in a host) or if the feedback has become corrupted (such as might happen if a NaN is fed in) then it may be neccesary to clear the filter by calling this method.

Returns
Returns a TTErr error code.

Definition at line 81 of file TTLowpassButterworth4.cpp.

References kTTErrNone, TTAudioObjectBase::mMaxNumChannels, mX1, mX2, mX3, mX4, mY1, mY2, mY3, and mY4.

Referenced by updateMaxNumChannels().

TTErr TTLowpassButterworth4::processAudio ( TTAudioSignalArrayPtr  inputs,
TTAudioSignalArrayPtr  outputs 
)
protected

Standard audio processing method as used by TTBlue objects.

Definition at line 154 of file TTLowpassButterworth4.cpp.

References calculateValue().

+ Here is the call graph for this function:

TTErr TTLowpassButterworth4::setFrequency ( const TTValue value)
protected

Setter for the frequency attribute.

Definition at line 95 of file TTLowpassButterworth4.cpp.

References kTTErrNone, kTTPi, kTTTwoPi, mFrequency, mRadians4, and TTAudioObjectBase::sr.

TTErr TTLowpassButterworth4::test ( TTValue returnedTestInfo)
protectedvirtual

Unit Tests.

Parameters
returnedTestInfoUsed to return test information
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Reimplemented from TTAudioObjectBase.

Definition at line 20 of file TTLowpassButterworth4.test.cpp.

TTErr TTLowpassButterworth4::updateMaxNumChannels ( const TTValue oldMaxNumChannels,
TTValue  
)
protected

Receives notifications when there are changes to the inherited mMaxNumChannels attribute.

This allocates memory for xm1, xm2, ym1, and ym2 so that each channel's previous values are remembered.

Definition at line 59 of file TTLowpassButterworth4.cpp.

References clear(), kTTErrNone, TTAudioObjectBase::mMaxNumChannels, mX1, mX2, mX3, mX4, mY1, mY2, mY3, and mY4.

+ Here is the call graph for this function:


The documentation for this class was generated from the following files: