Ah, OK. What about implementing the formula x-tanh(a*x)/tanh(a) directly without any lookup table, how would that compare in terms of computing speed to the usual techniques of anti-aliasing? Well, I have to try that myself once I get home from work. Kalle Quoting "Victor Lazzarini" : > I meant like in the CSD. > > On 29 Mar 2011, at 11:35, kalleaho@mappi.helsinki.fi wrote: > >> Like this >> >> http://www.wolframalpha.com/input/?i=1-2*%28%28x-1%29+mod+1%29%2C+tanh%286*x%29%2Ftanh%286%29+from+-1+to+1 >> >> ? >> >> Doesn't seem to work >> >> http://www.wolframalpha.com/input/?i=1-2*%28%28x-1%29+mod+1%29%2C+tanh%286*x%29%2Ftanh%286%29+from+-1+to+1 >> >> Kalle >> >> Quoting "Victor Lazzarini" : >> >>> Shouldn't the tanh be offset in relation to the sawtooth ramp? >>> This would place the >>> transition region of the sigmoid at the sawtooth discontinuity. I >>> think it could work better. >>> In particular, there seems to be a DC component for a < pi >>> In other words, this : >>> >>> a1 phasor p4 >>> a1 = 2*a1 - 1 >>> ka = 10 >>> atanh tablei ka*a1, 2, 1, 0.5 >>> kscal tablei ka, 2, 1 >>> asig = (a1 - atanh/kscal)*0dbfs/4 >>> >>> >>> with >>> >>> f2 0 65537 "tanh" -3.14 +3.14 >>> >>> >>> On 29 Mar 2011, at 01:09, kalleaho@mappi.helsinki.fi wrote: >>> >>>> And integrating gives parabolic wave >>>> >>>> (2*x-1)^2/2-ln(cosh(a*(2*x-1)))/(a*tanh(a)) >>>> >>>> which can be used to get variable duty cycle triangle waves. >>>> When the formula for sawtooth is defined so that x goes from -1 >>>> to 1 it is rather simple >>>> >>>> x-tanh(a*x)/tanh(a) >>>> >>>> and parabolic wave is then >>>> >>>> 1/2*x^2-ln(cosh(a*x))/(a*tanh(a)) >>>> >>>> Other sigmoids could be used in the place of tanh I guess. >>>> >>>> Kalle >>>> >>>> >>>> Quoting Victor.Lazzarini@nuim.ie: >>>> >>>>> I don't think so. Interesting. >>>>> >>>>> Victor >>>>> >>>>> ----- Original Message ----- >>>>> From: kalleaho@mappi.helsinki.fi >>>>> Date: Monday, March 28, 2011 11:54 pm >>>>> Subject: [Csnd] A remarkable formula >>>>> To: csound@lists.bath.ac.uk >>>>> >>>>>> Hi, >>>>>> >>>>>> I got inspired by Victor's tanh() ideas and found this >>>>>> remarkable formula >>>>>> >>>>>> 2*x-1-tanh(a*(2*x-1))/tanh(a) >>>>>> >>>>>> If x is a phasor going from 0 to 1, this gives an approximate >>>>>> sawtooth >>>>>> with roughly 2*a harmonics, when a is about 3.5 or greater. Try it! >>>>>> >>>>>> Is this known? >>>>>> >>>>>> Kalle >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Send bugs reports to the Sourceforge bug tracker >>>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599 >>>>>> Discussions of bugs and features can be posted here >>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body >>>>>> "unsubscribe csound" >>>>>> >>>>> >>>>> Dr Victor Lazzarini, Senior Lecturer, Dept. of Music, >>>>> National University of Ireland, Maynooth >>>>> >>>>> >>>>> >>>>> Send bugs reports to the Sourceforge bug tracker >>>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599 >>>>> Discussions of bugs and features can be posted here >>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body >>>>> "unsubscribe csound" >>>>> >>>>> >>>> >>>> >>>> >>>> >>>> Send bugs reports to the Sourceforge bug tracker >>>> https://sourceforge.net/tracker/?group_id=81968&atid=564599 >>>> Discussions of bugs and features can be posted here >>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body >>>> "unsubscribe csound" >>>> >>> >>> Dr Victor Lazzarini >>> Senior Lecturer >>> Dept. of Music >>> NUI Maynooth Ireland >>> tel.: +353 1 708 3545 >>> Victor dot Lazzarini AT nuim dot ie >>> >>> >>> >>> >>> >>> Send bugs reports to the Sourceforge bug tracker >>> https://sourceforge.net/tracker/?group_id=81968&atid=564599 >>> Discussions of bugs and features can be posted here >>> To unsubscribe, send email sympa@lists.bath.ac.uk with body >>> "unsubscribe csound" >>> >>> >>> >> >> >> >> >> Send bugs reports to the Sourceforge bug tracker >> https://sourceforge.net/tracker/?group_id=81968&atid=564599 >> Discussions of bugs and features can be posted here >> To unsubscribe, send email sympa@lists.bath.ac.uk with body >> "unsubscribe csound" >> > > Dr Victor Lazzarini > Senior Lecturer > Dept. of Music > NUI Maynooth Ireland > tel.: +353 1 708 3545 > Victor dot Lazzarini AT nuim dot ie > > > > > > Send bugs reports to the Sourceforge bug tracker > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > Discussions of bugs and features can be posted here > To unsubscribe, send email sympa@lists.bath.ac.uk with body > "unsubscribe csound" > > > Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"