Waveform Widget

Motivation

In a number of projects I've found the need to have a capable waveform viewing widget for the purpose of viewing time series. Usually I just used GNUPlot, but, while GNUPlot is great for ploting functions and making postscript files, etc, I'd like to have a ``live'' widget, one that allows the plot to be updated in real time, and to be explored (ie, zoom in, zoom out, move left, move right, etc). One example application is in seismology, when we want to be able to display a seismic waveform, zoom in on points of interest, add markers to indicate wavefront arrivals, and be able to watch the data come in in real time.

Implementation

I cooked up this simple C program (using OpenGL and glut for graphics) that performs many of the above functions. Namely:

The code is ugly, and there's a lot to be done, but it's a good prototype.

Screenshot

[Screenshot of the Waveform Viewer (screenshot.png, 8.5 kB)]

Screenshot captured with The Gimp, of course. The waveform is from the Indian Mountain seismic array (IM01) in Alaska.

Distribution

Future modifications

I'd like to package this up as some kind of widget, for instance a Gtk+ object, or maybe some kind of Tk widget. I don't know whether it's better to use OpenGL (eg, via glut or GtkGLArea), or to use straight X drawing functions (eg, via Xlib or GDK) -- if anyone has any comments I'd love to hear them. Also, is there a more efficient way to do the display dragging than redrawing every time the mouse moves?

Copyright © June 2001 by Tobin Fricke (www) (email)