D <dddd@...> writes:

> 
> Julius Smith <jos <at> ...> writes:
> 
> > 
> > 
> > Ok, all four direct-form biquads are now in filter.lib
> > (after you pull the latest master):
> > tf21(b0,b1,b2,a1,a2) = // tf2, direct-form 1:
> >     _ <:(mem<:((mem:*(b2)),*(b1))),*(b0) :>_
> >     : ((_,_,_:>_) ~(_<:*(-a1),(mem:*(-a2))));
> > tf22(b0,b1,b2,a1,a2) = // tf2, direct-form 2:
> >     _ : (((_,_,_:>_)~*(-a1)<:mem,*(b0))~*(-a2))
> >       : (_<:mem,*(b1)),_ : *(b2),_,_ :>
> > _;
> > tf22t(b0,b1,b2,a1,a2) = // tf2, direct-form 2 transposed:
> >     _ : (_,_,(_ <: *(b2)',*(b1)',*(b0))
> >       : _,+',_,_ :> _)~*(-a1)~*(-a2) :
> 
> I've just recently started looking at Faust, so I'm still working to
> properly parse it.  Is there 5 unit delays in tf22t (three explicit
> and two implicit from recursion)?  How does this compare with
> a biquad direct form II with 2 unit delays?

Just to follow on, I wanted to understand what the Faust compiler
would be doing in this situation.  Is it the case that you input the
system with a description involving 5 unit delays, but it still
generates a system with 2?  (In which case my previous question
could be changed to, is it possible to describe the system in the
Faust language using 2 unit delays, so that the Faust description
more closely parallels the direct form II transposed network?).

This is the C++ code generated from tf22t.  It ends up keeping
4 pieces of state:

- Last sample input, x*z-1, as fVec0
- Last sample output, y*z-1, as fRec0
- Last sample output again, fRec1 == fRec0
- Delay of the b2 / a2 branch, as Vec1

Maybe a really smart C++ compiler could get rid of the double
output state (but semantically I don't think you could do that
optimization), but that still leaves the system with 3 vs 2 states.

fVec0[0] = fTemp0;  // input

// b2 * (x*z-1) - a2 * (y*z-1)
fVec1[0] = ((b2 * fVec0[1]) - (a2 * fRec0[1]));

// ((b2 * (x*z-1) - a2 * (y*z-1)) * z-1) +
//   b1 * (x*z-1) + b0 * x - a1 * (y*z-1)
fRec1[0] = ((fVec1[1] + ((b1 * fVec0[1]) + (b0 * fVec0[0]))) - fRec1[1]);
fRec0[0] = fRec1[0];
output0[i] = (FAUSTFLOAT)fRec0[0];

// post processing
fRec0[1] = fRec0[0];
fRec1[1] = fRec1[0];
fVec1[1] = fVec1[0];
fVec0[1] = fVec0[0];

Just wanted to check that I got all of that right.  Is there a way to get
Faust to generate C++ code that would be closer to the two state
form?  And is there a way to describe the network in the Faust language
in a manner that is more similar to the 2 delay network?

Thanks again

> 
> I read the difference as the fact that it sums the output of
> individual delays instead of delaying the sums?  For example
> instead of delaying b1 - a1, b1 and a1 are each individually
> delayed and then summed.
> 
> Besides using twice (well 2.5x) the memory I guess this shouldn't
> have an effect on the system?
> 
> When you flatten out the system like this, is it still really
> considered direct-form 2 transposed?  To me while the algebra
> is of course identical I am not sure if I would see it as the same
> form, since of course the signal network is quite different, and
> also the states are different.
> 
> Is it not possible to implement the 2 unit delay signal network
> directly in Faust? IE:
> 
> http://www.earlevel.com/DigitalAudio/images/BiquadTDFII.gif
> 
> Thanks
> 
> > _;
> > tf21t(b0,b1,b2,a1,a2) = // tf2, direct-form 1 transposed:
> >     tf22t(1,0,0,a1,a2) : tf22t(b0,b1,b2,0,0); // or write
> > it out if you want
> > I have a little resonator filter-bank project that may be able to see
> > some differences in numerical behavior, and I'll report any
> > findings.
> > - Julius
> 
> ------------------------------------------------------------------------------
> Start Your Social Network Today - Download eXo Platform
> Build your Enterprise Intranet with eXo Platform Software
> Java Based Open Source Intranet - Social, Extensible, Cloud Ready
> Get Started Now And Turn Your Intranet Into A Collaboration Platform
> http://p.sf.net/sfu/ExoPlatform
> _______________________________________________
> Faudiostream-users mailing list
> Faudiostream-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
> 





------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to