# machine learning on multiple signal at once

I am very new signal processing and I am asking this with the expectation that someone gives me a concrete guideline on how to approach my problem.

The problem I need to solve is that I have 2 signals (shown in green and yellow) which look like this as below in original scales

and log scale

Based on the interaction (e.g. cutting each other) of these 2 signals, few features are calculated like i.e. range where both signals are low, the range where signals are up and only a threshold difference in amplitude value but now I need some kind of Machine learning may be RNN or LSTM or 1D CNN. I have a set of pre-calculated values and corresponding signals. Now I am wondering how to apply machine learning techniques while looking at both these signals together.

• The question isn't clear to me. You want to build a "machine learning" box, the input is the green or yellow signal and what is the output? What are the purple and pink lines in the plots? Feb 13 '20 at 14:53
• Just ignore purple and pink plots. input: 2 input signals, output: maybe another 1 signal with step 4 discrete values as 0,1,2,3. Feb 13 '20 at 15:16
• So you input the green and yellow signals and want to output "maybe another 1 signal"? I really don't understand what you're trying to do. What do the signals mean? Give some context so people understand what you're doing Feb 13 '20 at 15:28
• e.g input: time-based 2 sensors values say for 1 AM-2 AM hour from a user, output: the range of times e.g where the user was doing activity 1, activity 2, activity X on 1:10-1:15, 1:15-1:30, 1:30-2:00 with a confidence value. Feb 13 '20 at 16:10
• Do you have a lot of labeled data? Feb 13 '20 at 16:14

You say you're "a beginner" so I will suggest using Keras (https://keras.io/). It is written in Python and runs on top of Tensorflow which is a neural network toolbox written by Google. Keras allows you to build a network layer-by-layer in an easy way. For example, here is an example of building a 1D CNN (https://keras.io/examples/imdb_cnn/), please note that the example contains many things that you do not need or are optional. My advice, start with a simple network and know how to identify its problems and how to fix them.

A while back, I worked on a similar problem involving inputting two time domain signals and classifying it (input: [# samples]-by-2, output: probabilities corresponding to each class). Now you will input the two time domain signals and you need to think carefully about how your output is formatted because sometimes you might have one activity, other times you might have five activities, or sometimes you might have no activity.

For example, say you input two signals ($$x_1[n], x_2[n]$$) of length 1024 and say you had activity #1 during samples 0-255, activity #2 from 256-511, and all other time is activity #0. Then you could format your output to be a signal of length 1024 (equal to length of input signals), to be: $$y[n]= \begin{cases} 1, & 0 \leq n \leq 255 \\ 2, & 256 \leq n \leq 511 \\ 0, & n \geq 512 \end{cases}$$. I bet this requires a bit of preprocessing of your dataset but this is not uncommon at all when doing these sorts of things.

• Why not RNN but 1D CNN ? Feb 13 '20 at 20:33
• RNN can be helpful in cases where you have data that has some patterns. If you were doing something with text analysis, certain words commonly follow others so that would be a place to try RNN Feb 13 '20 at 20:51
• I did what you said for preprocessing but now I am stuck how to make such CNN network which outputs another signal and takes 2 signals. A very basic example would be great. Feb 14 '20 at 23:51