Displaying floating point data in ACL Common Graphics
- From: Cortez <relativeflux@xxxxxxxxxxxxx>
- Date: Thu, 7 Aug 2008 12:53:34 -0700 (PDT)
Hello,
I am designing a graphical application in ACL for displaying spectral
analysis data (for a related post see
http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/5d1ded8824bc750b/46a585e0fb7a439b?lnk=gst&q=sdif#46a585e0fb7a439b).
The data itself consists of (either) single- or double-floats, which,
since drawing in ACL is pixel-based, I am forced to round to integers.
I would like to find some way of avoiding this - I expect to have to
round my values to some extent, but using pure integers for display
compromises the integrity of the data too much.
I have been assuming some kind of upwards scaling would be effective.
The kind of numbers I am dealing with typically represent non-integer
frequency values, for example 453.687564Hz. If I want a y-axis value
which represents this number rounded to three decimal places then I
would simply do -
(round (* 453.687564 1000))
=> 453688
and pass this to the appropriate drawing functions. The value is also
displayed in the status bar of the window as the mouse moves over that
point, but divided by 1000 in order to yield 435.688. I am happy with
this degree of accuracy, but since I could be dealing with numbers
representing frequencies up to 20000Hz it means that I have to work
with a massive drawing canvas. I have experimented with ACL's scaling-
stream mixin, which I mix with my base window class and which allows
me to greatly increase the number of points per pixel. Even with that,
however, I still have memory issues (I am sub-classing my base class
from bitmap-window, which is admittedly memory-intensive since it uses
a backing store, but anything else gives me unsatisfactory redisplay).
Is there anything else I could try? I have also experimented with
McClim, which uses continuous coordinates, but would prefer to stay
with ACL if possible.
Many thanks,
Cortez
.
- Follow-Ups:
- Re: Displaying floating point data in ACL Common Graphics
- From: Thomas A. Russ
- Re: Displaying floating point data in ACL Common Graphics
- From: Kenny
- Re: Displaying floating point data in ACL Common Graphics
- Prev by Date: Re: fringe definition
- Next by Date: I say we exterminate all the redhaired people using small type on web pages
- Previous by thread: Re: Collecting like-labelled sublists of a list
- Next by thread: Re: Displaying floating point data in ACL Common Graphics
- Index(es):
Relevant Pages
|