Clarification:
The input is stairstep shaped but the target is linear.
If so, there is no way to model this with a static NN.
Perhaps a time-series net that takes into account past inputs and outputs is what is needed.
help narxnet
doc narxnet
Good Luck!
Greg