Skip to content

scjurgen/FilterSuite

Repository files navigation

#Filter Generator

Here are implemented some filters based on the filters of A.J. Fisher (a genius who died much too soon [https://www-users.cs.york.ac.uk/~fisher/tribute.html]).

Following filters are currently supported in this collection:

Order: 1st, 2nd and 3rd order (use 3rd order with care, better cascade)

Pass modes: low and high pass, band stop, band pass.

Characters: Chebyshev, Butterworth and Bessel characters.

plus resonator.

##AllFilters.h

AllFilters.h is generated by generator/GenerateFilterSuite It contains the templates as described.

Filter are created as templates (see next code block for usage):

LowPassOrder1
HighPassOrder1
BandPassOrder1
BandStopOrder1
LowPassOrder2
HighPassOrder2
BandPassOrder2
BandStopOrder2
LowPassOrder3  // order 3 are not working with satisfaction
HighPassOrder3
BandPassOrder3
BandStopOrder3
AllPassResonatorOrder1
BandPassResonatorOrder1
BandStopResonatorOrder1

using a filter is pretty easy

// create filter
        BandPassResonatorOrder1<double> filter(FC_RESONATOR,10);
        
        // compute alpha values, i.e.:
        double a = 200.0/44100.0; // corner frequency 200Hz when sample rate is 44100
        double a2 = 300.0/44100.0; // corner frequency 300Hz when sample rate is 44100
        filter.setAlphas(a, a2); // complete octave for a band stop or band pass
        
        double outvalue = filter.step(invalue);

#Tests

if you want to run the tests you will need:

gnuplot (for printing the actual response graphs)
sox (for creating sample files)
googlemock (for unittest on coefficients and packing the whole thing)

About

Filter library in C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published