Elliptic Approximation and Elliptic Filter Design on Small Computers by Pierre Amstutz: Recovering the Source Code

While looking for a "simple" but precise program for designing passive elliptic (Cauer) lowpass filters and to calculate the components of the resulting ladder structure, I found the marvelous and compact paper:

This document indeed contains two "all-inclusive" Fortran programs for symmetric and antimetric ladder lowpass design and component calculation. It's just for compiling and running from the command line, open source and portable, no window fuzz, no licence costs, isn't this handy? However the listings were in a rather bad print/scan quality, and the Fortran sources could not be found anywhere in the depths of the internet. So my sparetime task was set up to recover the original source code.

Recovering the Original Fortran Code

First the listings from the paper were OCR'ed by tesseract, with only very marginal success. Then came to a help the nice book from the early PC days:

In Program B9-2 (Symmetric Elliptical Filters) and Program B9-3 (Antimetric Elliptical Filters) the book contains BASIC renderings of Amstutz' Fortran programs. BASIC is still better than nothing, and this allowed already a reasonable OCR. A further internet search brought up yet another document:

In Appendix IV on pages 125 and 126 the paper contains crisp renderings of the two original BASIC programs by Cuthbert, which allowed quite acceptable OCRing by tesseract (still with many errors). The following work steps consisted of a bit tedious manual corrections to the BASIC sources, checking against the code from Cuthbert and Crawford, and bringing the programs to life again with the bwbasic interpreter on my debian Linux PC.

The recovered BASIC programs from Cuthbert and slightly modified versions are here for download:

Happily the BASIC code structure follows quite strictly the structure of Amstutz' Fortran code. The Fortran line numbers where already there, just a few variables needed renaming, and the BASIC language needed to be massaged into Fortran. So after another sparetime editing round, through the described BASIC lap of honor, finally the original Fortran code from Amstutz' paper could be recovered:

Playing with the Fortran programs was fun (looking forward to their 40th anniversary), and a check against the examples from Amstutz' paper gave identical results.

Lua Code for Elliptic Filter Design

Nowadays it seems to be more handy to have a Lua rendering of the filter design code, e. g., as basis for a library, and since the Lua memory management allows to extend the filter order arbitrarily, within the limits of the double precision arithmetics. And even this can be easily alleviated by modifying the Lua code further to use the MPFR library through the LUA MPFR API.

From the Fortran code basis the conversion into Lua was a quite straightforward, easy task. Here are the Lua programs for elliptic filter design after Pierre Amstutz' code:

I checked the BASIC, Fortran, and Lua programs with a few examples also against the tables in the classic engineering book:

The program results were very similar to the table values in the Handbook, also the sequence of attenuation poles was identical. Actually the code can replace a large part of the Handbook tables, with greater flexibility regarding the parameters and towards higher filter degrees. Now the above programs are waiting for their first practical application here...

Beware: There may be errors in the sources introduced by me through the OCR and editing process. No warranty!

Anyhow: Have fun!

This page first put online 07 November 2017.


Copyright © 2001 - 2017 by Hartmut Henkel
Disclaimer
Impressum

Last file change: