Spectrogram plotting

Tom its1louder at yahoo.com
Wed Oct 9 03:32:32 CEST 2002

Fernando Pérez <fperez528 at yahoo.com> wrote in message news:<anuk8f$kp$1 at peabody.colorado.edu>...
> seh wrote:
> > I would like to sample some data from the soundcard into a vector.
> > Then process the data ex. take an FFT. Then plot the data intensity
> > modulated vertically on the screen. Then sample some new data, process
> > and plot them near to the previous data and so on.
> > 
> > Anybody has some code to do this? Peferably in Tkinter but wxPython is
> > also of interest.
> > 
> > Svein-Erik
> http://scipy.org has all the pieces you need. You can also just use 
> Numeric+Gnuplot, but the gnuplot interface is a bit clunky.
> Cheers,
> f.

thought I replied to this already, but maybe I didn't.  Please excuse
if this is redundant. . .

I have written an app that is a file viewer for my FTIR spectrometer.
It uses COM libraries to read the *.spc binary files so it is
restricted to win32 only.  Then I use the Numeric FFT module to get an
fft of the interferogram.  finally, I plot the resulting spectrum with
an activex plotting control from National instruments.  This is the
same com object/activex control that they mean for you to use in
Visual basic from their component works product.  It works beautifully
with the latest wxPython makeactivexclass() function.  That is version
2.3.3 I think.  In the last wxPython version, there were bugs and it
would crash if you tried to instatiate cursor objects in the plot
control and then redraw.  Now it works great.

This seems to be what you want to do:  Get data from an instrument,
FFT it, plot it in the gui.

The drawbacks are that you must use win32, wxpython, and the NI
plotting control.  I'm sure other, cheaper activex plot controls would
work too.

Why did I go with the activex control?  I was already committed to
using win32 because the library I have for reading *.spc files is a
COM dll.  And I'd already spent the money on fancy National
Instruments developer suite back before I discovered python and
Labview was my quick and dirty app builder for instrumentation.  Scipy
is good but clunky and seemingly will be obsoleted by Chaco.  Chaco
doesn't exist yet.  Disipyl (dislin) is good stuff and I would have
used that instead if I didn't already have the activex control.  The
AX control is super easy once you learn the nuances of the
wxwindows-activex control aproach, which are few but not so well
documented.  And It is cool to have interactive cursors and
annotations in your plots, which the NI com lib does all the heavy
lifting to achieve.

More information about the Python-list mailing list