I have a sound signal, sampled at 48000 hz. Now I want to know 'how much sound' there is of a specific frequency (or near that frequency) at a specific time. For example, I want to know at 10s how much sound there is near the frequencies $20 \cdot 2^{k/3}$ hz with $k=0,1, \dots, 30$.
I'm trying to find a connection between a sound someone is hearing and an fMRI scan of his brain while he is listening to that sound. This website says that sounds with different frequencies are processed in different areas of the brain, that's why I need to know this.
When doing a bit of research I quickly arrived at short-time Fourier transform (STFT). I don't need an inversible transform, but I can use some of the principles. Let's assume that the signal is continuous. If I understand it right, then I can use the formula $$ y(t, f) = \left| \int_{-\infty}^{\infty} x(\tau)\ w(\tau-t)\ e^{-2 \pi i f \tau} \ \mathrm{d}\tau \right|, $$ where $x(t)$ is the signal and $w(t)$ a window function. I read a Gaussian window function is common: $$ w(t) = e^{-\frac12 (t/\sigma)^2}, \quad \sigma > 0 $$ Should I use this window function or some other window function? If I should use this one, what value should $\sigma$ have, should it be fixed or dependent on $f$? It seems intuitive to me that the width of the window should be proportional to $1/f$, but no one seems to be doing this. Can anyone tell why? Is the first formula the way to go or is there a better way to do what I want?
I'm also thinking whether I want 'near a frequency' at all, maybe I want 'between two frequencies' instead, or maybe something else. I understand you cannot guess what I want exactly, but I hope someone has some ideas anyway.