[PD] efficient approximation of trig functions for hi pass formula (was: could vanilla borrow iemlib's hi pass filter recipe?)

Jonathan Wilkes jancsika at yahoo.com
Wed Oct 19 20:57:03 CEST 2016

> On Wed, Oct 19, 2016 at 4:25 PM, Jonathan Wilkes <jancsika at yahoo.com> 
> wrote:

>> When implemented in C, which approach takes the least amount of time
>> to read, reason about, and fully comprehend?

> That is an important question. Pd code is full of clever tricks and
> bit hacks for dsp efficiency. What is the origin of q8_rsqrt(), why
> and how does it work? What about PD_BIGORSMALL() in m_pd.h? And the
> mysterious UNITBIT32 number in d_osc.c? Ideally such code should be
> commented not only to denote its function (if necessary) but also to
> reference the origin so you may be able to find info.

> An approximation for a trig function should go in an (inline)
> function, with a comment if the name can't clarify the function
> sufficiently. But to fully comprehend is a different matter. Dsp code
> in general takes substantial background to understand. You could
> wonder why and how the approximation works, but the same question goes
> for the function that it replaces.

And if we're not talking hot code then the answer of which answer arrived in less 
time should (at least in large part) dictate which method to use, shouldn't it?

> Katja   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20161019/70d37533/attachment-0001.html>

More information about the Pd-list mailing list