开发者

Create X-Y plots in C

开发者 https://www.devze.com 2023-04-05 09:43 出处:网络
I\'m planning on doing a small project involving ECG signals. I am currently getting ECG signals via a COM port and recording these in a txt file using C programming.

I'm planning on doing a small project involving ECG signals. I am currently getting ECG signals via a COM port and recording these in a txt file using C programming.

My next step is to be able to plot all those data points in real-time. Can this be done using C programming? If not, I do not mind collecting a sample that is 2 minutes long and then plotting those data points.

After that, I want to be able to take the FFT of the time-domain data and be able to plot the frequency plot.

My end goal is to design a GUI using C, that shows a person the real-time EEG waveform as well as the frequency plot.

I did make another post and was advised to try:

  • RRDTool (http://oss.oetiker.ch/rrdtool/) : However, this doesn't seem to be a straightforward implementation for C.
  • OpenGL Utility Toolkit (http://www.opengl.org/resources/libraries/glut/) : This seems to be开发者_如何转开发 really powerful for generating 3D plots. However, I couldn't find helpful guides simplifying 2D plot implementations
  • KST : http://kst-plot.kde.org/ , This was the most interesting software. I've played around with it a bit and like it's simplicity. It also allows me to get FFT data. However, I'm not sure how to connect it with my end goal of having the GUI since it is a seperate program.

If someone could recommend C based implementation and some tutorials/sample code to go along with it that would be great. Additionally, advice on other alternatives to reach my end-goal would also be much appreciated !


I can suggest using SDL. It's more 2d based and easier to learn than OpenGL, written in C and quite powerful.

If you want you can first try out SDL in Python using pygame.


Qt http://qt.nokia.com/products/ has a plot widget that you could use ... and has language bindings for many languages


You might want to look at PLplot. Works with many languages, including C, on all the common desktop operating systems (Mac, Windows, Linux, Unix). There are quite a few examples, and most (if not all) examples are available in a number of different languages.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号