Notes on filter design

From MyLabWiki
Revision as of 17:49, 1 November 2010 by Alex (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

GNU Radio contains two packages that can be used to create filters, firdes and optfir. This page tries to document some of the similarities and characteristics for the non-experts.

Eric Blossom wrote on the GNU Radio discussion list[1]:

optfir uses the Remez / Parks-McClellan design method[2]. gr.firdes.low_pass designs filters using the window method[3]. It all depends on what you want. See any DSP book for details.

A complementary note by Firas[4] says that

The frequency response for the same filter order is much better in the case of optfir filter design. Inversely, for the same filter response, filter order is much less in the case of optfir which means lower CPU loading. It is best to design with optfir, but convergence problem is its disadvantage.

Firdes is implemented in C++ (see gnuradio-core/src/lib/general/ and .h) and can therefore be used in both C++ and Python (INSTALL_DIR/lib/python2.6/site-packages/gnutadio/gr/ applications, while optfir is written in Python (see gnuradio-core/src/python/gnuradio/

Another significant difference is the available filter types provided by both packages. In v3.3.1git-92-gdd74b98a we have:


  • low_pass
  • high_pass
  • band_pass and complex_band_pass
  • band_reject


  • low_pass (two variants)
  • high_pass (two variants)
  • band_pass and complex_band_pass (two variants)
  • band_reject (two variants)
  • hilbert
  • root_raised_cosine
  • gaussian

The "two variants" for firdes filters refers to two different API interfaces, one of which allows supplying the attenuation.


  2. Wikipedia: Parks-McClellan filter design algorithm
  3. Wikipedia: Finite impulse response: Window design method