Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

pp::Filters Namespace Reference

Filters for processing audio data. More...


Compounds

class  pp::Filters::AllPass
class  pp::Filters::BandPass
class  pp::Filters::ButterworthFilter
class  pp::Filters::CombFilter
class  pp::Filters::ConnectInParallel
class  pp::Filters::ConnectInSeries
class  pp::Filters::ConnectorFilter
class  pp::Filters::Convolution
class  pp::Filters::Delay
class  pp::Filters::DynamicDelay
class  pp::Filters::EnvelopeFilter
class  pp::Filters::FindMax
class  pp::Filters::FindOp
class  pp::Filters::FIRComb
class  pp::Filters::GeneralFilter
class  pp::Filters::GeneratorFilter
class  pp::Filters::GenericFilter
class  pp::Filters::HighPassFIR
class  pp::Filters::HighPassIIR
class  pp::Filters::IIRComb
class  pp::Filters::IIRCombLoop
class  pp::Filters::ImpulseResponseFilter
class  pp::Filters::LowPassFIR
class  pp::Filters::LowPassIIR
class  pp::Filters::MultiLowPassFIR
class  pp::Filters::NullFilter
class  pp::Filters::Oscilloscope
class  pp::Filters::PluginFilter
class  pp::Filters::Scale
class  pp::Filters::Schroeder1
class  pp::Filters::Schroeder2
class  pp::Filters::SimpleFilter
class  pp::Filters::TransformFilter

Functions

float MillisecondsToSamples (int SampleRate, int Milliseconds)
 A simple utility function that converts a time in milliseconds to the number of samples played back during that interval. More...

double zr (double df, int k=1)
 
Returns:
the real part of z^k = e^(-2*k*PI*deltaFrequency) z^k = cos(-2*k*PI*deltafrequency).


double zi (double df, int k=1)
 
Returns:
the imaginary part of z^k = e^(-2*k*PI*deltaFrequency) z^k = cos(-2*k*PI*deltafrequency) corresponds to the phase.


std::complex<double> z (double df, int k=1)
 complex version.

template<typenameT, classX> bool ConvertFilter (SimpleFilter<T>* f, X*& x)
bool GetSeries (SimpleFilter<short>* f, ConnectInSeries<short>*& s)
bool GetParallel (SimpleFilter<short>* f, ConnectInParallel<short>*& p)
bool GetConnector (SimpleFilter<short>* f, ConnectorFilter<short>*& c)


Detailed Description

Filters for processing audio data.

Designed for use with the stl algorithms.

You'll probably need to convert unsigned char to signed char before using these filters, preferably using an adapter (there are some defined in Adapters.h). eg.

      Adapter8 adapter(f);
      transform(begin8(), end8(), begin8(), adapter);
   

All are time domain filters.

signed short - or any other signed type - should be okay.

The all pass and recusive comb filters can be used together to create reveberators.

M.R. Schroeder's original designs: 1. 4 comb filters in parallel followed by two all pass filters in series. 2. 4 all pass filters in series.

He later extended his original designs by placing a multitap delay line in parallel with them, to simulate early reflections.

The filter response (H(f)) for a linear filter is given by

   H(f) = Sum[k = 0..M](Ck * z^k)/(1-Sum[j=0..N](Dj * z^j) 

   where z = e^(-2*PI*i*(deltaFrequency))
   
Eulers relation:
 e^(i*x) = cos(x) + i*sin(x) 

for a FIR that is H(f) = Sum[k=0..M](Ck*z^k) ie an FFT

        *** Notch ***

          f = notch center frequency
          r = 0..1, but not 1

          z1x = cos(2*pi*f/samplerate)
          a0a2 = (1-r)^2/(2*(|z1x|+1)) + r
          a1 = -2*z1x*a0a2
          b1 = 2*z1x*r
          b2 = -r*r

          output(t) = a0a2 * (input(t)+input(t-2)) + 
                      a1 * input(t-1)+ 
                      b1 * ouput(t-1) + b2*output(t-2)
  

Reverb can be implemented simplistically using IIRComb with a large delay or Schroeder1 or Schroeder2 the parameters are left up to trial and error.

Chorus and flanging can be implemented using a variable length delay line


Function Documentation

float pp::Filters::MillisecondsToSamples ( int SampleRate,
int Milliseconds ) [inline]
 

A simple utility function that converts a time in milliseconds to the number of samples played back during that interval.

It may be useful when using the comb filters or other filters that require an interval given by the number of samples.


Generated at Mon Nov 27 01:47:22 2000 for LibPenguinPlay by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000