First off let me explain that I understand that frequency makes no sense for a single sample. What I am actually talking about is the power spectrum within a short time window around a specific sample.
I have a time varying discrete signal: $\ s(t_i), i=0...199 $ with sampling dt = 10 ms.
I want to find the power of a specific frequency: 15 Hz at time sample j = 100.
This is how I would solve this:
I understand that I must extract a subset of the signal in a window around j = 100 and multiply it with a window function to avoid "ringing".
I therefore extract the subset j=93..107 and multiply it with a -/+ 2 standard deviations gaussian kernel.
Any advice on the size of the window?
Next I zero-pad the subset to 512 samples in order to achieve some "spectral interpolation" and take the FFT.
Finally I locate the complex number corresponding to f=15 Hz and take the absolute value.
Actually I would repeat this procedure for j = 7...192 to find the power of f=15 Hz at each sample.
However reading about the Short Time Fourier Transform got me confused:
they seem to break the data to be transformed into overlapping chunks, window the data within each chunk, take the FFT and then somehow adding the results together!?
Is this just a matter of performance? As a first solution I would prefer a simple but slow approach (such as mine).