currently we're normalizing the spectra for narrow-band signals rather than continuous ones
most of the information we're interested in is around DC but the low frequency cut-off we're using is too high
for non-periodic signals (Gaussian, sinc, etc) the Lomb-Scargle periodogram is probably not as appropriate as an FFT
Re the last point: at some point I'd like to understand the theory around the various ways of calculating spectra for signals. For present-purposes though I spent 10 minutes playing. The tests use regularly-spaced points (np.linspace) so I generated a random sampling according to x = np.sort(random.sample(list(x), int(x.size/3))). Then I looked at the spectra from both the FFT (using the mean spacing between points to generate a frequency axis) and the LS periodogram. The FFT was consistently easier to interpret and the heuristics based on it seemed to work robustly -- they got pretty much everything right so long as I could see a feature by squinting hard!
So, pending some deeper thinking on this front, let's move the heuristics over to an appropriately normalized FFT and move on. The real test will be when people start throwing lab data at this code anyway, so let's not over think things too much until we've seen how that goes!
Re the last point: at some point I'd like to understand the theory around the various ways of calculating spectra for signals. For present-purposes though I spent 10 minutes playing. The tests use regularly-spaced points (
np.linspace
) so I generated a random sampling according tox = np.sort(random.sample(list(x), int(x.size/3)))
. Then I looked at the spectra from both the FFT (using the mean spacing between points to generate a frequency axis) and the LS periodogram. The FFT was consistently easier to interpret and the heuristics based on it seemed to work robustly -- they got pretty much everything right so long as I could see a feature by squinting hard!So, pending some deeper thinking on this front, let's move the heuristics over to an appropriately normalized FFT and move on. The real test will be when people start throwing lab data at this code anyway, so let's not over think things too much until we've seen how that goes!
To fix: