swestrup: (Default)
[personal profile] swestrup
I'm wondering if anyone here has a clue as to where to look for a relatively simple function to calculate an approximate sawtooth curve. I need something that is continuous and differentiable or I'd just use something standard like the floor function. I've looked at fourier approximations and they need a lot more terms than I like to approximate a reasonable sawtooth, PLUS they are awfully bumpy.

So far all attempts to look up periodic asymmetrical functions on the net have failed me.

Date: 2010-01-31 05:25 am (UTC)
From: [identity profile] sps.livejournal.com
Welllll, if you can't get your differentiability by filter theory, and you only need to be differentiable once, what about using splines? Continuous and everywhere differentiable, small number of terms and non-bumpy, very easy to tweak, at the cost of having to do the modular reduction yourself.

Date: 2010-01-31 06:26 am (UTC)
From: [identity profile] cpirate.livejournal.com
I saw this the other day, which doesn't directly answer your question, but may give you some inspiration: http://www.johndcook.com/blog/2010/01/13/soft-maximum/

Date: 2010-01-31 04:43 pm (UTC)
From: [identity profile] sps.livejournal.com
I don't think you get invertible within a period together with continuous. The steep side can't be completely vertical... or perhaps I misunderstood.

Date: 2010-01-31 09:24 pm (UTC)
From: [identity profile] sps.livejournal.com
So you want to jitter the x axis periodically. Something like sin(x + k sin(x))?

Date: 2010-01-31 09:26 pm (UTC)
From: [identity profile] sps.livejournal.com
I understand. But so long invertibility. In each cycle, each y value has to be passed twice.

Date: 2010-02-01 01:26 am (UTC)
From: [identity profile] sps.livejournal.com
Spline.

January 2017

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 16th, 2026 10:49 am
Powered by Dreamwidth Studios