[music-dsp] Re: A Collection of C++ Classes for Digital SignalProcessing

Martin Eisenberg martin.eisenberg at udo.edu
Mon May 4 09:33:08 EDT 2009


From: "Vinnie" <thevinn at yahoo.com>
> > From: "Martin Eisenberg"

> > The DF2 is numerically inferior to DF2-transposed
> > which is what you should implement.
>
> Can you please give me a link? All I could find were the
> diagrams and I have trouble reading those.

It seems harder to ferret out a link than give the code:

out  = in * b[0] + v[0];
v[0] = in * b[1] + out * a[1] + v[1];
v[1] = in * b[2] + out * a[2];

Surely you can see how this corresponds to the flow diagram. In
general, each output or state cell generates an assignment, and
each path backwards from that object up to another state, output,
or input generates a term on the right-hand side. The rest is
sequencing.

> CalcT d2=h->v[2]=h->v[1];
> CalcT d1=h->v[1]=h->v[0];
>
> These statements seem to be working fine.

Sorry, I misread what you're doing!

> > I don't get what the problem with <complex> is --
> > after all you don't reimplement the required subset
> > of <cmath> either.
>
> What do you mean by required subset?

The part of <cmath> that your file uses.

> I wanted a complex class that was under my control.
> At some point I will be using approximations for the
> trigonometric functions in the ComplexT class itself.
> Especially for operations like ::sqrt().

But you could provide those either way, like you did for reals.
What is it that you want to control?

> Say what? You mean run the filter on an array of
> complex numbers? I did not know that was a use case.

It's hardly an everyday use in the audio context. I had just
convinced myself there were complex Process() overloads but now I
see it was something else.

> > I'm also not convinced of the value
> > in making "skip" a template parameter.
>
> Do you mean it should be a paramter to the function with
> a default value of 0?

Yes, that's what I meant. I'll address the other template points
later.


Martin




More information about the music-dsp mailing list