We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › Ess: Understanding sample frames
Page Index Toggle Pages: 1
Ess: Understanding sample frames (Read 773 times)
Ess: Understanding sample frames
Jul 30th, 2006, 7:17pm
 
I was going to e-mail this question to Krister, but figured I should post it on the board so the information can be available publicly.

---

If I've got an AudioInput with a size of, say, 512 and I use an FFT with size of 1024 (ie 512 spectrum points) to get the spectrum of the input after the buffer is filled, using audioInputData, is it only analyzing the first sample frame or is it averaging together all of the frames in the buffer?

Also, I found that audioInputData is sometimes called more than once a frame. So if I'm using a call to getSpectrum to fill spectrum[] and then use that information to set up values for drawing, aren't I, in effect, only using the last call in that frame?

---

In general, it would be super helpful if some basic DSP information was provided with the docs for Ess. Can someone tackle that? I think it'd be invaluable for the community.
Re: Ess: Understanding sample frames
Reply #1 - Aug 9th, 2006, 9:28pm
 
the larger your window (FFT size), the more meaningful the data that can be extracted (well, there's a balance, you don't want your window to be too big)-- it isn't just grabbing the frame at the beginning of the window or simply averaging the frames.

it is possible that audioInputData is called more than once per frame, depending on your framerate and the window size. this may be overkill for some visual applications, but might be useful if you need other logic running behind the scenes.

and yes, anyone want to write a primer?? (if only i had the time...)
Page Index Toggle Pages: 1