Reply by robert bristow-johnson●January 23, 20062006-01-23
Martin Eisenberg wrote:
> robert bristow-johnson wrote:
> > Martin Eisenberg wrote:
> >> DF2 transposed halves the number of states.
> > not for multiple cascaded biquad sections. the two output
> > states of "section n-1" are the same as the input states of
> > "section n".
> OK -- numerical properties aside you presume one way of constructing
> programs there, and so did I when I catered to David's immediate
> question but no more. Fusing the states of adjacent DF1 sections is
> of course easy if you write the thing from scratch every time. If you
> just want to chain modules from a library and still do it, either you
> end up connecting filter objects to state buffers explicitly which
> sort of defies the premise; or you abstract the fusing into another
> library entity which is unconventional enough to add a fair bit of
> complexity however its code actually looks, and also possibly incurs
> runtime overhead.
well, i'm trying to compare apples to apples here. there are little
optimized subroutines to do the DF2 with N sections, why don't TI and
ADI write them as DF1 (with that state "fusing")?
> > although the DF2 won't suffer saturation if floating point is
> > used, i have noted a numerical problem for DF2 if single
> > precision is used (having to do with loss of precision when
> > scaled states are subtracted). we've discussed this before on
> > comp,dsp you might unwrap this URL and read about it:
> Are you referring to DF2 or DF2-transposed here? You didn't respond
> to Nigel's pointing out in that thread that the latter is more benign
> (even though it has three summing nodes, alas). Also, when the code
> mostly keeps states in the extended-precision registers of the x86
> (David's target, as I learned on music-dsp) the difference between
> DF1 and DF2-t might be inconsequential after all, what do you say?
i didn't try the DF2-t, so what you and Nigel say might very well be
correct. but, unless you put in a couple of quantizers, the states in
the DF2 transpose must be double precision. if they are not, then the
DF2-t has 3 quantization noise sources instead of 1.
the DF1 needs only a double precision accumulator and has only one
quantization per section.