A method and system for connecting an impaired nervous system of a patient to a destination target of a muscle, group of muscles, or robotic device. A command module implanted within the patients body: (i) samples analog electrical neural signals generated by neurons or nerve fibers of the patient (ii) processes the neural signals to generate spatial digital data in sample matrices (iii) processes multiple consecutive sample matrices in real time using sliding window method to generate a time dependent window matrix (iv) and matches the window matrix to source movement templates to generate high-level movement command(s) which is wirelessly transmitted to driver module(s) within the patients body and attached to the destination target. The driver module matches the high-level movement commands to destination movement templates to generate a digital stimulus. The digital stimulus is translated into an electrical stimulus which is applied to the destination target.