Calculating data points on a graph

  • Thread starter Undernet
  • Start date
  • #1
3
0
http://www.clearandblue.com/graph.GIF [Broken]


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
 
Last edited by a moderator:

Answers and Replies

  • #2
Office_Shredder
Staff Emeritus
Science Advisor
Gold Member
3,900
174
You could just relabel the axis, and leave the actual graph alone.
 
  • #3
3
0
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.
 
  • #4
Office_Shredder
Staff Emeritus
Science Advisor
Gold Member
3,900
174
If you just multiply all the values by 8/7 it should work.
 
  • #5
3
0
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
 
  • #6
367
1
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.
 

Related Threads on Calculating data points on a graph

  • Last Post
Replies
3
Views
1K
  • Last Post
Replies
7
Views
709
Replies
4
Views
958
  • Last Post
Replies
20
Views
9K
Replies
3
Views
1K
Replies
5
Views
1K
Replies
9
Views
6K
Replies
1
Views
1K
  • Last Post
Replies
5
Views
26K
Top