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 patient's 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 patient's 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.
Method and system for connecting an impaired nervous system to a muscle or a group of muscles based on template matching and intelligent end points