FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Topics & Contributions
   Sound
(Moderators: pitaru, REAS)
   About the spectrum analyzer (Sonia library)
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: About the spectrum analyzer (Sonia library)  (Read 1624 times)
eggert


About the spectrum analyzer (Sonia library)
« on: Nov 29th, 2004, 10:27am »

I was wondering if anyone knows what format the values the spectrum analyzer (in the Sonia library) returns.
I am trying to control a sprite on the y-axis with the pitch of a voice.  It appears that the values I am getting are not in Hz.
 
I would like to know the Hz because I need to try to cut of the lower and higher frequencies.
 
Eggert
 
toxi

WWW
Re: About the spectrum analyzer (Sonia library)
« Reply #1 on: Dec 3rd, 2004, 11:28pm »

hi, i've got the basic FFT utilities and some finite response filter code used by Sonia over here:
 
http://www.toxi.co.uk/p5/fftDebug/
 
it's all fairly commented and was purely done for testing/debugging the functions. it doesn't use any sound input, but instead synthesizes a signal consisting of 4 sine waves of various frequencies to be used as source for the FFT. you can control their pitch and amplitude by moving the mouse: horizontal direction controls the pitch, vertical maps to the amplitude of the signal.
 
the current setup also makes use of a low pass FIR filter at 18.6kHz. you can see it in action by moving the mouse to the right and watch the highest pitched oscillator disappearing from the spectrum. the filter class also supports high and band pass filter types. there're also functions to control the windowing function and equalizer settings.
 
btw. the values of the array returned by the FFT function are the measured energies for each frequency band at that time window. the number of bands and their "width" used depends on your Sonia settings at startup. the demo is using 1024 bands, so with a sampling freq. of 44.1kHz each band relates to approx. 21Hz...
 
does this help?
 
(note to casey: can this thread maybe be moved to the Sound folder?)
 

http://toxi.co.uk/
Pages: 1 

« Previous topic | Next topic »