Re: Is SFront deterministic ?

From: Eric Scheirer (eds@media.mit.edu)
Date: Sat Aug 28 1999 - 09:19:36 EDT


John Lazzaro wrote:

>instr filt () {
>
>ksig freq;
>asig sigin, old1, old2, old3, stage1, stage2, stage3;
>
>sigin = 0.5*buzz(freq,1,0,0);
>freq = min(freq+25, 10000);
>
>stage1 = iir(sigin, 0.2871, -1.2971, -0.4466, 0.6949, 0, 0, 0);
>stage2 = iir(sigin, -2.1428, -1.0691, 1.1454, 0.3699, 0, 0, 0);
>stage3 = iir(sigin, 1.8558, -0.9972, -0.6304, 0.2570, 0, 0, 0);
>
>old1 = biquad(sigin,0.2871,-0.4466,0,-1.2971,0.6949);
>old2 = biquad(sigin,-2.1428,1.1454,0,-1.0691,0.3699);
>old3 = biquad(sigin,1.8558,-0.6304,0,-0.9972,0.2570);
>
>output(stage1+stage2+stage3 - old1 - old2 - old3);
>
>}
>
> [...]
>
>I could imagine a set of 50-100 SAOL programs of this nature that
>cover the core opcode and basic language functionality, and come
>up with a "quality rating" for a decoder that wouldn't require
>comparison to "reference" audio output.

This is a subtle point but an important one: Particularly for filters
that are close to unstable, it may be the case that iir() is stable on
one platform but unstable on another (since the particular filter
topology is nonnormative for iir()). But the goal of iir() is
not necessarily to be 'close to biquad()' - it's not the case, at least
to me, that an implementation that implements iir() in the same
topology as biquad() is "better" than one that doesn't, which is
what your test is checking here. The idea of having slightly
nonnormative iir() and fir() functions in addition to the strictly
normative biquad() function is that other topologies might be more
efficient than Direct II Transposed on certain platforms, and
so iir(), although less normative, might be much faster. Then
this is a tradeoff that content authors can make--speed for
precision.

In practice, the difference between these implementations will
be in the arithmetic noise except when the filter is on the border
between stability and not. (In such a case, it may not be possible
to say whether the filter is "supposed" to be stable or not.)
All the standard says is that content authors shouldn't do this,
and if they really need to they should use biquad() rather than
iir() or fir().

I think in-depth discussion of all these issues is very useful
so that we can all be on the same page regarding the varying
levels of normativity in the SA specification and their implications
for implementators and content authors.

Best,

 -- Eric



This archive was generated by hypermail 2b29 : Wed May 10 2000 - 12:15:29 EDT