Forums

sound visualization (fft, spectrum, phase, panning, etc)

Started by dial...@gmail.com August 19, 2005
Hi friends,
 This is my first post to the list. I have been developing some sound
visualization software in linux using c/c++ & openGL for quite some
time now, and I am having difficulty. So i've been trudging through
the net looking for examples to do the different items i have
mentioned below. I have made some good progress, and found a few
examples for FFT's and such. And having my own programs written from
scratch to open the card and fft the data. However, all the programs
i've written or hacked apart to see what's going on have failed to
achieve the results I am looking for.

Essentially, this is the data I need to retrieve from the dev/dsp or
other audio device:

1. Frequency Spectrum (for L/R stereo channels separately)
2. Amplitude of the individual frequencies (L/R channels, etc)
3. Panning
4. Windowing such as Blackman, etc.

and then, some other features such as phase values, and phase
differences between the frequencies on the two channels, but these are
not AS important as the other ones at this particular point.

Basically, I am looking to extract as MUCH information as 'digitally'
possible from the audio data, and build a sound visualisation program
in which seeing on the screen all of the different movements which
occur in the sound & music visually on the left and right stereo
channels and in left and right visual space. As well as percieived
pitch, on Y axis, etc.

For the record, I've poked through just about every open source sound
visualizer and spectrum analyser I could possibly find on the net in
attempts to find code that I can incorporate into my own programs.

SO! I am hoping someone out here has some example programming which
extracts (or is equipped to extract) this sort of information from
audio data and returns the information in an easy-to-access format. I
am a math newbie, but well adepth at programming.

IF It's possible, email me here: dialectical@gmail.com perhaps instead
of posting to the list on more specific matters i've mentioned, this
will insure I do not miss anything.

Thank you ahead of time,
-Brian


Oh. also, I was wondering if it was also possible (from the FFT), to
detect which kind of sound-wave is being played at the time? (such as
sine, square, triangle and whatnot)?

dialectical@gmail.com skrev:
> Hi friends, > This is my first post to the list. I have been developing some sound > visualization software in linux using c/c++ & openGL for quite some > time now, and I am having difficulty. So i've been trudging through > the net looking for examples to do the different items i have > mentioned below. I have made some good progress, and found a few > examples for FFT's and such. And having my own programs written from > scratch to open the card and fft the data. However, all the programs > i've written or hacked apart to see what's going on have failed to > achieve the results I am looking for. > > Essentially, this is the data I need to retrieve from the dev/dsp or > other audio device: > > 1. Frequency Spectrum (for L/R stereo channels separately)
This ought to be almiost trivial. Getting L/R data and computing FFTs is not difficult as such, making it happen fast might be.
> 2. Amplitude of the individual frequencies (L/R channels, etc)
This pops out trivially from the FFT-
> 3. Panning
I don't know what you mean here?
> 4. Windowing such as Blackman, etc.
This is not a property of the data. If there is a window involved, it is beacuse you applyed it. You don't estimate this from the data, you look up some tag in a function or procedure.
> and then, some other features such as phase values, and phase > differences between the frequencies on the two channels, but these are > not AS important as the other ones at this particular point.
"Phase value" is ambiguous at the best of times, and can be a nightmare to estimate. "Phase difference between channels" might be easier to deal with.
> Basically, I am looking to extract as MUCH information as 'digitally' > possible from the audio data, and build a sound visualisation program > in which seeing on the screen all of the different movements which > occur in the sound & music visually on the left and right stereo > channels and in left and right visual space. As well as percieived > pitch, on Y axis, etc.
Hmmmm..... what would the purpose be? Data analysis and interpretation? Cool screensavers when you use the web radio on the PC? These kinds of ideas can be useful for the latter, I am not so sure for the former.
> For the record, I've poked through just about every open source sound > visualizer and spectrum analyser I could possibly find on the net in > attempts to find code that I can incorporate into my own programs.
Well, I am a bit puzzled what you try to do. If you want to make a tool for some analyst who wants to learn something about the scene where the sound was recorded, I think you should proceed in small steps. If you want to make some visual-effects thing that is based on the music that is played, then this might well be the way to go. Having done some analysis of sound (although not audio) in the past, I have found it most useful to have a few general and easily understood tools, and learn how to use them well. The more arcane stuff does not get used very often anyway, so people don't learn or understand them well enough to see when the methods are on or beyound their scope of use.
> SO! I am hoping someone out here has some example programming which > extracts (or is equipped to extract) this sort of information from > audio data and returns the information in an easy-to-access format. I > am a math newbie, but well adepth at programming. > > IF It's possible, email me here: dialectical@gmail.com perhaps instead > of posting to the list on more specific matters i've mentioned, this > will insure I do not miss anything. > > Thank you ahead of time, > -Brian > > > Oh. also, I was wondering if it was also possible (from the FFT), to > detect which kind of sound-wave is being played at the time? (such as > sine, square, triangle and whatnot)?
In practice: No. There is all sorts of problems with non-ideal data recordings, noise and interfering sources. Rune
Brian, you probably should look into key words such as "real time
octave filter". I have built a few of them before. They are the
vertical moving blinking bars that you have seen in many spectral plot.

For more details send email to DigitalSignal999[at]yahoo.com