Thanks max, but as noted by sonigen above those are c^x curves, and I want x^c, so recursion won't help me. Looks like the other optimizations already noted are as far as I can go.Max M. wrote: ↑Mon Dec 03, 2018 8:12 pm Z1202
That's what I meant saying that b is the major source of precision loss.
Now I see what you mean. And I agree.
mikejm
What is the math to calculate k, a, b in this case? How do I graph it on desmos.com to confirm?
Roughly:
For `x[n] = a*x[n-1]` the impulse responce is `y = 1*a^n` (where n is number of iterations starting from 0)
For `x[n] = a*x[n-1] - b` it becomes `y = (1-b*n)*a^n`
and `n` -> `T in seconds` is obviously `n/sampleRate`.
E.g.:
https://www.desmos.com/calculator/cdjre0xvfq
https://www.desmos.com/calculator/2emxae2d6m
The rest depends on how exactly you're going to use it. Specifically if you need a separate "curve shape" parameter. In simple case we can for example choose values of the two curve points:
end point - to represent decay time,
some mid point - for its x or y value to specify the "curveness".
Then it becomes a usual "two-equations -> two-unknowns" solution.
Thanks all. This has been very instructive.