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: spectrum analyzer using vdsp (Read 2666 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

spectrum analyzer using vdsp

Hi,

First, sorry for my english, I hope you'll understand my problem.
I'm working on a spectrum analyzer using the apple vdsp lib to make the fft. My fft is working on real values. It seems to work good, by that I mean that the graphical result seems to correspond to the "behaviour " of my sample. But I'm still not satisfied, because I 'd like the amplitude display (in dB) to show the correct values, otherwise the analyzer would be useless..
I've printed the output values values of my fft and the "up values" of the real parts goes up to 100 or down to -100, and the imaginary part goes the same way.. For example if I'm playing a 40Hz harmonic, I have the amplitude values around the 4th case of my tab (which si good) which are going up to 100, and the others values are between -5 and 5 (approximatly). I suppose that's because I'm not doing the scaling properly after doing the fft. My method to rescale is to divide each element by its length. I'm doing also a hanning before performing the fft.
So my question is how to use the scaling with the vdsp lib?
Hope I've exposed clearly my problem. thanks in advance for your answers.

Cyril