A system including a processor configured to be coupled to an electrical lead that is configured to sense electrical activity in a patient, a memory coupled to the processor, the memory containing computer readable instructions that, when executed by the processor, cause the processor to detect a pain signature in the sensed electrical activity, determine a treatment protocol in response to the detected pain signature, and cause the treatment protocol to be delivered to the patient via the electrical lead.