I am not a "proper" DSP guy at all, so apologies in advance if I am making any basic errors in this question. I would really appreciate it if you could point out any errors I make.
I have an audio signal sampled at (say) 44100 Hz. I want to get a spectrogram from this signal and display it. For this question, I will be using the formula as displayed in https://ccrma.stanford.edu/~jos/mdft/DFT_Definition.html .
My approach is as follows:
- Take (say) 1024 of the frames at a time (which I will denote by $x$), and run an FFT routine over them, probably after applying a Hann window.
- This will give me the frequency domain representation of the input window. I will denote the output of the FFT routine by $X$.
$X$ will effectively contain 512 values, with the value at index $n$ being the Fourier coefficient of the frequency $n * 22050 / 512$ Hz. Thus, say, the 300th sample of $X$ will correspond to the frequency 12919.92 Hz. (Is this understanding correct?)
Now my actual problem: I am not really interested in frequencies above 5000 Hz since my input will be human voice. Instead of $X$ covering a frequency range of 22050 Hz, I would like to "zoom in" so that it covers a range of only 5000 Hz. I.e., I want a finer grained spectral decomposition till a lower frequency of 5000 Hz. My question: how do I do this?
An approach I can think of: currently my sampling rate is 44100 Hz. If I can "reduce" the sampling rate to 11025 Hz, then the normal FFT approach will work and the output of the FFT routine will cover only frequencies till approximately 5000 Hz. I can accomplish this by either,
- Averaging every 4 frames of my original input.
- Taking only every 4th frame of my original input.
- Taking the max of every 4 frames of my original input.
Will any of the above 3 approaches work? Is there any other way of getting a finer grained spectrum?
Edit: it struck me later that I could achieve the result by using a larger "bin" . I.e., 8192 frames instead of 1024 frames as input to my FFT routine. Is this the best approach available?