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

2016-10-21 Thread Claude Heiland-Allen
Hi, On 19/10/16 15:25, Jonathan Wilkes via Pd-list wrote: > When implemented in C, which approach takes the least amount of time > to read, reason about, and fully comprehend? Agreed, as changing filter frequency at message rate is probably a relatively cold code path, I vote for something

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

2016-10-19 Thread Christof Ressi
Good point. :-) so let's put it this way: the difference in cpu cost is neglectible for well designed patches. Again, i might be wrong. > Gesendet: Mittwoch, 19. Oktober 2016 um 23:54 Uhr > Von: "IOhannes m zmölnig" > An: pd-list@lists.iem.at > Betreff: Re: [PD] efficient

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

2016-10-19 Thread IOhannes m zmölnig
On 10/19/2016 11:40 PM, Christof Ressi wrote: > I guess, you can't change the cutoff frequency so often that the CPU cost > will actually matter. But maybe I'm wrong... well, the perform routing will be called *at most* for each block (which can be 1 sample when running with [block~ 1]) the

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

2016-10-19 Thread Dan Wilcox
I think a core commenting sprint would be *very* helpful, specially to those of us (me) who would like help in understanding the black magic inside. Dan Wilcox @danomatika danomatika.com robotcowboy.com

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

2016-10-19 Thread Christof Ressi
> that's where some setup code before the actual loop can become a bottleneck. Hmmm, I forgot that in the case of [hip~] the coefficient is not calculated in the perform routine at all, so maybe efficiency is really not that important. I guess, you can't change the cutoff frequency so often

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

2016-10-19 Thread Christof Ressi
> And the mysterious UNITBIT32 number in d_osc.c? Funny you mentioned that! I just wanted to add that instead of approximating trig functions through polynomials one could also read Pd's cosine table ( float * cos_table ) with linear interpolation like it's done in [cos~] and [osc~]. Miller

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

2016-10-19 Thread Jonathan Wilkes via Pd-list
> On Wed, Oct 19, 2016 at 4:25 PM, Jonathan Wilkes > 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

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

2016-10-19 Thread Martin Peach
On Wed, Oct 19, 2016 at 1:07 PM, katja wrote: > On Wed, Oct 19, 2016 at 4:25 PM, Jonathan Wilkes > wrote: > > When implemented in C, which approach takes the least amount of time > > to read, reason about, and fully comprehend? > > That is an important

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

2016-10-19 Thread katja
On Wed, Oct 19, 2016 at 4:25 PM, Jonathan Wilkes 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

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

2016-10-19 Thread katja
Thanks for your update Cyrille. This seems a useful approach to find approximations. I should really learn how to do that with libre office. Do you have tutorial links? So far I found this:

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

2016-10-19 Thread Jonathan Wilkes via Pd-list
When implemented in C, which approach takes the least amount of time to read, reason about, and fully comprehend? -Jonathan From: katja To: "pd-list@lists.iem.at" Sent: Wednesday, October 19, 2016 9:06 AM Subject: [PD] efficient

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

2016-10-19 Thread cyrille henry
since you manually adjust the coefficient, i wanted to see the difference with coefficient adjusted/optimised by a computer. I update the calc using X from -0.5 to 0.5 with X = (x-0.5)*Pi The coefficient i get are really different from yours (when considering the Pi factor between them). I