[comp.windows.news] fast display of wave-forms?

richard@uhccux.uhcc.hawaii.edu (Richard Foulk) (02/04/89)

Is there a really fast way of displaying something like wave-forms with
NeWS?

We need to display records that are about 1k points each.  The various
tests I've run seem to show NeWS as quite a bit slower at the task than
various approaches within Sunview.

Basically I coded some traces up in Postscript and sent them along with
a simple window wrapper to psh.  It was mostly a bunch of lineto's.

Is there a faster way?  Is there a way to send binary data?
 
I need to be able to display and perhaps move and scale these traces
quickly.  I'd much rather use NeWS if possible ...

Thanks.


Richard Foulk		richard@uhccux.uhcc.hawaii.edu

montnaro@sprite.steinmetz.ge.com (Skip Montanaro) (02/06/89)

In article <3202@uhccux.uhcc.hawaii.edu> richard@uhccux.uhcc.hawaii.edu 
(Richard Foulk) writes:

   Is there a really fast way of displaying something like wave-forms with
   NeWS?

   We need to display records that are about 1k points each.  The various
   tests I've run seem to show NeWS as quite a bit slower at the task than
   various approaches within Sunview.

I've done a little plotting in NeWS and discovered a couple things. Others
here at GE CRD (and elsewhere I imagine) have discovered them as well, so I
doubt they'll be earth-shattering to many readers of this group.

1. As you mentioned, NeWS is slow relative to SunView. Using C & cps yields
some compression using NeWS' binary encoding, but you're compressing each
number individually. Unfortunately, cps does not provide a way to send
arrays of data. If it did, some more opportunities for compression might
turn up.

3. If you can use a PostScript function to generate some of the data, it may
help. For instance, in the simple case of X-Y plots, if X runs from 0 to
1000 by 1's, you would be better off sending a short PostScript function to
generate the X's. If you can send a function to compute Y as well, you've
saved even more of the precious bandwidth.

4. Data decimation helps. If you are plotting 1000 pairs of points but only
have a 100 pixel wide window to display it in, ten pairs of points will be
plotted in each column of pixels in the X direction. Compute minY and maxY
for each group of ten points, then send (minX, minY) and (maxX, maxY) to
NeWS as the next two points to plot. You get a short little vertical line,
but when looking at a lot of data in a smallish window it looks about like
what you'd see anyway. As you zoom in on the data and cross the point where
there are two points per pixel along the X axis, switch back to normal
plotting to preserve accuracy. Data decimation wins big in both data
transfer (fewer bits on the wire) and cpu time (fewer redundant dots on the
screen).

--
Skip Montanaro (montanaro@sprite.steinmetz.ge.com, montanaro@ge-crd.arpa)