Detecting periodic repetitions in the data stream
- by pulegium
Let's say I have an array of zeros:
a = numpy.zeros(1000)
I then introduce some repetitive 'events':
a[range(0, 1000, 30)] = 1
Question is, how do I detect the 'signal' there? Because it's far from the ideal signal if I do the 'regular' FFT I don't get a clear indication of where my 'true' signal is:
f = abs(numpy.fft.rfft(a))
Is there a method to detect these repetitions with some degree of certainty? Especially if I have few of those mixed in, for example here:
a[range(0, 1000, 30)] = 1
a[range(0, 1000, 110)] = 1
a[range(0, 1000, 48)] = 1
I'd like to get three 'spikes' on the resulting data...