I want to classify 8 noisy signals with trainNetwork() function that is available in Matlab. All Matlab examples were for image classification. The arguments are the data and its label, the CNN layers, in which the first layer is imageInputLayer([32 32 3]). My question is can this function be used to classify 1-D signals? if yes, how can we create such a layer?
A CNN usually requires a lot of data. And of course even more data if you have a very large feature set. And even more data if you have many output classes. The number of output classes makes the necessary amount of data samples to increase exponentially.
The most important part of any machine learning project is to extract the most telling features from your raw data. Ask yourself in your signal what are the telltale signs that should tell your model what class the signal was drawn from.
You should try to use some feature extraction techniques, then you should try to use a model better suited for the size of your dataset.
Data pre-processing and feature extraction
Data pre-processing goes from your raw data and remolds it to be better suited to machine learning algorithms. This means pulling out important statistics from your data or converting your data into other formats in order to it being more representative. For example if you are using a technique which is sensitive to range, then you should normalize all your features. n your case if you have a signal you might want to extract some information about the temporal and frequency domain transforms. You can try something like empirical mode decomposition (EMD).
Then, you want to use feature selection. From all the information you extracted from your data not all of it will be useful. There are machine learning algorithms such as: PCA, LDA, cross-correlation, etc. Which will select the features that are the most representative and ignore the rest.
In your case
As a general rule of thumb, the amount of data that I suggest to have for shallow machine learning models is $10 \times \#features$. For deep models I usually suggest $100 \times \#features \times \#outputs$. So you are limited by the size of your dataset. In your case a CNN is not recommended. Only recently a group published a quite controversial result of training a CNN with 100,000 examples. The community generally believes that this is way too little and it is not feasible to expect good results when training a CNN with very little data.
I suggest you use a general machine learning technique such as SVM. This will likely result in better result. Try these techniques instead and see what results you get: k-NN, kernel SVM, k-means clustering.