Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Calculating data points on a graph

  1. Oct 16, 2006 #1
    [​IMG]


    I have a graph shown above however I want to adjust the height of the graph (where it reaches -70 @ 20ms) whilst still preserving the general shape of the graph. The problem is that I need to know the values of the data points at every 1ms interval (each square represents 20ms).

    Does anybody have any idea of how I would calculate the values? For example if I decided that the peak would be at -80 instead of -70 @ 20ms then it would change all the other data points, but how do I calculate what the new values of the data points for each millisecond?

    Is there some equation or graph program that can do this?

    I hope I am making sense here, my math skills are pathetic.

    Thanks
     
  2. jcsd
  3. Oct 16, 2006 #2

    Office_Shredder

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    You could just relabel the axis, and leave the actual graph alone.
     
  4. Oct 16, 2006 #3
    Yea normally you could do that but this graph is being represented in a computer program, the picture is just for illustration. The graph in the computer is stored in an array with 140 slots; each slot representing 1ms which would hold one of the data point values.
     
  5. Oct 16, 2006 #4

    Office_Shredder

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    If you just multiply all the values by 8/7 it should work.
     
  6. Oct 19, 2006 #5
    Quote>"If you just multiply all the values by 8/7 it should work."

    Yes that could work but thats for one specific peak.

    I need a way of simply giving my program the value of the desired peak of the graph and the program should go and generate all the data values for each ms, that would, if mapped onto a visible graph draw a graph that is the same shape as my example graph but with the peak at the specified value.

    I also need to do the same sort of thing with the time too, by specifying the length of the graph to the program and the program should generate the data points that would, if mapped onto a visible graph, draw a graph that has the same shape as my example but with the length being at the specified time. On my example, the graph ends at 140ms but I would like to give the program a value and it should extend the graph to the desired value whilst still preserving the general shape of the graph.

    I looked into using something called alpha functions, by having one function for the raise from the base to the peak and another from the fall from the peak to the base. However I don’t know how to modify the functions so it draws a graph that reaches the desired peak and time scale automatically just by giving the desired peak and duration. I have to create a whole new alpha function for each desired peak and duration at the moment which is not practical since the peak could be in the range of 100 different values, the same goes for duration too.

    Thanks
     
  7. Oct 19, 2006 #6
    Well, can this program find the maximum value out of a finite set of values (like Max(1, 4, 2, 7, 4, 2) = 7)? If so, then just find the max, and multiply each point by desiredvalue/max.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Calculating data points on a graph
Loading...