Can i get a mathematical function out of this picture?

In summary, the conversation discusses using an infra red sensor for a small project and the difficulty of finding a function that accurately represents the voltage-distance relationship. The speaker mentions using a large array of floats, but this would consume a lot of memory. They also mention the possibility of using linear interpolation and exponential decay functions. The conversation ends with a question about the need for precision and flexibility in the project.
  • #1
Bayoudh101
12
0
i am working for a small project at home , and for it i am using an infra red sensor . which returns a voltage value relative to distance .
this picture describes the output : (given by the datasheet) :

pnGRf0u.png

(the picture is highly precise)

now all of the distances that i will be getting are superior than 8cm so it's a bijective function for me . within the micro-controller , the only solution that was able to find is to make a large array of floats with segments of voltage and the corresponding distance values . i need high precision with this project so that solution would consume a massive amount of memory and would cut down from other of the project's aspects .
is there anyway i can find a function that mimic with good precision the behavior of the evolution these values ?
thank you .
 
Last edited by a moderator:
Mathematics news on Phys.org
  • #2
Picture did not seem to come through. Can you re-attach?
 
  • Like
Likes Bayoudh101
  • #3
dkotschessaa said:
Picture did not seem to come through. Can you re-attach?
done , thank you for responding sir .
 
  • #4
What does "high precision" mean? The visible corners in the graph look like measurements artifacts. If you can see deviations from a smooth curve by eye, it cannot be that precise.

You can store some values and then make linear interpolations between them.

You can try exponential decays, 1/x, 1/x2 functions and so on, but they won't beat the accuracy of linear interpolations - if you measurements are all really accurate.
 
  • Like
Likes Bayoudh101
  • #5
thank you sir .
 
  • #6
Make a linear interpolation table of the graph. Where things are relatively flat (ie same slope) you can space the x,y points further apart and where things change you can select more x,y points.

Some examples are provided in the article:

https://en.wikipedia.org/wiki/Interpolation
 
  • #7
Bayoudh101 said:
i need high precision with this project

Do you also need flexibility? For example, will the actual curve on the device change as the component ages? Will you need to calibrate the system if you use a new type of paper?
 
  • #8
The curve looks like [itex]xe^{-x} [/itex]...
 
  • #9
Use electronics to linearise the sensor response .
 
Last edited:

FAQ: Can i get a mathematical function out of this picture?

Can a mathematical function be obtained from any picture?

No, not all pictures can be described by a mathematical function. Some images may be too complex or abstract to be represented by a function.

How do you determine if a picture can be described by a mathematical function?

To determine if a picture can be described by a mathematical function, the image must have a clear and consistent pattern or structure that can be represented by a set of mathematical equations.

What are the benefits of obtaining a mathematical function from a picture?

Obtaining a mathematical function from a picture can allow for better understanding and analysis of the image. It can also be useful for creating computer algorithms to manipulate or recreate the image.

What methods are used to obtain a mathematical function from a picture?

There are various methods that can be used, such as Fourier transforms, curve fitting, and machine learning algorithms. The method used will depend on the complexity and type of image.

Can a mathematical function accurately represent all aspects of a picture?

No, a mathematical function may not be able to accurately represent all aspects of a picture. Some features of an image, such as color and texture, may be difficult to capture with a function and may require additional techniques or algorithms.

Back
Top