need help with DSP

From: Michal Wallace (sabren_at_manifestation.com)
Date: 2002-06-15 13:55:13


Hey all,

Well, I've got some code that generates some fake data and
runs the FFT on it to produce a spectogram, but I need some
help.

The good news is that even with the FFT it still runs quite
quickly. The bad news is that it doesn't show what it ought
to be showing.

What I tried to do was create 10 seconds of fake data,
simulating "pure" brainwaves (such as a steady 6Hz for
theta), as well as some contrived mixtures. Then, I
ran an FFT on them to get the spectrogram.

The output bears some resemblance to what I wanted, but
it's grossly distorted, and I'm not sure what's wrong.

I think the code *MIGHT* be working fine except that it's
using the wrong scale for the "bins", because it looks like
it might be right, except it's all squished into the top
bars and there seems to be a lot of noise. The code is
short, so the bugs can't be in too many places... :)

Can someone take a look? The new code is here:

http://cvs.sabren.com/sixthdev/cvsweb.cgi/openeeg/proto.py?rev=1.2

I used this article on analyzing sound files with
python as my gude, so it might help:

http://www.onlamp.com/pub/a/python/2001/01/31/numerically.html

The dislin package uses for plotting is free, cross-platform
and very quick, btw... Maybe it's possible to use it for an
oscilliscope display? Or even a better spectrogram. By default,
though, it pops up its own window. Maybe there's some way to
just generate the graph to a sprite and blit it onto the screen
ourselves as we animate?

Anyway, if someone with DSP skill can help me figure out
what's wrong with my code, that would really be great!
[Even if you don't know python, the code should be pretty
straightforward]

Thanks,

- Michal http://www.sabren.net/ sabren_at_manifestation.com
------------------------------------------------------------
Switch to Cornerhost! http://www.cornerhost.com/
High Powered Hosting - With a Human Touch. :)
------------------------------------------------------------



This archive was generated by hypermail 2.1.4 : 2002-07-27 12:28:43 BST