Mozzi  alpha 0.01.1t
sound synthesis library for Arduino
 All Classes Functions Typedefs
Public Member Functions
LowPass1stOrder< T, LENGTH > Class Template Reference

Low-pass filter suited for smoothing control signals. More...

List of all members.

Public Member Functions

 LowPass1stOrder ()
 Constructor.
next (T x_current)
 Calculate the next sample, given an input signal.

Detailed Description

template<class T, unsigned char LENGTH>
class LowPass1stOrder< T, LENGTH >

Low-pass filter suited for smoothing control signals.

This is an alternatve to Mozzi's Smooth class, with the advantage that it can handle long numbers. However, the drawback is that it imparts gain so the output can be an order of magnitude larger than its input. This renders it unsuitable for some uses, such as controlling frequencies where harmonic results are required.

Todo:
Find out if there is a way to calculate and predict the output range for a particular input range and filter length, whether it can be used precisely or requires experimenting to find useful values in each application. Specialise templates for unsigned types.

Definition at line 43 of file LowPass1stOrder.h.


Constructor & Destructor Documentation

template<class T , unsigned char LENGTH>
LowPass1stOrder< T, LENGTH >::LowPass1stOrder ( ) [inline]

Constructor.

Template Parameters:
Tthe type of numbers being smoothed (int, long, etc.) This version only works with signed types.
LENGTHthe length of the feedback delay used in the filter. How much smoothing to apply. How many times callis of next() for the output to catch up with the input.

Definition at line 53 of file LowPass1stOrder.h.


Member Function Documentation

template<class T , unsigned char LENGTH>
T LowPass1stOrder< T, LENGTH >::next ( x_current) [inline]

Calculate the next sample, given an input signal.

Parameters:
inthe signal input.
Returns:
the signal output. This is likely to be surprisingly large, so you need to check it and adapt your program to suit.
Note:
: Timing 3-4 us

Definition at line 64 of file LowPass1stOrder.h.


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