library of assembled shared sources |
http://lass.cocamware.com |
#include <filters.h>
Public Types | |
typedef Filter< T, InputIterator, OutputIterator > ::TValue | TValue |
typedef Filter< T, InputIterator, OutputIterator > ::TParam | TParam |
typedef Filter< T, InputIterator, OutputIterator > ::TReference | TReference |
typedef Filter< T, InputIterator, OutputIterator > ::TConstReference | TConstReference |
typedef Filter< T, InputIterator, OutputIterator > ::TInputIterator | TInputIterator |
typedef Filter< T, InputIterator, OutputIterator > ::TOutputIterator | TOutputIterator |
typedef Filter< T, InputIterator, OutputIterator > ::TNumTraits | TNumTraits |
typedef std::vector< T > | TValues |
typedef std::pair< TValues, TValues > | TValuesPair |
Public Member Functions | |
IirFilter (const TValues &numerator, const TValues &denominator) | |
construct IIR filter | |
IirFilter (const TValuesPair &coefficients) | |
construct IIR filter | |
TOutputIterator | operator() (TInputIterator first, TInputIterator last, TOutputIterator output) |
void | reset () |
Static Public Member Functions | |
static IirFilter | makeLaplace (const TValues &nominator, const TValues &denominator, TParam samplingFrequency) |
static IirFilter | makeButterworthLowPass (unsigned order, TParam cutoffAngularFrequency, TParam gain, TParam samplingFrequency) |
make an IIR filter implementing a low-pass butterworth filter. | |
static IirFilter | makeButterworthHighPass (unsigned order, TParam cutoffAngularFrequency, TParam gain, TParam samplingFrequency) |
make an IIR filter implementing a high-pass butterworth filter. | |
static IirFilter | makeRlcLowPass (TParam qFactor, TParam cutoffAngularFrequency, TParam gain, TParam samplingFrequency) |
make an IIR filter implementing an low-pass RLC circuit. | |
static IirFilter | makeRlcHighPass (TParam qFactor, TParam cutoffAngularFrequency, TParam gain, TParam samplingFrequency) |
make an IIR filter implementing an high-pass RLC circuit. | |
static IirFilter | makeRlcBandPass (TParam qFactor, TParam centerAngularFrequency, TParam gain, TParam samplingFrequency) |
make an IIR filter implementing an band-pass RLC circuit. | |
static IirFilter | makeRlcNotch (TParam qFactor, TParam centerAngularFrequency, TParam gain, TParam samplingFrequency) |
make an IIR filter implementing an notch RLC circuit. | |
static IirFilter | makeIntegrator (TParam gain, TParam samplingFrequency) |
make an IIR filter implementing a perfect integrator | |
static IirFilter | makeDifferentiator (TParam gain, TParam samplingFrequency) |
make an IIR filter implementing a perfect differentiator | |
static IirFilter | makeAWeighting (TParam samplingFrequency) |
make an A weighting filter | |
Private Types | |
typedef std::vector< size_t > | TIndexTable |
Private Member Functions | |
TOutputIterator | doFilter (TInputIterator first, TInputIterator last, TOutputIterator output) |
void | doReset () |
void | init (const TValues &numerator, const TValues &denominator) |
Static Private Member Functions | |
template<typename FwdIt1 , typename FwdIt2 > | |
static IirFilter | doMakeLaplace (FwdIt1 numFirst, FwdIt1 numLast, FwdIt2 denFirst, FwdIt2 denLast, TParam sampleFrequency) |
little private helper | |
static IirFilter | doMakeLaplace (const TValuesPair &coefficients, TParam sampleFrequency) |
little private helper | |
Private Attributes | |
TValues | xTaps_ |
TValues | yTaps_ |
TValues | xBuffer_ |
TValues | yBuffer_ |
TIndexTable | xNextIndex_ |
TIndexTable | yNextIndex_ |
size_t | xTapSize_ |
size_t | yTapSize_ |
size_t | xBufferIndex_ |
size_t | yBufferIndex_ |
Definition at line 119 of file filters.h.
typedef Filter<T, InputIterator, OutputIterator>::TValue lass::num::IirFilter< T, InputIterator, OutputIterator >::TValue |
Reimplemented from lass::num::Filter< T, InputIterator, OutputIterator >.
typedef Filter<T, InputIterator, OutputIterator>::TParam lass::num::IirFilter< T, InputIterator, OutputIterator >::TParam |
Reimplemented from lass::num::Filter< T, InputIterator, OutputIterator >.
typedef Filter<T, InputIterator, OutputIterator>::TReference lass::num::IirFilter< T, InputIterator, OutputIterator >::TReference |
Reimplemented from lass::num::Filter< T, InputIterator, OutputIterator >.
typedef Filter<T, InputIterator, OutputIterator>::TConstReference lass::num::IirFilter< T, InputIterator, OutputIterator >::TConstReference |
Reimplemented from lass::num::Filter< T, InputIterator, OutputIterator >.
typedef Filter<T, InputIterator, OutputIterator>::TInputIterator lass::num::IirFilter< T, InputIterator, OutputIterator >::TInputIterator |
Reimplemented from lass::num::Filter< T, InputIterator, OutputIterator >.
typedef Filter<T, InputIterator, OutputIterator>::TOutputIterator lass::num::IirFilter< T, InputIterator, OutputIterator >::TOutputIterator |
Reimplemented from lass::num::Filter< T, InputIterator, OutputIterator >.
typedef Filter<T, InputIterator, OutputIterator>::TNumTraits lass::num::IirFilter< T, InputIterator, OutputIterator >::TNumTraits |
Reimplemented from lass::num::Filter< T, InputIterator, OutputIterator >.
typedef std::vector<T> lass::num::IirFilter< T, InputIterator, OutputIterator >::TValues |
typedef std::pair<TValues, TValues> lass::num::IirFilter< T, InputIterator, OutputIterator >::TValuesPair |
typedef std::vector<size_t> lass::num::IirFilter< T, InputIterator, OutputIterator >::TIndexTable [private] |
lass::num::IirFilter< T, InIt, OutIt >::IirFilter | ( | const TValues & | numerator, | |
const TValues & | denominator | |||
) | [inline] |
construct IIR filter
a[0] + a[1] * z^-1 + a[2] * z^-2 + ... + a[m-1] * z^-(m-1) H(z) = ---------------------------------------------------------- b[0] + b[1] * z^-1 + b[2] * z^-2 + ... + b[m-1] * z^-(m-1)
numerator | [in] coefficients a[i] of transfer function H(z). | |
denominator | [in] coefficients b[i] of transfer function H(z). |
Definition at line 200 of file filters.inl.
References lass::num::IirFilter< T, InputIterator, OutputIterator >::init(), and lass::num::Filter< T, InputIterator, OutputIterator >::reset().
lass::num::IirFilter< T, InIt, OutIt >::IirFilter | ( | const TValuesPair & | coefficients | ) | [inline] |
construct IIR filter
coefficients | [in] numerator (=first) and denominator (=second) of transfer function H(z). |
Definition at line 213 of file filters.inl.
References lass::num::IirFilter< T, InputIterator, OutputIterator >::init(), and lass::num::Filter< T, InputIterator, OutputIterator >::reset().
IirFilter< T, InIt, OutIt > lass::num::IirFilter< T, InIt, OutIt >::makeLaplace | ( | const TValues & | nominator, | |
const TValues & | denominator, | |||
TParam | samplingFrequency | |||
) | [inline, static] |
Definition at line 234 of file filters.inl.
References lass::num::IirFilter< T, InputIterator, OutputIterator >::doMakeLaplace().
IirFilter< T, InIt, OutIt > lass::num::IirFilter< T, InIt, OutIt >::makeButterworthLowPass | ( | unsigned | order, | |
TParam | cutoffAngularFrequency, | |||
TParam | gain, | |||
TParam | samplingFrequency | |||
) | [inline, static] |
make an IIR filter implementing a low-pass butterworth filter.
order | [in] order of filter. filter rolls of at (order * 6) dB per decade. | |
cutoffAngularFrequency | [in] cutoff frequency measured in radians per sec (w = 2 pi f). | |
gain | [in] DC gain | |
samplingFrequency | [in] sampling frequency of digital signal |
Definition at line 250 of file filters.inl.
References lass::num::IirFilter< T, InputIterator, OutputIterator >::doMakeLaplace(), and lass::num::impl::laplaceButterworthLowPass().
IirFilter< T, InIt, OutIt > lass::num::IirFilter< T, InIt, OutIt >::makeButterworthHighPass | ( | unsigned | order, | |
TParam | cutoffAngularFrequency, | |||
TParam | gain, | |||
TParam | samplingFrequency | |||
) | [inline, static] |
make an IIR filter implementing a high-pass butterworth filter.
order | [in] order of filter. filter rolls of at (order * 6) dB per decade. | |
cutoffAngularFrequency | [in] cutoff frequency measured in radians per sec (w = 2 pi f). | |
gain | [in] DC gain | |
samplingFrequency | [in] sampling frequency of digital signal |
Definition at line 266 of file filters.inl.
References lass::num::IirFilter< T, InputIterator, OutputIterator >::doMakeLaplace(), and lass::num::impl::laplaceButterworthHighPass().
IirFilter< T, InIt, OutIt > lass::num::IirFilter< T, InIt, OutIt >::makeRlcLowPass | ( | TParam | qFactor, | |
TParam | cutoffAngularFrequency, | |||
TParam | gain, | |||
TParam | samplingFrequency | |||
) | [inline, static] |
make an IIR filter implementing an low-pass RLC circuit.
o---[R]---[sL]---*-----o | Vin [1/sC] Vout | o----------------*-----o
qFactor | [in] quality factor Q = sqrt(L/C)/R (Q > 1 for resonance peak, Q = 1/sqrt(2) for 2nd order butterworth). | |
cutoffAngularFrequency | [in] cutoff frequency measured in radians per sec (w = 2 pi f = 1 / sqrt(LC)) | |
gain | [in] DC gain | |
samplingFrequency | [in] sampling frequency of digital signal |
Definition at line 290 of file filters.inl.
References lass::num::IirFilter< T, InputIterator, OutputIterator >::doMakeLaplace(), lass::num::inv(), lass::num::NumTraits< C >::one, and lass::num::sqr().
IirFilter< T, InIt, OutIt > lass::num::IirFilter< T, InIt, OutIt >::makeRlcHighPass | ( | TParam | qFactor, | |
TParam | cutoffAngularFrequency, | |||
TParam | gain, | |||
TParam | samplingFrequency | |||
) | [inline, static] |
make an IIR filter implementing an high-pass RLC circuit.
o---[R]---[1/sC]---*----o | Vin [sL] Vout | o------------------*----o
qFactor | [in] quality factor Q = sqrt(L/C)/R (Q > 1 for resonance peak, Q = 1/sqrt(2) for 2nd order butterworth). | |
cutoffAngularFrequency | [in] cutoff frequency measured in radians per sec (w = 2 pi f = 1 / sqrt(LC)) | |
gain | [in] DC gain | |
samplingFrequency | [in] sampling frequency of digital signal |
Definition at line 316 of file filters.inl.
References lass::num::IirFilter< T, InputIterator, OutputIterator >::doMakeLaplace(), lass::num::inv(), lass::num::NumTraits< C >::one, and lass::num::sqr().
IirFilter< T, InIt, OutIt > lass::num::IirFilter< T, InIt, OutIt >::makeRlcBandPass | ( | TParam | qFactor, | |
TParam | centerAngularFrequency, | |||
TParam | gain, | |||
TParam | samplingFrequency | |||
) | [inline, static] |
make an IIR filter implementing an band-pass RLC circuit.
o---[sL]---[1/sC]---*----o | Vin [R] Vout | o-------------------*----o
qFactor | [in] quality factor Q = sqrt(L/C)/R (greater Q is more narrow stop band). | |
centerAngularFrequency | [in] frequency to be filter out, measured in radians per sec (w = 2 pi f = 1 / sqrt(LC)) | |
gain | [in] DC gain | |
samplingFrequency | [in] sampling frequency of digital signal |
Definition at line 342 of file filters.inl.
References lass::num::IirFilter< T, InputIterator, OutputIterator >::doMakeLaplace(), lass::num::inv(), lass::num::NumTraits< C >::one, lass::num::sqr(), and lass::num::NumTraits< C >::zero.
IirFilter< T, InIt, OutIt > lass::num::IirFilter< T, InIt, OutIt >::makeRlcNotch | ( | TParam | qFactor, | |
TParam | centerAngularFrequency, | |||
TParam | gain, | |||
TParam | samplingFrequency | |||
) | [inline, static] |
make an IIR filter implementing an notch RLC circuit.
o---[R]---*----o | [sL] Vin | Vout [1/sC] | o---------*----o
qFactor | [in] quality factor Q = sqrt(L/C)/R (greater Q is more narrow stop band). | |
centerAngularFrequency | [in] frequency to be filter out, measured in radians per sec (w = 2 pi f = 1 / sqrt(LC)) | |
gain | [in] DC gain | |
samplingFrequency | [in] sampling frequency of digital signal |
Definition at line 370 of file filters.inl.
References lass::num::IirFilter< T, InputIterator, OutputIterator >::doMakeLaplace(), lass::num::inv(), lass::num::NumTraits< C >::one, lass::num::sqr(), and lass::num::NumTraits< C >::zero.
IirFilter< T, InIt, OutIt > lass::num::IirFilter< T, InIt, OutIt >::makeIntegrator | ( | TParam | gain, | |
TParam | samplingFrequency | |||
) | [inline, static] |
make an IIR filter implementing a perfect integrator
gain | [in] DC gain | |
samplingFrequency | [in] sampling frequency of digital signal |
Definition at line 386 of file filters.inl.
References lass::num::IirFilter< T, InputIterator, OutputIterator >::doMakeLaplace(), lass::num::NumTraits< C >::one, and lass::num::NumTraits< C >::zero.
IirFilter< T, InIt, OutIt > lass::num::IirFilter< T, InIt, OutIt >::makeDifferentiator | ( | TParam | gain, | |
TParam | samplingFrequency | |||
) | [inline, static] |
make an IIR filter implementing a perfect differentiator
gain | [in] DC gain | |
samplingFrequency | [in] sampling frequency of digital signal |
Definition at line 401 of file filters.inl.
References lass::num::IirFilter< T, InputIterator, OutputIterator >::doMakeLaplace(), lass::num::NumTraits< C >::one, and lass::num::NumTraits< C >::zero.
IirFilter< T, InIt, OutIt > lass::num::IirFilter< T, InIt, OutIt >::makeAWeighting | ( | TParam | samplingFrequency | ) | [inline, static] |
make an A weighting filter
samplingFrequency | [in] sampling frequency of digital signal |
Definition at line 415 of file filters.inl.
References lass::num::IirFilter< T, InputIterator, OutputIterator >::doMakeLaplace().
IirFilter< T, InIt, OutIt >::TOutputIterator lass::num::IirFilter< T, InIt, OutIt >::doFilter | ( | TInputIterator | first, | |
TInputIterator | last, | |||
TOutputIterator | output | |||
) | [inline, private] |
Definition at line 429 of file filters.inl.
References lass::stde::T, lass::num::IirFilter< T, InputIterator, OutputIterator >::xBuffer_, lass::num::IirFilter< T, InputIterator, OutputIterator >::xBufferIndex_, lass::num::IirFilter< T, InputIterator, OutputIterator >::xNextIndex_, lass::num::IirFilter< T, InputIterator, OutputIterator >::xTaps_, lass::num::IirFilter< T, InputIterator, OutputIterator >::xTapSize_, lass::num::IirFilter< T, InputIterator, OutputIterator >::yBuffer_, lass::num::IirFilter< T, InputIterator, OutputIterator >::yBufferIndex_, lass::num::IirFilter< T, InputIterator, OutputIterator >::yNextIndex_, lass::num::IirFilter< T, InputIterator, OutputIterator >::yTaps_, lass::num::IirFilter< T, InputIterator, OutputIterator >::yTapSize_, and lass::num::NumTraits< C >::zero.
void lass::num::IirFilter< T, InIt, OutIt >::doReset | ( | ) | [inline, private, virtual] |
Reimplemented from lass::num::Filter< T, InputIterator, OutputIterator >.
Definition at line 458 of file filters.inl.
References lass::num::IirFilter< T, InputIterator, OutputIterator >::xBuffer_, lass::num::IirFilter< T, InputIterator, OutputIterator >::yBuffer_, and lass::num::NumTraits< C >::zero.
void lass::num::IirFilter< T, InIt, OutIt >::init | ( | const TValues & | numerator, | |
const TValues & | denominator | |||
) | [inline, private] |
Definition at line 467 of file filters.inl.
References lass::num::inv(), LASS_THROW, lass::stde::next(), lass::num::IirFilter< T, InputIterator, OutputIterator >::xBuffer_, lass::num::IirFilter< T, InputIterator, OutputIterator >::xBufferIndex_, lass::num::IirFilter< T, InputIterator, OutputIterator >::xNextIndex_, lass::num::IirFilter< T, InputIterator, OutputIterator >::xTaps_, lass::num::IirFilter< T, InputIterator, OutputIterator >::xTapSize_, lass::num::IirFilter< T, InputIterator, OutputIterator >::yBuffer_, lass::num::IirFilter< T, InputIterator, OutputIterator >::yBufferIndex_, lass::num::IirFilter< T, InputIterator, OutputIterator >::yNextIndex_, lass::num::IirFilter< T, InputIterator, OutputIterator >::yTaps_, lass::num::IirFilter< T, InputIterator, OutputIterator >::yTapSize_, and lass::num::NumTraits< C >::zero.
Referenced by lass::num::IirFilter< T, InputIterator, OutputIterator >::IirFilter().
IirFilter< T, InIt, OutIt > lass::num::IirFilter< T, InIt, OutIt >::doMakeLaplace | ( | FwdIt1 | numFirst, | |
FwdIt1 | numLast, | |||
FwdIt2 | denFirst, | |||
FwdIt2 | denLast, | |||
TParam | sampleFrequency | |||
) | [inline, static, private] |
little private helper
Definition at line 517 of file filters.inl.
References lass::num::impl::laplaceToZ().
Referenced by lass::num::IirFilter< T, InputIterator, OutputIterator >::doMakeLaplace(), lass::num::IirFilter< T, InputIterator, OutputIterator >::makeAWeighting(), lass::num::IirFilter< T, InputIterator, OutputIterator >::makeButterworthHighPass(), lass::num::IirFilter< T, InputIterator, OutputIterator >::makeButterworthLowPass(), lass::num::IirFilter< T, InputIterator, OutputIterator >::makeDifferentiator(), lass::num::IirFilter< T, InputIterator, OutputIterator >::makeIntegrator(), lass::num::IirFilter< T, InputIterator, OutputIterator >::makeLaplace(), lass::num::IirFilter< T, InputIterator, OutputIterator >::makeRlcBandPass(), lass::num::IirFilter< T, InputIterator, OutputIterator >::makeRlcHighPass(), lass::num::IirFilter< T, InputIterator, OutputIterator >::makeRlcLowPass(), and lass::num::IirFilter< T, InputIterator, OutputIterator >::makeRlcNotch().
IirFilter< T, InIt, OutIt > lass::num::IirFilter< T, InIt, OutIt >::doMakeLaplace | ( | const TValuesPair & | coefficients, | |
TParam | sampleFrequency | |||
) | [inline, static, private] |
little private helper
Definition at line 528 of file filters.inl.
References lass::num::IirFilter< T, InputIterator, OutputIterator >::doMakeLaplace().
TOutputIterator lass::num::Filter< T, InputIterator, OutputIterator >::operator() | ( | TInputIterator | first, | |
TInputIterator | last, | |||
TOutputIterator | output | |||
) | [inline, inherited] |
Definition at line 62 of file filters.h.
References lass::num::Filter< T, InputIterator, OutputIterator >::doFilter().
void lass::num::Filter< T, InputIterator, OutputIterator >::reset | ( | ) | [inline, inherited] |
Definition at line 63 of file filters.h.
References lass::num::Filter< T, InputIterator, OutputIterator >::doReset().
Referenced by lass::num::FirFilter< T, InputIterator, OutputIterator >::FirFilter(), and lass::num::IirFilter< T, InputIterator, OutputIterator >::IirFilter().
TValues lass::num::IirFilter< T, InputIterator, OutputIterator >::xTaps_ [private] |
Definition at line 158 of file filters.h.
Referenced by lass::num::IirFilter< T, InputIterator, OutputIterator >::doFilter(), and lass::num::IirFilter< T, InputIterator, OutputIterator >::init().
TValues lass::num::IirFilter< T, InputIterator, OutputIterator >::yTaps_ [private] |
Definition at line 159 of file filters.h.
Referenced by lass::num::IirFilter< T, InputIterator, OutputIterator >::doFilter(), and lass::num::IirFilter< T, InputIterator, OutputIterator >::init().
TValues lass::num::IirFilter< T, InputIterator, OutputIterator >::xBuffer_ [private] |
Definition at line 160 of file filters.h.
Referenced by lass::num::IirFilter< T, InputIterator, OutputIterator >::doFilter(), lass::num::IirFilter< T, InputIterator, OutputIterator >::doReset(), and lass::num::IirFilter< T, InputIterator, OutputIterator >::init().
TValues lass::num::IirFilter< T, InputIterator, OutputIterator >::yBuffer_ [private] |
Definition at line 161 of file filters.h.
Referenced by lass::num::IirFilter< T, InputIterator, OutputIterator >::doFilter(), lass::num::IirFilter< T, InputIterator, OutputIterator >::doReset(), and lass::num::IirFilter< T, InputIterator, OutputIterator >::init().
TIndexTable lass::num::IirFilter< T, InputIterator, OutputIterator >::xNextIndex_ [private] |
Definition at line 162 of file filters.h.
Referenced by lass::num::IirFilter< T, InputIterator, OutputIterator >::doFilter(), and lass::num::IirFilter< T, InputIterator, OutputIterator >::init().
TIndexTable lass::num::IirFilter< T, InputIterator, OutputIterator >::yNextIndex_ [private] |
Definition at line 163 of file filters.h.
Referenced by lass::num::IirFilter< T, InputIterator, OutputIterator >::doFilter(), and lass::num::IirFilter< T, InputIterator, OutputIterator >::init().
size_t lass::num::IirFilter< T, InputIterator, OutputIterator >::xTapSize_ [private] |
Definition at line 164 of file filters.h.
Referenced by lass::num::IirFilter< T, InputIterator, OutputIterator >::doFilter(), and lass::num::IirFilter< T, InputIterator, OutputIterator >::init().
size_t lass::num::IirFilter< T, InputIterator, OutputIterator >::yTapSize_ [private] |
Definition at line 165 of file filters.h.
Referenced by lass::num::IirFilter< T, InputIterator, OutputIterator >::doFilter(), and lass::num::IirFilter< T, InputIterator, OutputIterator >::init().
size_t lass::num::IirFilter< T, InputIterator, OutputIterator >::xBufferIndex_ [private] |
Definition at line 166 of file filters.h.
Referenced by lass::num::IirFilter< T, InputIterator, OutputIterator >::doFilter(), and lass::num::IirFilter< T, InputIterator, OutputIterator >::init().
size_t lass::num::IirFilter< T, InputIterator, OutputIterator >::yBufferIndex_ [private] |
Definition at line 167 of file filters.h.
Referenced by lass::num::IirFilter< T, InputIterator, OutputIterator >::doFilter(), and lass::num::IirFilter< T, InputIterator, OutputIterator >::init().
Generated on Mon Nov 10 14:22:10 2008 for Library of Assembled Shared Sources by 1.5.7.1 |