Algorithms for neural prosthetic applications