# What data format should I use to learn the nonlinear output behavior of my guitar distortion pedal using a neural networkl?

My Problem
I've built a very simple transistor guitar pedal. it has 1 mono input, 1 mono output. Now, all I have ever done in the past with ANN's is offline learning with labelled data and some work with autoencoders and all the data I used was digital so spreadsheets, data frames and CSVs etc. So my confusion comes from not understanding a suitable data type/format to use for training the ANN. It's just a confusion over which data would be more applicable to use.

My Pedals Behaviour & It's Input & Output
The input can be any mono signal audio signal, The signal will be from my PC at a sample rate of 44.1Khz or 96Khz, The higher the sample rate the more accurate the network should be but, 96Khz is my maximum input and output my soundcard can handle. Assume I'm using 44.1Khz for I/O. It's a simple pedal with a single knob which increases the gain of the input to the point of heavy distortion. The way it distorts the signal seems to vary on 2 factors:

• The amount of 'Gain'
• The frequency of the input signal meaning, A low-frequency bass signal (80hz) doesn't distort the same way as a higher frequency signal (4Khz)

Assumptions & My Understandings
Since the pedals behaviour non-linear AFAIK which to me makes a neural network a good candidate. And since this is a real device Online learning seems to be the way to go and since I can only use 44.1Khz. The neural network I'm going to design hasn't got any fixed deep architecture as of yet but I will use 22,000 neurons for the input and 22,000 neurons for output. As Nyquist sampling theorem suggests. If I use a Tanh Activation from -1 to 1 this should be fine. If I was using a Sigmoid/Logistic then I would choose 44.1 as the input dimension. Also, assume all input signal will be composed of Sine waves.

My Question (TLDR: What should the input data look like?)
My first idea of what input data to use was White noise it represents all the of frequencies of the spectrum and from what I could gather seems to be a good choice to avoid overfitting problems and would help the network learn how multiple frequencies can affect each other over time to create this non-linear distortion.

My second idea of input data would be to input a band of N (5, 10, 150) different frequencies at the same time. This would be a lot less information for the network to learn in one go, unlike the white noise, but this would take longer to process because you would have to go through multiple combinations of different frequencies.

Would any 1 of these two approaches have the desired outcome? or am I missing an obvious problem? If so what data format or type could I input to make a more accurate representation of my distortion pedal?

Thanks.

• Great problem! So you want to model the distortion of your pedal with a NN? Training x data being clean guitar signal and y data being distorted signal? It sounds like a classic online RNN architecture exercise. My main worry would be whether it's computationally feasible to sample and train such a RNN in real time (remember RNNs are slow). Particularly in that context, why do you talk about tanh or sigmoid instead of relu? Also, what do you mean with using White noise as training data? The second idea also needs some clarification, though it would make sense to aggregate data somehow. Jun 5, 2018 at 10:29
• What I meant with Tanh and Sigmoid is 44.1Khz is samples taken per second from the source then converted from analogue to digital. If I use Tanh then since it can model between -1 and +1 it can model both the negative and positive parts of the analogue signal, so I did assume I would only need the 22.05Khz inputs from when the analogue signal drops below 0v and then above 0v. But since Sigmoid can only model a +0 number then I would have to use the 44.1Khz to model both the -0v & +0v values, if that makes sense? This could be a wrong approach to the problem or misunderstandings in my knowledge Jun 5, 2018 at 19:04
• What I mean about the White Noise is that since white noise has a equal distrubution of all frequencies. So it seemed like a good place to start to train. But putting in 18Khz (18,000) sine waves all playing together could be a bit to much for it to take on at once and will take forever to train. This is why I thought a set of freqencies like 100hz, 448hz, 3.5khz, 10.11Khz and then train through all combinations.permutations of freqencies which might make the training process shorter. TBH These are just ideas I had in my head so they are very much open to change if i have the wrong idea. Jun 5, 2018 at 19:13