Wednesday, June 12, 2019

How to get Instantaneous Magnitude for a Instantaneous Frequency From FFT?


My understanding if a frequency in my signal doesn't line up exactly with a bin, it is smeared over a few bins to the right and left.


How can the instantaneous magnitude be determined? (do I have to worry about the windowing function?)



Answer




Frist of all you need compute the Magnitude:


windowed = framed .* hann(length(framed))
Fourier = fft(windowed)
Mag = abs(Fourier)

And you need build a Window Kernel based in your Window Function!


For a Hann Window the kernel can be:




   Wk(k) = 0.5 * (sinc(k*(M/N)) / (1 - (k*(M/N))^2))




M=Window Size 
N=FFT Size

Of course you can use the same size for both, N and M !


k = Bin Number from FFT / N
sinc = Normalized Sinc, visit http://en.wikipedia.org/wiki/Sinc_function

If you have already determined the Instantaneous Frequency, you need find the corresponding offsets for each Frequency and the Instantaneous Magnitude is found when you multiply the magnitude from FFT by your Hann Window Kernel index:


 Offset = abs(InstFreqs(i) / (Fs/N) - i)

index = floor(abs(Offset) * N) + 1
InstMag = Mag(i) * Wk(index)

No comments:

Post a Comment

digital communications - Understanding the Matched Filter

I have a question about matched filtering. Does the matched filter maximise the SNR at the moment of decision only? As far as I understand, ...