Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Default analyzer frequency mapping (Read 1896 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Default analyzer frequency mapping

Hi!

It's been a while since I've used a forum, but here goes
I'm doing some Fourier-transform digging and as a sample project, I've implemented a small spectrum analyzer that uses audio data from the underlying sound card. The design goal is to replicate (possibly with a half-buffer delay) the results of foobar2000's integrated spectrum analyzer. Everything works pretty well, however I can't figure out the function used to map the FFT frequency bins to the bars.
On a sample (20Hz-20kHz sine wave), I've noticed that my exponential function (extrapolated from the frequency bins displayed for the 10/20/40 bar display) climbs faster on the low end, but slows down near the high end

Here's a screen shot of everything in action: http://img651.imageshack.us/img651/1808/analyzer.png

Oh, yeah, and I know the peaks are way off, but from what I can observe, foobar is cheating here as well as they all seem to fall off at constant speed after a timeout (however, given the overhead of processing a second's worth of spectrum data for peak analysis, I'd say it's an acceptable approximation for display)

Anyone got a clue as to how I can replicate the results?