From: Tim Wescott on
Nasser M. Abbasi wrote:
> Hello,
>
> I wrote a small program for class to design a low pass digital filter. it is
> an IIR filter designed using Butterworth.
>
> We are given the specifications, and I have generated H(s) and H(z) (using
> impulse invariance, and using bilinear methods).
>
> What is considered as a "standard" output to print as a result of such a
> design run? I am now printing the pole locations for Butterworth and for
> H(z). I also print the spectrums (mag and phase).
>
> I wanted to print H(s), but need to decide the best way to do this. I was
> thinking to print only the coefficients of the denominator polynomial and
> the numerator polynomial for both H(s) and H(z). i.e. write H(s) =
> N(s)/D(s), and H(z)=N(z)/D(z), and make a table listing the power of s or z,
> and the coefficient of this term.
>
> Printing H(s) and H(z) itself is hard to format correctly due to size change
> as order of the filter can change with each run, but printing the
> coefficients only is easier to format as I can make a table, the length of
> table can change, but I have more control of formatting its columns.
>
> Would this be OK? Or is there another standard format I should be aware of
> for this sort of thing? Any examples I can look at? I've seen many examples
> googling around, but each seems to generate different output, and wanted to
> check if there is a standard one.

This is where engineering stops being an applied science and becomes an
art. There is no standard, and there probably shouldn't be. It is up
to you to balance readability aesthetics and coding time to come up with
the best solution for you at this point in time.

Printing the filter coefficients is probably good. For the digital
filter, printing the pole and zero pairs is probably better, because the
pole positions get very sensitive to filter coefficients as the filter
order gets high and (for precisely the same underlying mathematical
reasons) when you implement the filter you'll want to split it into a
cascade of 2nd-order filters.

But as I said -- it's up to you.

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com