6

I'd like to build a an audio visualizer display using led strips to be used at parties. Building the display and programming the rendering engine is fairly straightforward, but I don't have any experience in signal processing, aside from rendering PCM samples.

The primary feature I'd like to implement would be animation driven by audible frequency. To keep things super simple and get the hang of it, I'd like to start by simply rendering a color according to audible frequency of the input signal (e.g. the highest audible frequency would be rendered as white).

I understand that reading input samples as PCM gives me the amplitude of air pressure (intensity) with respect to time and that using a Fourier transform outputs the signal as intensity with respect to frequency. But from there I'm lost as to how to resolve the actual frequency.

Would the numeric frequency need to be resolved as the inverse transform of the of the Fourier transform (e.g. the intensity is the argument and the frequency is the result)?

I understand there are different types of Fourier transforms that are suitable for different purposes. Which is useful for such an application?

Joey Carson
  • 2,973
  • 7
  • 36
  • 60

2 Answers2

1

You can transform the samples from time domain to frequency domain using DFT or FFT. It outputs frequencies and their intensities. Actually you get a set of frequencies not just one. Based on that LED strips can be lit. See DFT spectrum tracer

rmi
  • 532
  • 4
  • 15
  • 2
    Thanks for your answer. Yes I realize the resulting function of the FFT has frequency domain and intensity range. What I'm confused about is what that means to resolving the frequency that I want to associate a color to. For instance, if an FFT is taken for a subset of audio data (maybe 1 millisecond), how is the frequency realized from that FFT? What I mean is, given this FFT, how is that audible frequency realized for that slice of time? My assumption is that I would have to maybe take average of all frequencies of that time slice. – Joey Carson May 08 '14 at 14:55
  • 1
    You can take the frequency with highest intensity for the moment. Weighted average is also make sense. Can you explain the final output of your 'audio visualizer display' you wish to get? – rmi May 08 '14 at 15:16
  • 1
    Sure. In general I'd like to drive different animations by different properties, similar to winamp or any PC visualizer. There's a standard animation that runs and is manipulated (view transforms are offset) according to properties of the audio (usually frequency I believe). So to keep things simple and get the hang of the algorithms necessary, I want to essentially sample an audio input regular intervals, resolve the frequency along each interval, and output a color according to that frequency. – Joey Carson May 08 '14 at 16:57
  • For testing, in each sample draw concentric circles per frequency whose radius is the intensity and the color is frequency a.k.a polar graphic analyzer! – rmi May 08 '14 at 17:33
  • I like it! Sounds like a fun and interesting test approach. I'll keep this in mind. Thanks very much for the wisdom and engagement. Your answer is accepted. – Joey Carson May 08 '14 at 20:35
0

"The frequency", as in a single numeric audio frequency spectrum value, does not exist for almost all sounds. That's why an FFT gives you all N/2 frequency bins of the full audio spectrum, up to half the sample rate, with a resolution determined by the length of the FFT.

hotpaw2
  • 70,107
  • 14
  • 90
  • 153