Using AI to decode and encode the signals from the brain to the body