2

I'm trying to modify this example: https://svn.enthought.com/enthought/browser/Chaco/trunk/examples/advanced/spectrum.py. Unfortunately I have not been able to get it to scale. If I double the sampling rate, the graph lags from the sound input. I'd like to find out which part of the code is the bottleneck. I tried to use cProfile but didn't investigate very far.

Gus
  • 4,375
  • 5
  • 31
  • 50

1 Answers1

2

I wrote the original version of spectrum.py, and I believe that the bottleneck is in the drawing, in particular the spectrogram plot. If you change the code to not draw every time it computes an FFT, it should keep up better.

Dave Kammeyer
  • 369
  • 2
  • 8
  • Great to hear from the original author. I tried plotting, say, only every 100ms, and set the timer interval to 20ms corresponding to 1024 block samples at 48000 samples/sec and I still get the same symptom. http://pastie.org/1700479 – Gus Mar 22 '11 at 17:31