I like the ECG to be saved to a text file. I have an hardware to get the ECG , i will get the values I need to plot it using applet then to show it using and save it to a text file ?
Can I get this ???
Printable View
I like the ECG to be saved to a text file. I have an hardware to get the ECG , i will get the values I need to plot it using applet then to show it using and save it to a text file ?
Can I get this ???
Look at this , Tell me if this is what you needed ?
How can i display a line graph.. just like real time
i have a same query..
i have ecg data stored in a text file, and i am plotting that data in jframe....
ecg data is as follows:
time volts
0.003 -0.145
0.006 -0.145
0.008 -0.145
...my entire data is getting plot as a straight line......even if i take a ecg signal of 60 minutes the voltage values are in decimals and are very less and they vary with time also very less...
i should be able to see the depths of d diagram.....there is where a noisy ECG signal lies...
can anyone plz help me....thanks in advance..:-)
You need to show the code that is drawing the graph
Norm,..
public void paintComponent(Graphics g)
{
super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASIN G,
RenderingHints.VALUE_ANTIALIAS_ON);
g2.translate(0, getHeight() - 100);
g2.scale(1, -1);
g2.setPaint(Color.green.darker());
int i=0;
for(; i < a2.length-1;)
{
double x1 = a1[i];
double y1 = a2[i];
double x2 = a1[i+1];
double y2 = a2[i+1];
i=i+2;
g2.draw(new Line2D.Double(x1, y1, x2, y2));
}
}
//where a1[] and a2[]are the arrays where time and voltage values are stored....
What are the values of x1, x2, y1 and y2?
How are they computed?
x-axis values are time values...and y-axis values are voltage values..as i showed previously...:
time volts
0.003 -0.145
0.006 -0.145
0.008 -0.145
and they change very slowly...i mean voltage changes very slightly over a period of time.....
i do not calculate as uch....directly plot the points..................
but norm...i think u gave me an idea!!...should i calculate the values.. imean anything like 0.1=1+0.1....so that the graph becomes visible...??..
Add a println to print out the values of x1, x2, y1, y2 so you can see what the code is trying to draw.
i had added....i saw..its all right values ...exactly whatever the file has...!...
i just removed it while showing it to u...
my question is:
it plots d graph...but as the values are very very less it gives a straight line on the output screen.....................
and i want to see orignal graph..as in make the graph more visible......
ie...as it would be in case of integer values..
You probably have to scale the data to make the graph you want to see.
What is the range of the y values? What is the vertical size of the graph you want to plot?
How many pixels per unit of data? For example what is the different in y value for .12 and .13?
the range of y values is from -0.100 to say -0.700.........whereas x values vary from 0.0 t0 60.0...
iam new to java...
i dint understand what u meant by "How many pixels per unit of data? For example what is the different in y value for .12 and .13?"
The size of the graph you are drawing is measured in pixels. My console is 1400 wide by 900 high.
If I want to plot data that is in the range of .1 to .7 then I have to scale it to my screen.
The max-min(delta) is .6. If I want to use 600 pixels vertically for the graph then I can show each .1 change in value by a 100 pixel change.
A .1 value would plot at y=600, a .7 value at y=0
heyy!!...it got plotted...i directly scaled d values..
something like this:
x1=x1*100
y1=y1*100....
yeah!!...i can c d ecg wave!!
In future, don't resurrect an old dead thread. Ask your question in a new thread -- they're free.
This is a technical forum. Please use proper words.Quote:
.i can c d ecg wave!!
db