Recognizing signal template in time series data

Hi, I have a few question.
Screenshot%20from%202018-09-21%2009-53-44
To explain in a simple way I upload the image. The red line is the raw data with a lot of noise, the black is a template created using some formula. My purpose is to have an HTM network capable to identify the black signal by receiving the red one. In this case the interval was chosen to overlap the two signals but usually this is not known before.
If I teach to an HTM the black signal, is than able to notice the black pattern by having in input the red one? So it’s able to find the signal without knowing when it will start?
To classify the black signal I though to use the temporal memory and use as input of the SDR Classifier the output from the HTM after the end of the signal, is it right?

Do you have to use HTM? Why can’t you just calculate the RMSE between the red and black lines and return true if it’s above a threshold?

What about cross correlation? From a quick check this seems like the usual way to do it https://en.wikipedia.org/wiki/Cross-correlation

Hi Jonathan_Mackenzie, thank you for the answer. Probably RMSE it’s the best solution but I’m studying on HTM for my thesis and I want to add in the thesis an implementation of HTM so I thought to apply it on this dataset.

Well I mean you could train HTM a lot of times on the target sequence, then turn learning off. Then feed it your normal data, you should get high anomaly likelihood when you aren’t seeing the target and low anomaly likelihood when you are inputting the target. I don’t feel like this is going to outperform cross correlation though, but you can still try.

Ok, I’ll try it.
About the second question:

To classify the black signal I though to use the temporal memory and use as input of the SDR Classifier the output from the HTM after the end of the signal, is it right?

It’s correct? Actually the data can contain difference target sequence so the network will be more useful if it’s able to seeing the the target and also to classify it.

I don’t think you’re going to be able to identify multiple target sequences given my method. Nupic likes when things are nicely ordered and likes to know and predict what’s coming next. While it can do branching and learn multiple sequences, your anomaly score might reflect differently, ie. it might take a few times of seeing a 2nd target sequence (after learning them) to predict what’s next. I recommend watching the temporal memory videos on HTM school, they explain this quite well.

Anyway, there’s no harm in trying and seeing what your results are.