Hacker News new | ask | show | jobs
by phkx 55 days ago
Jake VanderPlas also has an article on Understanding the Lomb-Scargle Periodogram [1] which I can recommend if you want to get into the details (it also includes a treatment of fourier-pairs + convolution to explain the 'artifacts' in DFT). There's a module for it in scipy, so it should be rather straightforward to try your analysis using timestamps for x and an array of ones for y. That algorithm is essentially a least-squares fit with sinusoids at pre-selected frequencies.

I've tried to use Lomb-Scargle to reduce the number of sampling points in magnetic resonance experiments, but had another dimension to take into account (similar to doing the analysis for each network port separately in your case). I got some spikes on some of the 'ports' which I couldn't reason about or reproduce when I did the same with periodic sampling and FFT. But the individual periodograms looked reasonable, if I remember correctly. Maybe we have a more regular user of LS around, who can point out common pitfalls. Otherwise you could generate some data from known frequencies to see what kind of artifacts you get.

You could maybe also take a look at the auto-correlation of the packet timestamps to see whether you can extract timescales on which patterns arise.

[1]: https://iopscience.iop.org/article/10.3847/1538-4365/aab766

1 comments

> Understanding the Lomb-Scargle Periodogram [1]

Thank you, this points me at a solution to a different problem I have.