4

I'm looking for a digital/analog chebyshev low pass filter for a windows forms project, preferably in c#, c++ or c. A pseudocode would be helpful as well.

I. J. Kennedy
  • 24,725
  • 16
  • 62
  • 87
T o n y
  • 53
  • 1
  • 6
  • Which filter exactly? (Order?) If you know the parameters you can implement it using an fft library such as FFTW (http://www.fftw.org/) – sinelaw Jan 31 '11 at 17:53
  • Is this some homework? If so, please explicitly state it. – isekaijin Jan 31 '11 at 17:54
  • For what kind of filter implementation are you looking: IIR (order?, which form), FIR, FFT overlap-save/add, or ??? – hotpaw2 Feb 01 '11 at 01:00

3 Answers3

5

Here's a web app by Tony Fisher that computes the coefficients for digital filters (common FIR and IIR types), plots the filter magnitude and phase response, and even creates an ANSI C function template:

http://www-users.cs.york.ac.uk/~fisher/mkfilter

and also analog filter design:

http://www-users.cs.york.ac.uk/~fisher/lcfilter

Eryk Sun
  • 33,190
  • 5
  • 92
  • 111
  • Thanks for your links, I am not sure though on some of the inputs. Could you give me an example of inputs and outputs for computing the Bessel filter coefficients? – T o n y Feb 08 '11 at 21:04
  • how many coefficients are there supposed to be? when I specify 3rd order, it generates 9 numbers: – T o n y Mar 05 '11 at 18:38
  • 1
    6.69292825e+00 1.00000000e+00 3.00000000e+00 3.00000000e+00 1.00000000e+00 3.20403524e-03 -1.59857411e-01 -3.86380876e-02 -1.00000000e+00 I am using the same algorithm as the one on the butterworth page as suggested by Paul R: http://stackoverflow.com/questions/344343/low-pass-filter-software What's the right way to use these numbers? – T o n y Mar 05 '11 at 19:56
  • Note: Mr Fischer passed away, those links now redirect you to a repository of his code on Github. – Alan Campbell Oct 01 '21 at 08:09
  • He is dead! The site is down and doesn't work anymore. Rest in peace :( – Mohammad Alavi Aug 19 '23 at 11:22
1

The fact that the filter is Chebyshev just determines the filter coefficients. The actual implementation is pretty much independent of the coefficients. You need a decent filter design package to generate the coefficients (since the coefficients are dependent on the various filter parameters and the chosen sampling frequency), and then it's up to you how you implement the actual filter, but there are various standard forms.

You might want to get a decent DSP text book or two if you're serious about doing this kind of thing.

Paul R
  • 208,748
  • 37
  • 389
  • 560
  • Thanks! Your comment helped me a lot. I was completely unsure of how the filter would be implemented in a software version. Now I am trying to learn how to do a Bessel filter, do you have any suggestions on how to learn it? – T o n y Feb 08 '11 at 16:56
  • 1
    @T o n y: the same comment applies - you can use the same implementation for Butterworth, Chebyshev, Bessel, elliptic, or any other kind of filter - all that changes are the coefficients (and the number of stages). Typically you use a filter design package to generate the coefficients and then just plug these in. See @eryksun's answer for one example of a filter design program. – Paul R Feb 08 '11 at 17:27
-1

Here is an efficient c# code example chebyshev filter using NMath's fft. Generating the filter coefficients isn't hard and can easily be done w/ an on-line too or with a reference book.

Paul
  • 5,376
  • 1
  • 20
  • 19
  • While FFTs can provide an efficient implementation for some filters, it is unlikely that simply doing FFT -> block multiply -> IFFT by itself will give the results you want. If you're going to use FFTs, you'll almost certainly want to deal with filter settling and how to overlap results from multiple FFTs. – Eric Backus Oct 14 '20 at 18:13