Smart neural bridge: Algorithms to drive a brain machine interface for control of the paralyzed limb