I've got 16-bit mono audio data in raw format, sampled at 48 KHz. I'm using Aquila C++ library to get the spectrum of it, since I need to perform EQ on it. Here's a code snippet:
Aquila::SampleType samples[512];
Aquila::SpectrumType spect;
std::shared_ptr<Aquila::Fft> fft;
('samples' is filled with audio)
fft = Aquila::FftFactory::getFft(512);
spect = fft->fft(samples);
So the audio data is split into 512 samples, and each piece is converted to frequency domain (FFT). I want to change the "magnitude" of e.g. 2KHz and to set the magnitude of all the frequencies beyond e.g. 10 KHz to 0 (low pass filter).
My only problem with this is that I don't know the frequency range of the spectrum generated by Aquila. I mean, I personally know that the sampling rate of the audio was 48 KHz, but Aquila FFT isn't told this value, it doesn't even need it to perform FFT. How can I determine to exactly which frequency each array entry is mapped to? E.g. spect[0] = 1 Hz, spect[10] = 126 Hz, spect[511] = 22.13 KHz etc.