Hacker News new | ask | show | jobs
by agoetz 3931 days ago
If you try to estimate power spectral density using the intuitive unbiased estimator (the DFT), you are going to have a bad time. A vanilla periodogram has very high sideband leakage, which means that the energy of the signal at a single frequency will look as if it "smeared out" across neighboring frequencies. The standard solution to this is to use the so-called 'modified periodogram' where the implicit rectangular window is replaced by a different windowing function with lower sideband leakage. In general, there is a direct tradeoff between sideband power and center frequency power, and in this application, you would do well to use a different window, such as the blackman-harris, or hamming window. See [1] for more details.

In addition even the modified periodogram discussed above has asymptotically nonzero variance [2], which means no matter how many samples you take, you will still have 'noise' in your PSD estimate. If you use biased estimators of the periodogram, such as the welch-bartlett method or the blackman-tukey algorithm, you will get much better results.

[1] http://www.ni.com/white-paper/4844/en/

[2] http://www.mathworks.com/help/signal/ug/nonparametric-method...

2 comments

In theory, everything you write is correct.

In practice, none of it matter in this case. The leakage of rectangular window is ~30dB at a distance of 30 bins, and they aggregate more than 30 adjacent bins together ("re-bin"), making the leakage no more than 1 bin. To make things worse, the dynamic range of their receiver barely scrapes 40dB (peak) or 30dB (SFDR/SINR) - rendering the use of a more sophisticated window a moot point.

Thank you for this! We'll do some more research and look into modifying spectrum_sense.

edit: After inspecting the code, spectrum_sense is indeed applying a blackman-harris window before the DFT.