Detecting periodic repetitions in the data stream

Posted by pulegium on Stack Overflow See other posts from Stack Overflow or by pulegium
Published on 2010-04-08T09:44:58Z Indexed on 2010/04/08 11:53 UTC
Read the original article Hit count: 248

Filed under:
|
|

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...

© Stack Overflow or respective owner

Related posts about math

Related posts about fft