How does one go about creating simple approximations of curves of known values (with tolerances)?












0












$begingroup$


I'm currently working on a synth, and many of the knobs are not linear in nature. Often, knobs will have a simple algorithm by which they transform linear changes into curved ones (such as volume or frequency). In other cases, the curve is a bit more arbitrary, and this is one of those cases.



I know what values I want to hit (roughly), and have a pretty large degree of relative tolerance for some of the values. Here are the values and their tolerances:



(0,    1) //no tolerance
(0.25, 1.75194 +- .00001)
(0.5, 3.5 +- .5)
(0.75, 11 +- 1)
(1, 500 +- 100)


They end up creating a pretty hard curve, and I've been attempting to match it by plugging values into a somewhat similar curve equation:



enter image description here



I know there must be a better way, but I have no idea how to solve a multiple variable equation for multiple known values which each have tolerances. Further, it has to (in my case) be computationally simple.



How can one create an simple equation to approximate a curve of known values which each have tolerances?



So far my steps are:




  1. Find a simple equation that's already fairly similar.

  2. Graph the points and equation

  3. Start messing with the increment rate of x, and any other variables and hope you get close.


But I'm certain there are much better approaches.



Edit: for anyone interested, here's where the values of y and their tolerances were derived from. It is an equation which can go from a triangle wave, to roughly a sine wave, to roughly a square wave. I think it's pretty neat!
enter image description here










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    Looks kinda like an exponential. Why not try fitting an exponential in Excel and see what $R^2$ value you get? If you're feeling particularly ambitious, plot the residuals to make sure you're not missing anything.
    $endgroup$
    – Adrian Keister
    Dec 14 '18 at 14:49










  • $begingroup$
    In terms of the amount computation needed to calculate the value for any particular $x$, a cubic spline would probably be faster than exponential, logarithmic, trig, or even taking of roots. Though it would look more complicated to you since the computer is already programmed to do those "behind the scene". On the other hand, a cubic splne may give you some unwanted behavior, so it may not be the best choice.
    $endgroup$
    – Paul Sinclair
    Dec 14 '18 at 23:37










  • $begingroup$
    I actually managed to find a very suitable equation: (log((1-x)/2)/log(1-((1-x)/2))^.762207. I'll have to take some time to explain how it came about later though.
    $endgroup$
    – Seph Reed
    Dec 15 '18 at 0:50
















0












$begingroup$


I'm currently working on a synth, and many of the knobs are not linear in nature. Often, knobs will have a simple algorithm by which they transform linear changes into curved ones (such as volume or frequency). In other cases, the curve is a bit more arbitrary, and this is one of those cases.



I know what values I want to hit (roughly), and have a pretty large degree of relative tolerance for some of the values. Here are the values and their tolerances:



(0,    1) //no tolerance
(0.25, 1.75194 +- .00001)
(0.5, 3.5 +- .5)
(0.75, 11 +- 1)
(1, 500 +- 100)


They end up creating a pretty hard curve, and I've been attempting to match it by plugging values into a somewhat similar curve equation:



enter image description here



I know there must be a better way, but I have no idea how to solve a multiple variable equation for multiple known values which each have tolerances. Further, it has to (in my case) be computationally simple.



How can one create an simple equation to approximate a curve of known values which each have tolerances?



So far my steps are:




  1. Find a simple equation that's already fairly similar.

  2. Graph the points and equation

  3. Start messing with the increment rate of x, and any other variables and hope you get close.


But I'm certain there are much better approaches.



Edit: for anyone interested, here's where the values of y and their tolerances were derived from. It is an equation which can go from a triangle wave, to roughly a sine wave, to roughly a square wave. I think it's pretty neat!
enter image description here










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    Looks kinda like an exponential. Why not try fitting an exponential in Excel and see what $R^2$ value you get? If you're feeling particularly ambitious, plot the residuals to make sure you're not missing anything.
    $endgroup$
    – Adrian Keister
    Dec 14 '18 at 14:49










  • $begingroup$
    In terms of the amount computation needed to calculate the value for any particular $x$, a cubic spline would probably be faster than exponential, logarithmic, trig, or even taking of roots. Though it would look more complicated to you since the computer is already programmed to do those "behind the scene". On the other hand, a cubic splne may give you some unwanted behavior, so it may not be the best choice.
    $endgroup$
    – Paul Sinclair
    Dec 14 '18 at 23:37










  • $begingroup$
    I actually managed to find a very suitable equation: (log((1-x)/2)/log(1-((1-x)/2))^.762207. I'll have to take some time to explain how it came about later though.
    $endgroup$
    – Seph Reed
    Dec 15 '18 at 0:50














0












0








0





$begingroup$


I'm currently working on a synth, and many of the knobs are not linear in nature. Often, knobs will have a simple algorithm by which they transform linear changes into curved ones (such as volume or frequency). In other cases, the curve is a bit more arbitrary, and this is one of those cases.



I know what values I want to hit (roughly), and have a pretty large degree of relative tolerance for some of the values. Here are the values and their tolerances:



(0,    1) //no tolerance
(0.25, 1.75194 +- .00001)
(0.5, 3.5 +- .5)
(0.75, 11 +- 1)
(1, 500 +- 100)


They end up creating a pretty hard curve, and I've been attempting to match it by plugging values into a somewhat similar curve equation:



enter image description here



I know there must be a better way, but I have no idea how to solve a multiple variable equation for multiple known values which each have tolerances. Further, it has to (in my case) be computationally simple.



How can one create an simple equation to approximate a curve of known values which each have tolerances?



So far my steps are:




  1. Find a simple equation that's already fairly similar.

  2. Graph the points and equation

  3. Start messing with the increment rate of x, and any other variables and hope you get close.


But I'm certain there are much better approaches.



Edit: for anyone interested, here's where the values of y and their tolerances were derived from. It is an equation which can go from a triangle wave, to roughly a sine wave, to roughly a square wave. I think it's pretty neat!
enter image description here










share|cite|improve this question











$endgroup$




I'm currently working on a synth, and many of the knobs are not linear in nature. Often, knobs will have a simple algorithm by which they transform linear changes into curved ones (such as volume or frequency). In other cases, the curve is a bit more arbitrary, and this is one of those cases.



I know what values I want to hit (roughly), and have a pretty large degree of relative tolerance for some of the values. Here are the values and their tolerances:



(0,    1) //no tolerance
(0.25, 1.75194 +- .00001)
(0.5, 3.5 +- .5)
(0.75, 11 +- 1)
(1, 500 +- 100)


They end up creating a pretty hard curve, and I've been attempting to match it by plugging values into a somewhat similar curve equation:



enter image description here



I know there must be a better way, but I have no idea how to solve a multiple variable equation for multiple known values which each have tolerances. Further, it has to (in my case) be computationally simple.



How can one create an simple equation to approximate a curve of known values which each have tolerances?



So far my steps are:




  1. Find a simple equation that's already fairly similar.

  2. Graph the points and equation

  3. Start messing with the increment rate of x, and any other variables and hope you get close.


But I'm certain there are much better approaches.



Edit: for anyone interested, here's where the values of y and their tolerances were derived from. It is an equation which can go from a triangle wave, to roughly a sine wave, to roughly a square wave. I think it's pretty neat!
enter image description here







approximation curves






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 14 '18 at 14:52







Seph Reed

















asked Dec 14 '18 at 14:47









Seph ReedSeph Reed

1187




1187








  • 1




    $begingroup$
    Looks kinda like an exponential. Why not try fitting an exponential in Excel and see what $R^2$ value you get? If you're feeling particularly ambitious, plot the residuals to make sure you're not missing anything.
    $endgroup$
    – Adrian Keister
    Dec 14 '18 at 14:49










  • $begingroup$
    In terms of the amount computation needed to calculate the value for any particular $x$, a cubic spline would probably be faster than exponential, logarithmic, trig, or even taking of roots. Though it would look more complicated to you since the computer is already programmed to do those "behind the scene". On the other hand, a cubic splne may give you some unwanted behavior, so it may not be the best choice.
    $endgroup$
    – Paul Sinclair
    Dec 14 '18 at 23:37










  • $begingroup$
    I actually managed to find a very suitable equation: (log((1-x)/2)/log(1-((1-x)/2))^.762207. I'll have to take some time to explain how it came about later though.
    $endgroup$
    – Seph Reed
    Dec 15 '18 at 0:50














  • 1




    $begingroup$
    Looks kinda like an exponential. Why not try fitting an exponential in Excel and see what $R^2$ value you get? If you're feeling particularly ambitious, plot the residuals to make sure you're not missing anything.
    $endgroup$
    – Adrian Keister
    Dec 14 '18 at 14:49










  • $begingroup$
    In terms of the amount computation needed to calculate the value for any particular $x$, a cubic spline would probably be faster than exponential, logarithmic, trig, or even taking of roots. Though it would look more complicated to you since the computer is already programmed to do those "behind the scene". On the other hand, a cubic splne may give you some unwanted behavior, so it may not be the best choice.
    $endgroup$
    – Paul Sinclair
    Dec 14 '18 at 23:37










  • $begingroup$
    I actually managed to find a very suitable equation: (log((1-x)/2)/log(1-((1-x)/2))^.762207. I'll have to take some time to explain how it came about later though.
    $endgroup$
    – Seph Reed
    Dec 15 '18 at 0:50








1




1




$begingroup$
Looks kinda like an exponential. Why not try fitting an exponential in Excel and see what $R^2$ value you get? If you're feeling particularly ambitious, plot the residuals to make sure you're not missing anything.
$endgroup$
– Adrian Keister
Dec 14 '18 at 14:49




$begingroup$
Looks kinda like an exponential. Why not try fitting an exponential in Excel and see what $R^2$ value you get? If you're feeling particularly ambitious, plot the residuals to make sure you're not missing anything.
$endgroup$
– Adrian Keister
Dec 14 '18 at 14:49












$begingroup$
In terms of the amount computation needed to calculate the value for any particular $x$, a cubic spline would probably be faster than exponential, logarithmic, trig, or even taking of roots. Though it would look more complicated to you since the computer is already programmed to do those "behind the scene". On the other hand, a cubic splne may give you some unwanted behavior, so it may not be the best choice.
$endgroup$
– Paul Sinclair
Dec 14 '18 at 23:37




$begingroup$
In terms of the amount computation needed to calculate the value for any particular $x$, a cubic spline would probably be faster than exponential, logarithmic, trig, or even taking of roots. Though it would look more complicated to you since the computer is already programmed to do those "behind the scene". On the other hand, a cubic splne may give you some unwanted behavior, so it may not be the best choice.
$endgroup$
– Paul Sinclair
Dec 14 '18 at 23:37












$begingroup$
I actually managed to find a very suitable equation: (log((1-x)/2)/log(1-((1-x)/2))^.762207. I'll have to take some time to explain how it came about later though.
$endgroup$
– Seph Reed
Dec 15 '18 at 0:50




$begingroup$
I actually managed to find a very suitable equation: (log((1-x)/2)/log(1-((1-x)/2))^.762207. I'll have to take some time to explain how it came about later though.
$endgroup$
– Seph Reed
Dec 15 '18 at 0:50










0






active

oldest

votes











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3039447%2fhow-does-one-go-about-creating-simple-approximations-of-curves-of-known-values%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3039447%2fhow-does-one-go-about-creating-simple-approximations-of-curves-of-known-values%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Plaza Victoria

Puebla de Zaragoza

Musa