I am a C++/C# programmer and not a good mathematician so FFT is like some black box to me.

I would like to get a plottable AFR (amplitude-frequency response) data, like the software like Rightmark Audio does:

http://www.ixbt.com/proaudio/behringer/3031a/fr-hf.pngNow I have already programmed a system which plays back a logarithmic swept sine (with short fade-in/fade-out to avoid sharp transitions) and records the response from the audio system. The response is a bit noisy (recorded in a pretty usual room with a simple electret microphone) and I record the entire response with some reserve on both ends of the swept sine.

I have converted the input data to float samples in range [-1...1].

Now the hardest part - feeding the recorded data into FFT and getting back the frequencies.

As far as I understand, I need to pad the input with zeros to 2^n, use audio samples as a real part of a complex numbers, set imaginary=0, and FFT will return frequency bins array whith half length of input data.

The problem is - I need about 512 frequency bins, there is no need for more. But my recorded audio buffer with zero padding to 2^n takes 65536 samples, so I'll get 32768 frequency bins! This seems to be an overkill.

What is the right way to feed chunks of my recorded swept sine and get back 512 frequency points which take into account all the data I passed in?

Or maybe it is not possible and I need to feed the FFT with entire 65536 at once to get back all the AFR data I need and then interpolate to 512 points?

Also what would be the right way to smooth the data and when to do it? As I understand, FFT does not like sharp amplitude changes. Now my recorded audio has some background noise and there surely will be a sharp transition between the last samples of noisy audio and the start of my padding zeroes. How should I smooth that to avoid splatter and to make my resulting look as smooth as the image in the link I have given?

For now I have found only C++/C# code examples which process data in very small chunks for realtme audio visualization. But I would like to see an example how to take some free FFT library (I guess I'll use Ooura FFT, it is C and has C# port), feed the swept sine recording and get back some nice amplitude-frequency response.

Thanks in advance for any ideas.