# Identify random repetitive patterns

Forgive me if it’s too basic, I finish engineering a while ago. Given any time series, not periodic, I would like to find any repetitive pattern that is distinct (by some given measurement) and is unknown.

For example given this : I would like to find number 1 and 2( get their index on time).

1. Is FFT going to help anyway?
2. Without knowing or hard programming an algorithm, is it possible or do I need a serious machine learning?

(Are there practical books about finding patterns with code and not too much math?) Thanks.

• You say the waveform is not periodic but the pattern repeats-- does the pattern repeat periodically or at random time intervals? If the pattern is known to repeat at a fixed rate, the FFT is a great choice as the repetition rate will show up as distinct frequencies and integer multiples of that. If the pattern doesn't repeat at a fixed rate, and autocorrelation funciton will show the presence of duplicate patterns and their relative time delays. – Dan Boschen Oct 18 '18 at 11:29
• It’s not periodic, so to find patterns that happens more than once I should use auto correlation? Can you direct me how? How do you even set it’s sensitivity? Because there are many not important noises that happens multiple times.. – Curnelious Oct 18 '18 at 13:53
• Well if you know the pattern then you can use that specifically as one waveform, and then use cross-correlation with the other waveform (yes they will be different lengths in this case, which is fine). Do you know Matlab or Python? Also what is the source of the waveforms you are looking for? – Dan Boschen Oct 18 '18 at 14:15
• this is time series motif discovery cs.ucr.edu/~eamonn/MatrixProfile.html – Eamonn Keogh Jul 13 at 5:35

Finding repeating but not periodically repeating patterns of an unknown template which you expect the algorithm to identify is a hard problem. Nature typically doesn't shut off all the other patterns that may be present for our convienance either.

Signals have sources or generating mechanisms. It would help if you had some idea how your patterns are generated.

The concept of noise can be helpful because what isn't noise might very well be signal.

I would approach a problem as a time series that corresponds to an ODE and try to learn the ODE.

One way to do this would be to construct a phase space representation, that is something like $$x(t)$$ and $$y(t)=dx(t)/dt$$. If the noise is low using central differences can give a good approximation to the derivative of your time series. A phase space plot might identify orbits and limit cycles produced by your pattern.

These ideas are common in chaos theory and I would search Google accordingly

By using FT we loose the time information. Thus, FT doesn't tell you anything about index or time. Try to use wavelet analysis.

• But I can FT, filter it out, go back to time, find the filtered point? Or is it stupid? – Curnelious Oct 18 '18 at 10:15
• Actually, it should work :) – Slawomir Orlowski Oct 18 '18 at 11:01