Patent Description:
Medical devices may be external or implanted and may be used to deliver electrical stimulation to patients via various tissue sites to treat a variety of symptoms or conditions such as chronic pain, tremor, Parkinson's disease, epilepsy, urinary or fecal incontinence, sexual dysfunction, obesity, or gastroparesis. A medical device may deliver electrical stimulation therapy via one or more leads that include electrodes located proximate to target locations associated with the brain, the spinal cord, pelvic nerves, peripheral nerves, or the gastrointestinal tract of a patient. Stimulation proximate the spinal cord, proximate the sacral nerve, within the brain, and proximate peripheral nerves are often referred to as spinal cord stimulation (SCS), sacral neuromodulation (SNM), deep brain stimulation (DBS), and peripheral nerve stimulation (PNS), respectively. Electrical stimulation often results in an evoked compound action potential (ECAP) from nerves within the patient.

Prior art is disclosed by <CIT>, <CIT> and <CIT>.

In general, systems, devices, and techniques are described herein for calibrating sensing circuitry for generating a sensing signal, such as an evoked action potential (ECAP) signal or brain resonance signals (e.g., ERNA), to help to provide electrical stimulation therapy to a patient. An ECAP signal may refer to a measure of the nerve tissue's response to stimulation. For example, in response to a stimulation, a nerve generates an ECAP signal, and the parameters of the ECAP signal, such as an amplitude value, may be a function of how much the nerve responded to the stimulation. Medical devices can provide more effective therapy by adjusting an amount of stimulation based on sensed ECAP signals.

According to the invention, which is defined by claim <NUM>, a system for providing therapy to a patient includes stimulation generation circuitry configured to provide electrical stimulation to the patient, sensing circuitry configured to sense a first voltage at a first terminal and to sense a second voltage at a second terminal, and processing circuitry electrically connected to the sensing circuitry and stimulation generation circuitry. The processing circuitry is configured to, when the stimulation generation circuitry does not provide the electrical stimulation, cause storage of the first voltage at the first terminal at a first calibration capacitor and storage of the second voltage at the second terminal at a second calibration capacitor. The processing circuitry is further configured to, after the first voltage is stored at the first calibration capacitor and the second voltage is stored at the second calibration capacitor and when the stimulation generation circuitry provides the electrical stimulation, switch out a first calibration switch to prevent the first voltage stored at the first calibration capacitor from changing and switch out a second calibration switch to prevent the second voltage stored at the second calibration capacitor from changing. The processing circuitry is configured to, while the first calibration switch is switched out and the second calibration switch is switched out and when the stimulation generation circuitry does not provide the electrical stimulation, determine, with the sensing circuitry, a sensing signal based on the first voltage at the first terminal offset by a first calibration voltage stored by the first capacitor and based on second voltage at the second terminal offset by a second calibration voltage stored by the second capacitor. The processing circuitry is configured to provide, with the stimulation generation circuitry, the therapy to the patient based on the sensing signal.

Other features, objects, and advantages of the techniques will be apparent from the description and drawings, and from the claims.

The disclosure describes examples of medical devices, systems, and techniques for calibrating sensing circuitry of medical devices configured to provide electrical stimulation therapy. Electrical stimulation therapy is typically delivered to a target tissue (e.g., nerves of the spinal cord or muscle) of a patient via two or more electrodes. The two or more electrodes may deliver control pulses configured to elicit an evoked compound action potential (ECAP) signal from nerve tissue of a patient, or deliver informed pulses configured to deliver therapy to the patient. In this disclosure, "control pulses" may be stimulation pulses that are used to elicit the ECAP signal. The control pulses may provide therapeutic effect, but need not necessarily provide therapeutic effect. "Informed pulses" may be stimulation pulses that provide therapeutic effect. Informed pulses may be "informed" in the sense that the parameters of the informed pulses (e.g., an amplitude, a pulse width, or a frequency) may be based on the sensing of the ECAP signal that was generated due to the control pulses. The informed pulses may be considered as providing governing therapy or governed therapy. Governing therapy or governed therapy may indicate that the stimulation pulses are for effective therapy.

Parameters of the electrical stimulation therapy (e.g., an electrode combination, a voltage amplitude, a current amplitude, a pulse width, or a pulse frequency) may be selected by a clinician and/or the patient to provide relief from various symptoms, such as pain, nervous system disorders, muscle disorders, etc. In addition, parameters of the electrical stimulation therapy (e.g., informed pulses) may be adjusted in response to a measured ECAP. In order to accurately measure ECAP and provide more effective therapy, sensing circuitry configured to sense ECAP may be effectively calibrated.

This disclosure describes an amplifier (e.g., a bio-amplifier) and processing circuitry to measure an amplitude value of an evoked compound action potential (ECAP) of the human spinal cord. This low power system can detect very small signals (e.g., <NUM>µVpp (<NUM> - <NUM>)), very shortly (e.g., less than <NUM>) after a large stimuli (e.g., about <NUM> V) using a medical device (e.g., an implantable device) that has no appreciable DC pathway to the body, which may help to maximize patient safety. The measured amplitude values may correlate to the amount of tissue captured by electrical stimulus, which varies with body position and other factors, allowing for optimal therapy level control.

<FIG> is a conceptual diagram illustrating an example system <NUM> that includes an IMD <NUM> according to the techniques of the disclosure. Although the techniques described in this disclosure are generally applicable to a variety of medical devices including external devices and IMDs, application of such techniques to IMDs and, more particularly, implantable electrical stimulators (e.g., neurostimulators) will be described for purposes of illustration. More particularly, the disclosure will refer to an implantable SCS system for purposes of illustration, but without limitation as to other types of medical devices or other therapeutic applications of medical devices.

As shown in <FIG>, system <NUM> includes an IMD <NUM>, leads 108A and 108B, and external programmer <NUM> shown in conjunction with a patient <NUM>, who is a human patient. In the example of <FIG>, IMD <NUM> is an implantable electrical stimulator that is configured to generate and deliver electrical stimulation therapy to patient <NUM> via one or more electrodes of electrodes 132A and/or 132B (collectively, "electrodes <NUM>") of leads 108A and/or 108B (collectively, "leads <NUM>"), e.g., for relief of chronic pain or other symptoms. In other examples, IMD <NUM> may be coupled to a single lead carrying multiple electrodes or more than two leads each carrying multiple electrodes. In some examples, the stimulation signals, or pulses (e.g., control pulses), may be configured to elicit detectable ECAP signals that IMD <NUM> may use to determine the posture state occupied by patient <NUM> and/or determine how to adjust one or more parameters that define stimulation therapy. The control pulses may provide therapeutic effect, but in one or more examples, the control pulses may not provide therapeutic effect. IMD <NUM> may be configured to delivered informed pulses for providing therapeutic effect. The informed pulses may be "informed" because the parameters of the informed pulses may be based on the ECAP signal generated from the delivery of control pulses. The informed pulses may be considered as providing governed therapy. Governing therapy may indicate that the stimulation pulses are for effective therapy. The control pulses may be "control" because the delivery of the control pulses is used to control the parameters for the informed pulses.

IMD <NUM> may be a chronic electrical stimulator that remains implanted within patient <NUM> for weeks, months, or even years. In other examples, IMD <NUM> may be a temporary, or trial, stimulator used to screen or evaluate the efficacy of electrical stimulation for chronic therapy. In one example, IMD <NUM> is implanted within patient <NUM>. In some examples, a medical device, configured to perform techniques similar to IMD <NUM>, may be an external device coupled to percutaneously implanted leads. In some examples, IMD <NUM> uses one or more leads, while in other examples, IMD <NUM> is leadless.

IMD <NUM> may be constructed of any polymer, metal, or composite material sufficient to house the components of IMD <NUM> (e.g., components illustrated in <FIG>) within patient <NUM>. In this example, IMD <NUM> may be constructed with a biocompatible housing, such as titanium or stainless steel, or a polymeric material such as silicone, polyurethane, or a liquid crystal polymer, and surgically implanted at a site in patient <NUM> near the pelvis, abdomen, or buttocks. In other examples, IMD <NUM> may be implanted within other suitable sites within patient <NUM>, which may depend, for example, on the target site within patient <NUM> for the delivery of electrical stimulation therapy. The outer housing of IMD <NUM> may be configured to provide a hermetic seal for components, such as a rechargeable or non-rechargeable power source. In addition, in some examples, the outer housing of IMD <NUM> is selected from a material that facilitates receiving energy to charge the rechargeable power source.

Electrical stimulation energy, which may be constant current or constant voltage-based pulses, for example, is delivered from IMD <NUM> to one or more target tissue sites of patient <NUM> via one or more electrodes <NUM> of implantable leads <NUM>. In the example of <FIG>, leads <NUM> carry electrodes <NUM> that are placed adjacent to the target tissue of spinal cord <NUM>. One or more of electrodes <NUM> may be disposed at a distal tip of a lead <NUM> and/or at other positions at intermediate points along the lead. Leads <NUM> may be implanted and coupled to IMD <NUM>. Electrodes <NUM> may transfer electrical stimulation generated by an electrical stimulation generator in IMD <NUM> to tissue of patient <NUM>. Although leads <NUM> may each be a single lead, lead <NUM> may include a lead extension or other segments that may aid in implantation or positioning of lead <NUM>. In some examples, IMD <NUM> may be a leadless stimulator with one or more arrays of electrodes arranged on a housing of the stimulator rather than leads that extend from the housing. In addition, in some examples, system <NUM> may include one lead or more than two leads, each coupled to IMD <NUM> and directed to similar or different target tissue sites.

Electrodes <NUM> of leads <NUM> may be electrode pads on a paddle lead, circular (e.g., ring) electrodes surrounding the body of the lead, conformable electrodes, cuff electrodes, segmented electrodes (e.g., electrodes disposed at different circumferential positions around the lead instead of a continuous ring electrode), any combination thereof (e.g., ring electrodes and segmented electrodes) or any other type of electrodes capable of forming unipolar, bipolar or multipolar electrode combinations for therapy. Ring electrodes arranged at different axial positions at the distal ends of lead <NUM> will be described for purposes of illustration.

The deployment of electrodes <NUM> via leads <NUM> is described for purposes of illustration, but arrays of electrodes <NUM> may be deployed in different ways. For example, a housing associated with a leadless stimulator may carry arrays of electrodes <NUM>, e.g., rows and/or columns (or other patterns), to which shifting operations may be applied. Such electrodes <NUM> may be arranged as surface electrodes, ring electrodes, or protrusions. As a further alternative, electrode arrays may be formed by rows and/or columns of electrodes <NUM> on one or more paddle leads. In some examples, electrode arrays include electrode segments, which are arranged at respective positions around a periphery of a lead, e.g., arranged in the form of one or more segmented rings around a circumference of a cylindrical lead. In other examples, one or more of leads <NUM> are linear leads having <NUM> ring electrodes along the axial length of the lead. In another example, electrodes <NUM> are segmented rings arranged in a linear fashion along the axial length of the lead and at the periphery of the lead.

The stimulation parameter set of a stimulation program that defines the stimulation pulses of electrical stimulation therapy by IMD <NUM> through the electrodes of leads <NUM> may include information identifying which electrodes <NUM> have been selected for delivery of stimulation according to a stimulation program, the polarities of the selected electrodes <NUM>, e.g., an electrode combination for the program, a voltage amplitude, a current amplitude, a pulse frequency, a pulse width, or a pulse shape of stimulation delivered by electrodes <NUM>. These stimulation parameters values that make up the stimulation parameter set that defines pulses may be predetermined parameter values defined by a user and/or automatically determined by system <NUM> based on one or more factors or user input. Informed pulses may be defined by a set of informed stimulation parameter values and control pulses may be defined by a set of control stimulation parameter values.

Although <FIG> is directed to SCS therapy, e.g., used to treat pain, in other examples system <NUM> may be configured to treat any other condition that may benefit from electrical stimulation therapy. In some examples, system <NUM> may be configured to provide multimodal stimulation using prime stimulation and base stimulation together. In some examples, system <NUM> may be used to treat tremor, Parkinson's disease, epilepsy, a pelvic floor disorder (e.g., urinary incontinence or other bladder dysfunction, fecal incontinence, pelvic pain, bowel dysfunction, or sexual dysfunction), obesity, gastroparesis, or psychiatric disorders (e.g., depression, mania, obsessive compulsive disorder, anxiety disorders, and the like). In this manner, system <NUM> may be configured to provide therapy taking the form of spinal cord stimulation(SCS), deep brain stimulation (DBS), peripheral nerve stimulation (PNS), peripheral nerve field stimulation (PNFS), cortical stimulation (CS), pelvic floor stimulation, gastrointestinal stimulation, or any other stimulation therapy capable of treating a condition of patient <NUM>.

In some examples, lead <NUM> includes one or more sensors configured to allow IMD <NUM> to monitor one or more parameters of patient <NUM>, such as patient activity, pressure, temperature, or other characteristics. The one or more sensors may be provided in addition to, or in place of, therapy delivery by lead <NUM>. Rather than or in addition to lead <NUM> including such sensors, IMD <NUM> may include such sensors.

IMD <NUM> may be configured to deliver electrical stimulation therapy (e.g., informed pulses and/or control pulses in the form of a prime pulse train and base pulse train, respectively) to patient <NUM> via selected combinations of electrodes <NUM> carried by one or both of leads <NUM>, alone or in combination with an electrode carried by or defined by an outer housing of IMD <NUM>. The target tissue for the electrical stimulation therapy may be any tissue affected by electrical stimulation, which may be in the form of electrical stimulation pulses or continuous waveforms. In some examples, the target tissue includes nerves, smooth muscle, or skeletal muscle. In the example illustrated by <FIG>, the target tissue is tissue proximate spinal cord <NUM>, such as within an intrathecal space or epidural space of spinal cord <NUM>, or, in some examples, adjacent nerves that branch off spinal cord <NUM>.

Leads <NUM> may be introduced into spinal cord <NUM> in via any suitable region, such as the thoracic, cervical, or lumbar regions. Stimulation of spinal cord <NUM> may, for example, prevent pain signals from traveling through spinal cord <NUM> and to the brain of patient <NUM>. Patient <NUM> may perceive the interruption of pain signals as a reduction in pain and, therefore, efficacious therapy results. In other examples, stimulation of spinal cord <NUM> may produce paresthesia which may be reduce the perception of pain by patient <NUM>, and thus, provide efficacious therapy results. In some examples, stimulation of spinal cord <NUM> or other anatomical structures associated with the spinal cord (e.g., nerves and cells associated with the nervous system) may provide relief from symptoms that may not produce paresthesia. For example, IMD <NUM> may deliver stimulation with intensities (e.g., amplitude values and/or pulse width values) below a sensory or perception threshold (e.g., sub-threshold stimulation) that reduces pain without paresthesia. In multimodal stimulation, for example, IMD <NUM> may deliver one pulse train at a higher frequency via one electrode combination and a second pulse train on an interleaved basis with a lower frequency via a second electrode combination, where both pulse trains are delivered at a sub-threshold intensity.

IMD <NUM> may be configured to generate and deliver electrical stimulation therapy to a target stimulation site within patient <NUM> via electrodes <NUM> of leads <NUM> to patient <NUM> according to one or more therapy stimulation programs. A therapy stimulation program may generally define informed pulses, but may also define control pulses if the control pulses also contribute to a therapeutic effect. A therapy stimulation program may define values for one or more parameters (e.g., a parameter set) that define an aspect of the therapy delivered by IMD <NUM> according to that program. For example, a therapy stimulation program that controls delivery of stimulation by IMD <NUM> in the form of pulses may define a voltage, a current, a pulse width, a pulse rate (e.g., a pulse frequency), an electrode combination, or a pulse shape for stimulation pulses delivered by IMD <NUM> according to that program. In some examples, one or more therapy stimulation programs define multiple different pulse trains that have different parameter values (e.g., different pulse frequencies, amplitude values, pulse widths, and/or electrode combinations) but are delivered on an interleaved basis to together provide a therapy for the patient.

Furthermore, IMD <NUM> may be configured to deliver control stimulation to patient <NUM> via a combination of electrodes <NUM> of leads <NUM>, alone or in combination with an electrode carried by or defined by an outer housing of IMD <NUM> in order to detect ECAP signals (e.g., control pulses and/or informed pulses). The tissue targeted by the stimulation may be the same or similar tissue targeted by the electrical stimulation therapy, but IMD <NUM> may deliver stimulation pulses for ECAP signal detection via the same, at least some of the same, or different electrodes of electrodes <NUM>. Because control stimulation pulses can be delivered in an interleaved manner with informed pulses (e.g., when the pulses configured to contribute to therapy interfere with the detection of ECAP signals or pulse sweeps intended for posture state detection via ECAP signals do not correspond to pulses intended for therapy purposes), a clinician and/or user may select any desired electrode <NUM> combination for informed pulses (i.e., governed therapy). Like the electrical stimulation therapy, the control stimulation may be in the form of electrical stimulation pulses or continuous waveforms.

For example, each control stimulation pulse may include a balanced, bi-phasic square pulse that employs an active recharge phase. However, in other examples, the control stimulation pulses may include a monophasic pulse followed by a passive recharge phase. In other examples, a control pulse may include an imbalanced bi-phasic portion and a passive recharge portion. Although not necessary, a bi-phasic control pulse may include an interphase interval between the positive and negative phase to promote propagation of the nerve impulse in response to the first phase of the bi-phasic pulse. The control stimulation may be delivered without interrupting the delivery of the electrical stimulation informed pulses, such as during the window between consecutive informed pulses. The control pulses may elicit an ECAP signal from the tissue, and IMD <NUM> may sense the ECAP signal via two or more electrodes <NUM> on leads <NUM>. In cases where the control stimulation pulses are applied to spinal cord <NUM>, the signal may be sensed by IMD <NUM> from spinal cord <NUM>.

A user, such as a clinician or patient <NUM>, may interact with a user interface of an external programmer <NUM> to program IMD <NUM>. Programming of IMD <NUM> may refer generally to the generation and transfer of commands, programs, or other information to control the operation of IMD <NUM>. In this manner, IMD <NUM> may receive the transferred commands and programs from external programmer <NUM> to control stimulation, such as stimulation pulses that provide electrical stimulation therapy. For example, external programmer <NUM> may transmit therapy stimulation programs, stimulation parameter adjustments, therapy stimulation program selections, posture states, user input, or other information to control the operation of IMD <NUM>, e.g., by wireless telemetry or wired connection.

In some examples, external programmer <NUM> may be characterized as a physician or clinician programmer if it is primarily intended for use by a physician or clinician. In other cases, external programmer <NUM> may be characterized as a patient programmer if it is primarily intended for use by a patient. A patient programmer may be generally accessible to patient <NUM> and, in many cases, may be a portable device that may accompany patient <NUM> throughout the patient's daily routine. For example, a patient programmer may receive input from patient <NUM> when the patient wishes to terminate or change electrical stimulation therapy, or when a patient perceives stimulation being delivered. In general, a physician or clinician programmer may support selection and generation of programs by a clinician for use by IMD <NUM>, whereas a patient programmer may support adjustment and selection of such programs by a patient during ordinary use. In other examples, external programmer <NUM> may include, or be part of, an external charging device that recharges a power source of IMD <NUM>. In this way, a user may program and charge IMD <NUM> using one device, or multiple devices.

As described herein, information may be transmitted between external programmer <NUM> and IMD <NUM>. Therefore, IMD <NUM> and external programmer <NUM> may communicate via wireless communication using any techniques known in the art. Examples of communication techniques may include, for example, radiofrequency (RF) telemetry and inductive coupling, but other techniques are also contemplated. In some examples, external programmer <NUM> includes a communication head that may be placed proximate to the patient's body near the IMD <NUM> implant site to improve the quality or security of communication between IMD <NUM> and external programmer <NUM>. Communication between external programmer <NUM> and IMD <NUM> may occur during power transmission or separate from power transmission.

In some examples, IMD <NUM>, in response to commands from external programmer <NUM>, may deliver electrical stimulation therapy (e.g., informed pulses and/or control pulses) according to a plurality of therapy stimulation programs to a target tissue site of the spinal cord <NUM> of patient <NUM> via electrodes <NUM> on leads <NUM>. In some examples, IMD <NUM> may modify therapy stimulation programs as therapy needs of patient <NUM> evolve over time. For example, the modification of the therapy stimulation programs may cause the adjustment of at least one parameter of the plurality of stimulation pulses. When patient <NUM> receives the same therapy for an extended period, the efficacy of the therapy may be reduced. In some cases, parameters of the plurality of stimulation pulses may be automatically (e.g., without user input) updated, for example, by IMD <NUM>, external programmer <NUM> or another device or cloud system.

Efficacy of electrical stimulation therapy may be indicated by one or more features (e.g., an amplitude value between one or more peaks or an area under the curve of one or more peaks) of an action potential that is evoked by a control pulse delivered by IMD <NUM> (i.e., a characteristic value of the ECAP signal). Electrical stimulation therapy delivery by leads <NUM> of IMD <NUM> may cause neurons within the target tissue to evoke a compound action potential that travels up and down the target tissue, eventually arriving at sensing electrodes of IMD <NUM> (e.g., electrodes of electrodes <NUM> that are assigned for sensing). For instance, stimulation may elicit at least one ECAP signal, and ECAP responsive to stimulation may also be a surrogate for the effectiveness of the therapy. The amount of action potential (e.g., number of neurons propagating action potential signals) that are evoked may be based on the various parameters of electrical stimulation pulses such as an amplitude value, a pulse width, a frequency, or a pulse shape (e.g., slew rate at the beginning and/or end of the pulse). The slew rate may define the rate of change of the voltage amplitude value and/or current amplitude value of the control pulse at the beginning and/or end of each control pulse or each phase within the pulse. For example, a very high slew rate indicates a steep or even near vertical edge of the pulse, and a low slew rate indicates a longer ramp up (or ramp down) in the amplitude value of the control pulse. In some examples, these parameters contribute to an intensity of the electrical stimulation. In addition, a characteristic of the ECAP signal (e.g., an amplitude value) may change based on the distance between the stimulation electrodes and the nerves subject to the electrical field produced by the delivered control pulses.

Some example techniques for adjusting stimulation parameter values for stimulation pulses (e.g., informed pulses and/or control pulses that may or may not contribute to therapy for the patient) are based on comparing the value of a characteristic of a measured ECAP signal to a target ECAP characteristic value. In response to delivering a control pulse defined by a set of stimulation parameter values, IMD <NUM>, via two or more electrodes interposed on leads <NUM>, senses electrical potential of tissue of the spinal cord <NUM> of patient <NUM> to measure the electrical activity of the tissue. IMD <NUM> senses ECAP from the target tissue of patient <NUM>, e.g., with electrodes on one or more leads <NUM> and associated sense circuitry. In some examples, IMD <NUM> may receive a sensor signal indicative of the ECAP from one or more sensors, e.g., one or more electrodes and circuitry, internal or external to patient <NUM>. Such an example signal may include a sensor signal indicating an ECAP of the tissue of patient <NUM>. Examples of the one or more sensors include one or more sensors configured to measure a compound action potential of patient <NUM>, or a physiological effect indicative of a compound action potential. For example, to measure a physiological effect of a compound action potential, the one or more sensors may be an accelerometer, a pressure sensor, a bending sensor, a sensor configured to detect a posture of patient <NUM>, or a sensor configured to detect a respiratory function of patient <NUM>. In some examples, external programmer <NUM> may receive a sensor signal indicating a compound action potential in the target tissue of patient <NUM> and may transmit a notification of the sensor signal to IMD <NUM>.

In the example of <FIG>, IMD <NUM> is described as performing a plurality of processing and computing functions. However, external programmer <NUM> instead may perform one, several, or all of these functions. In this example, IMD <NUM> functions to relay sensed signals to external programmer <NUM> for analysis, and external programmer <NUM> transmits instructions to IMD <NUM> to adjust the one or more parameters defining the electrical stimulation therapy based on analysis of the sensed signals. For example, IMD <NUM> may relay the sensed signal indicative of an ECAP to external programmer <NUM>. External programmer <NUM> may compare the parameter value of the ECAP to the target ECAP characteristic value, and in response to the comparison, external programmer <NUM> may instruct IMD <NUM> to adjust one or more stimulation parameter that defines the electrical stimulation informed pulses and, in some examples, control pulses, delivered to patient <NUM>.

In some examples, system <NUM> may change the target ECAP characteristic value and/or growth rate(s) over a period of time, such as according to a change to a stimulation threshold (e.g., a perception threshold or detection threshold specific for the patient). System <NUM> may be programmed to change the target ECAP characteristic in order to adjust the intensity of informed pulses (e.g., governed therapy) to provide varying sensations to the patient (e.g., increase or decrease the volume of neural activation). Although system <NUM> may change the target ECAP characteristic value, received ECAP signals may be used by system <NUM> to adjust one or more parameter values of the informed pulses and/or control pulses in order to meet the target ECAP characteristic value.

One or more devices within system <NUM>, such as, for example, IMD <NUM> and/or external programmer <NUM>, may perform various functions as described herein. For example, IMD <NUM> may include stimulation generation circuitry configured to deliver electrical stimulation, sensing circuitry configured to sense a plurality ECAP signals, and processing circuitry. The processing circuitry may be configured to control the stimulation generation circuitry to deliver a plurality of electrical stimulation pulses (e.g., one or more control pulses) having different amplitude values and control the sensing circuitry to detect, after delivery of each electrical stimulation pulse of the plurality of electrical stimulation pulses, a respective ECAP signal of the plurality of ECAP signals.

In some examples, reference may be made to one or more electrodes of IMD <NUM> "delivering" therapy. In these instances, stimulation generation circuitry of IMD <NUM> may be connected to one or more electrodes <NUM> and configured to deliver the therapy "using" or "on" one or more electrodes <NUM>. In some examples described herein, reference may be made to one or more electrodes <NUM> of IMD <NUM> "sensing" ECAP signals. In these instances, sensing circuitry of IMD <NUM> may be connected to one or more electrodes <NUM> and configured to sense the ECAP signals "using" or "on" one or more electrodes <NUM>. A different set (e.g., pair) of one or more electrodes <NUM> may be used for delivering therapy than a set (e.g., pair) of one or more electrodes <NUM> may be used for sensing ECAP signals. While the above refers to ECAP signals, similar techniques may be used for other sensing signals. In some examples, reference may be made to certain recharge states (e.g., active recharge or passive recharge) as "on" one or more electrodes <NUM> of IMD <NUM>. In these instances, circuitry connected to one or more electrodes <NUM> may be "in" the certain recharge state.

In the example of <FIG>, IMD <NUM> is described as performing a plurality of processing and computing functions. However, external programmer <NUM> instead may perform one, several, or all of these functions. In this example, IMD <NUM> may relay sensed signals to external programmer <NUM> for analysis and external programmer <NUM> may transmit instructions to IMD <NUM> to adjust the one or more parameters defining the electrical stimulation signal based on analysis of the sensed signals. For example, IMD <NUM> may relay the sensed signal indicative of an ECAP to external programmer <NUM>. External programmer <NUM> may compare the parameter value of the ECAP to the target ECAP characteristic value, and in response to the comparison, external programmer <NUM> may instruct IMD <NUM> to adjust one or more parameters that define the electrical stimulation signal.

Although electrical stimulation is generally described herein in the form of electrical stimulation pulses, electrical stimulation may be delivered in non-pulse form in other examples. For example, electrical stimulation may be delivered as a signal having various waveform shapes, frequencies, and amplitude values. Therefore, electrical stimulation in the form of a non-pulse signal may be a continuous signal that may have a sinusoidal waveform or other continuous waveform.

In some examples, sensing circuitry of IMD <NUM> may be coupled to control electrodes of one or more electrodes <NUM> and governing electrodes of one or more electrodes <NUM>. The control electrodes may be configured to deliver control pulses to patient tissue that elicit ECAP signals from the tissue of patient <NUM>. The governing electrodes may be configured to deliver governed therapy (e.g., informed pulses) to patient tissue that provide therapy to patient <NUM>. The sensing circuitry may include one or more amplifiers configured to amplify ECAP signals within the circuitry for more accurate sensing of the ECAP signals. The sensing circuitry may also include processing circuitry configured to enter an active recharge state on the control electrodes and, subsequent to entering an active recharge state, enter a passive recharge state on the control electrodes. The active recharge state and passive recharge state are explained with more specificity below. The processing circuitry may also be configured to calibrate, or auto-zero the operational amplifier of sensing circuitry while the control electrodes are in the passive recharge state.

<FIG> is a block diagram of the example IMD of <FIG>. IMD <NUM> may be an example of IMD <NUM> of <FIG>. In the example shown in <FIG>, IMD <NUM> includes stimulation generation circuitry <NUM>, sensing circuitry <NUM>, processing circuitry <NUM>, sensor <NUM>, telemetry circuitry <NUM>, power source <NUM>, and memory <NUM>. Each of these circuits may be or include programmable or fixed function circuitry can perform the functions attributed to respective circuitry. For example, processing circuitry <NUM> may include fixed-function or programmable circuitry, stimulation generation circuitry <NUM> may include circuitry can generate electrical stimulation signals such as pulses or continuous waveforms on one or more channels, sensing circuitry <NUM> may include sensing circuitry for sensing signals, and telemetry circuitry <NUM> may include telemetry circuitry for transmission and reception of signals. Memory <NUM> may store computer-readable instructions that, when executed by processing circuitry <NUM>, cause IMD <NUM> to perform various functions described herein. Memory <NUM> may be a storage device or other non-transitory medium.

In the example shown in <FIG>, memory <NUM> may store patient data <NUM>, which may include anything related to the patient such as one or more patient postures, an activity level, or a combination of patient posture and activity level. Memory <NUM> may store stimulation parameter settings <NUM> within memory <NUM> or separate areas within memory <NUM>. Each stored stimulation parameter setting <NUM> defines values for one or more sets of electrical stimulation parameters (e.g., an informed stimulation parameter set and a control stimulation parameter set, or parameters for other pulse trains). Stimulation parameter settings <NUM> may also include additional information such as instructions regarding delivery of electrical stimulation signals based on stimulation parameter relationship data, which can include relationships between two or more stimulation parameters based upon data from electrical stimulation signals delivered to patient <NUM> or data transmitted from external programmer <NUM>. The stimulation parameter relationship data may include measurable aspects associated with stimulation, such as an ECAP characteristic value.

Accordingly, in some examples, stimulation generation circuitry <NUM> may generate electrical stimulation signals (e.g., informed pulses and/or control pulses) in accordance with the electrical stimulation parameters noted above. Other ranges of stimulation parameter values may also be useful and may depend on the target stimulation site within patient <NUM>. While stimulation pulses are described, stimulation signals may be of any form, such as continuous-time signals (e.g., sine waves or cosine waves) or the like.

Sensing circuitry <NUM> may be configured to monitor signals from any combination of electrodes <NUM>, <NUM>. In some examples, sensing circuitry <NUM> includes one or more amplifiers, filters, and analog-to-digital converters. Sensing circuitry <NUM> may be used to sense physiological signals, such as ECAP. In some examples, sensing circuitry <NUM> detects ECAP from a particular combination of electrodes <NUM>, <NUM>. In some examples, the particular combination of electrodes for sensing ECAP includes different electrodes than a set of electrodes <NUM>, <NUM> used to deliver control stimulation pulses and/or informed stimulation pulses. In some examples, the particular combination of electrodes used for sensing ECAP includes at least one of the same electrodes as a set of electrodes used to deliver informed and/or control stimulation pulses to patient <NUM>. Sensing circuitry <NUM> may provide signals to an analog-to-digital converter (ADC), for conversion into a digital signal for processing, analysis, storage, or output by processing circuitry <NUM>.

Processing circuitry <NUM> may include any one or more of a microprocessor, a controller, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), discrete logic circuitry, or any other processing circuitry can provide the functions attributed to processing circuitry <NUM> herein may be embodied as firmware, hardware, software, or any combination thereof. Processing circuitry <NUM> may control stimulation generation circuitry <NUM> to generate electrical stimulation signals according to stimulation parameter settings <NUM> stored in memory <NUM> to apply stimulation parameter values, such as, for example, a pulse amplitude value, a pulse width, a pulse frequency, and/or a waveform shape of each of the electrical stimulation signals.

In the example of <FIG>, set of electrodes <NUM> includes electrodes 232A, 232B, 232C, and 232D, and the set of electrodes <NUM> includes electrodes 234A, 234B, 234C, and 234D. In some examples, a single lead may include all eight electrodes <NUM> and <NUM> along a single axial length of the lead. Processing circuitry <NUM> also controls stimulation generation circuitry <NUM> to generate and apply the electrical stimulation signals to selected combinations of electrodes <NUM>, <NUM>. In some examples, stimulation generation circuitry <NUM> includes a switch circuit that may couple stimulation signals to selected conductors within leads <NUM>, which, in turn, may deliver the stimulation signals across selected electrodes <NUM>, <NUM>. Such a switch circuit may be a switch array, switch matrix, multiplexer, or any other type of switch circuitry can selectively couple stimulation energy to selected electrodes <NUM>, <NUM> and to selectively sense bioelectrical neural signals of a spinal cord of the patient (not shown in <FIG>) with selected electrodes <NUM>, <NUM>.

As shown, stimulation generation circuitry <NUM> may not include a switch circuit. In these examples, stimulation generation circuitry <NUM> may include a plurality of pairs of voltage sources, current sources, voltage sinks, or current sinks connected to each of electrodes <NUM>, <NUM> such that each pair of electrodes has a unique signal circuit. In other words, in these examples, each of electrodes <NUM>, <NUM> may be independently controlled via its own signal circuit (e.g., via a combination of a regulated voltage source and sink or regulated current source and sink), as opposed to switching signals between electrodes <NUM>, <NUM>.

Electrodes <NUM>, <NUM> on respective leads <NUM> may be constructed of a variety of different designs. For example, one or both of leads <NUM> may include one or more electrodes at each longitudinal location along the length of the lead, such as one electrode at different perimeter locations around the perimeter of the lead at each of the locations A, B, C, and D. In one example, the electrodes may be electrically coupled to stimulation generation circuitry <NUM> via respective wires that are straight or coiled within the housing of the lead and run to a connector at the proximal end of the lead. In another example, each of the electrodes of the lead may be electrodes deposited on a thin film. The thin film may include an electrically conductive trace for each electrode that runs the length of the thin film to a proximal end connector. The thin film may then be wrapped (e.g., a helical wrap) around an internal member to form the lead <NUM>. These and other constructions may be used to create a lead with a complex electrode geometry.

Although sensing circuitry <NUM> is incorporated into a common housing with stimulation generation circuitry <NUM> and processing circuitry <NUM> in <FIG>, in some examples, sensing circuitry <NUM> may be in a separate housing from IMD <NUM> and may communicate with processing circuitry <NUM> via wired or wireless communication techniques.

In some examples, one or more of electrodes <NUM> and <NUM> may be suitable for sensing ECAP. For instance, electrodes <NUM> and <NUM> may sense the voltage amplitude of a portion of the ECAP signals, where the sensed voltage amplitude is a characteristic the ECAP signal.

Memory <NUM> may be configured to store information within IMD <NUM> during operation. Memory <NUM> may include a computer-readable storage medium or computer-readable storage device. In some examples, memory <NUM> includes one or more of a short-term memory or a long-term memory. Memory <NUM> may include, for example, random access memories (RAM), dynamic random-access memories (DRAM), static random-access memories (SRAM), magnetic discs, optical discs, flash memories, or forms of electrically programmable memories (EPROM) or electrically erasable and programmable memories (EEPROM). In some examples, memory <NUM> is used to store data indicative of instructions for execution by processing circuitry <NUM>. As discussed herein, memory <NUM> can store patient data <NUM>, stimulation parameter settings <NUM>, and control policy data <NUM>.

Sensor <NUM> may include one or more sensing elements that sense values of a respective patient parameter. As described, electrodes <NUM> and <NUM> may be the electrodes that sense, via sensing circuitry <NUM>, a value of the ECAP indicative of a target stimulation intensity. Sensor <NUM> may include one or more accelerometers, optical sensors, chemical sensors, temperature sensors, pressure sensors, or any other types of sensors. Sensor <NUM> may output patient parameter values that may be used as feedback to control delivery of electrical stimulation signals. IMD <NUM> may include additional sensors within the housing of IMD <NUM> and/or coupled via one of leads <NUM> or other leads. In addition, IMD <NUM> may receive sensor signals wirelessly from remote sensors via telemetry circuitry <NUM>, for example. In some examples, one or more of these remote sensors may be external to patient (e.g., carried on the external surface of the skin, attached to clothing, or otherwise positioned external to the patient). In some examples, signals from sensor <NUM> may indicate a posture state (e.g., sleeping, awake, sitting, standing, or the like), and processing circuitry <NUM> may select target and/or threshold ECAP characteristic values according to the indicated posture state.

Telemetry circuitry <NUM> supports wireless communication between IMD <NUM> and an external programmer (not shown in <FIG>) or another computing device under the control of processing circuitry <NUM>. Processing circuitry <NUM> of IMD <NUM> may receive, as updates to programs, values for various stimulation parameters such as an amplitude value and/or an electrode combination (e.g., for informed and/or control pulses), from the external programmer via telemetry circuitry <NUM>. Updates to stimulation parameter settings <NUM> and input efficacy threshold settings <NUM> may be stored within memory <NUM>. Telemetry circuitry <NUM> in IMD <NUM>, as well as telemetry circuits in other devices and systems described herein, such as the external programmer, may accomplish communication by radiofrequency (RF) communication techniques. In addition, telemetry circuitry <NUM> may communicate with an external medical device programmer (not shown in <FIG>) via proximal inductive interaction of IMD <NUM> with the external programmer. The external programmer may be one example of external programmer <NUM> of <FIG>. Accordingly, telemetry circuitry <NUM> may send information to the external programmer on a continuous basis, at periodic intervals, or upon request from IMD <NUM> or the external programmer.

Power source <NUM> may deliver operating power to various components of IMD <NUM>. Power source <NUM> may include a rechargeable or non-rechargeable battery and a power generation circuit to produce the operating power. Recharging may be accomplished through proximal inductive interaction between an external charger and an inductive charging coil within IMD <NUM>. In other examples, traditional primary cell batteries may be used. In some examples, processing circuitry <NUM> may monitor the remaining charge (e.g., voltage) of power source <NUM> and select stimulation parameter values that may deliver similarly effective therapy at lower power consumption levels when needed to extend the operating time of power source <NUM>.

Stimulation generation circuitry <NUM> of IMD <NUM> may receive, via telemetry circuitry <NUM>, instructions to deliver electrical stimulation according to stimulation parameter settings <NUM> to a target tissue site of the spinal cord of the patient via a plurality of electrode combinations of electrodes <NUM>, <NUM> of leads <NUM> and/or a housing of IMD <NUM>. Each electrical stimulation signal may elicit an ECAP signal that is sensed by sensing circuitry <NUM> via electrodes <NUM> and <NUM>. Processing circuitry <NUM> may receive, via an electrical signal sensed by sensing circuitry <NUM>, information indicative of an ECAP signal (e.g., a numerical value indicating a characteristic of the ECAP in electrical units such as voltage or power) produced in response to the electrical stimulation signal(s). Stimulation parameter settings <NUM> may be updated according to the ECAP recorded at sensing circuitry <NUM>. While the above discussion refers to an ECAP signal, some examples, may be directed to other sensing signals.

<FIG> is a conceptual diagram illustrating an example circuit <NUM> for the IMD of <FIG>, in accordance with one or more techniques of this disclosure. In this example, sensor circuitry <NUM> of sense chip <NUM> may be configured to detect a sense signal (e.g., an ECAP signal). For example, sensor circuitry <NUM> may use a multiplexer <NUM> (also referred to herein as "MUX <NUM>") to select a pair of electrodes. Auto-zero circuit <NUM> may be configured to perform auto-zero techniques, which are described in further details in <FIG> and <FIG>. Amplifier <NUM> may be configured to amplify the sense signal generated by auto-zero circuit <NUM>, examples of which are discussed with respect to <FIG>. Successive-approximation-register analog-to-digital converter <NUM> (also referred to herein as "SAR ADC <NUM>") may represent the sensing signal as a digital value. Feature extraction and configurable triggers unit <NUM> may be configured to extract features (e.g., ECAP features) from the digitized sensing signal output by SAR ADC <NUM>, examples of which are discussed with respect to <FIG>, <FIG>.

<FIG> is a conceptual diagram illustrating an example analog circuit <NUM> for determining a sensor signal, in accordance with one or more techniques of this disclosure. Any of one or more electrodes <NUM> (e.g., <NUM> electrodes) at the device level can be selected as the sensing pair of electrodes <NUM>. For the channels not being sensed, the MUX/Blanking switches may be left open (e.g., NMOS gate at ground), always disconnecting them from calibration capacitors <NUM>, <NUM> (e.g., the <NUM> shared <NUM> nF capacitors). Only the selected sensing pair of electrodes <NUM> is shown in the below diagram for example purposes only.

Sensing circuitry <NUM> of <FIG> may be configured to sense an ECAP signal from patient tissue. Sensing circuitry <NUM> may include circuit <NUM> prior to outputting to amplifier circuitry <NUM>, where amplifier circuitry <NUM> may be configured to amplify a sensing signal (e.g., an ECAP signal) sensed by sensing circuitry <NUM>. Circuit <NUM> may include electrodes <NUM>, feedthrough capacitors <NUM>, <NUM>, AC coupling capacitors <NUM>, grounding circuitry <NUM>, <NUM>, blanking circuitry <NUM>, calibration capacitors <NUM>, <NUM>, and auto-zero circuitry <NUM>. Grounding circuitry <NUM>, <NUM> may provide a high impedance grounding of circuit <NUM> to ground (e.g., a battery ground).

Electrodes <NUM> may be examples of electrodes <NUM>, <NUM> of <FIG> and may be coupled to circuit <NUM>. For example, electrodes <NUM> may rest against the patient tissue (e.g., spinal cord) of patient <NUM>. Electrodes <NUM> may include control electrodes configured to deliver a control pulse to the patient tissue that elicits an ECAP signal from patient tissue. Electrodes <NUM> may also include governing electrodes configured to deliver governed therapy (e.g., informed pulses) to patient tissue that provides therapy to patient <NUM>. One or more electrodes <NUM> may collect an ECAP signal from patient tissue and provide an electrical signal to the sensing circuitry of circuit <NUM> representing an amplitude value for the ECAP signal.

As the stimulation generation circuitry <NUM> of the IMD <NUM> provides therapy to patient tissue, AC coupling capacitors <NUM> may prevent accumulated charge on electrodes <NUM> from impacting the patient by holding the charge. During the stimulation state and the active recharge state, blanking circuitry <NUM> may block the sensing signal. For example, first switches <NUM>, <NUM> may be configured to switch-out calibration capacitors <NUM>, <NUM>, respectively, when stimulation generation circuitry <NUM> provides stimulation and when stimulation generation circuitry <NUM> provides active recovery.

Subsequent to entering the active recharge state, stimulation generation circuitry <NUM> may be configured to enter a passive recharge state on the control electrodes. Active recharge states may use a relatively large power expenditure from power source <NUM> of IMD <NUM> to generate the opposing current. In order to conserve power for extending the life of IMD <NUM>, at least a portion of the active recharge state in stimulation generation circuitry <NUM> may be replaced by a passive recharge state. While in the passive recharge state, in this example, switching elements <NUM>, <NUM> may be configured to switch-in calibration capacitors <NUM>, <NUM>, respectively, when stimulation generation circuitry <NUM> does not provide stimulation and during a signal acquisition state. Resistors <NUM>, <NUM> may help to limit an amount of electrical current of circuit <NUM>.

While operating in the passive recharge state, processing circuitry <NUM> may auto-zero outputs to amplifier circuitry <NUM>. Auto-zeroing the outputs to may calibrate the sensing circuitry <NUM> for detecting sensing signals from patient tissue. To auto-zero the outputs, processing circuitry <NUM> may close calibration switches <NUM>, <NUM> of auto-zero circuitry <NUM> to connect the outputs to ground. Offsets may be stored on calibration capacitors <NUM>, <NUM> during passive recharge may be used to provide common mode rejection seen at the input of amplifier circuitry during a signal acquisition state, which may improve the accuracy of a sensing signal (e.g., an ECAP signal) generated during the signal acquisition state.

Processing circuitry <NUM> of IMD <NUM> may cause stimulation generation circuitry <NUM> to deliver, on governing electrodes, a governed therapy to the patient after sensing for the evoked compound action potential signal. For example, processing circuitry <NUM> may be configured to cause sensing circuitry <NUM> to sense, during the passive recharge state, for a sensing signal (e.g., an ECAP signal). Following sensing for the sensing signal, processing circuitry <NUM> may cause stimulation generation circuitry <NUM> to deliver a governed therapy to the patient tissue on the governing electrodes based on the sensing signal.

<FIG> is a conceptual diagram illustrating an example digital circuit <NUM> for determining a sensor signal, in accordance with one or more techniques of this disclosure. In this example, first amplifier stage <NUM> of amplifier circuitry <NUM> may pre-amplify a sensing signal output by analog circuitry (e.g., analog circuitry <NUM> of <FIG>).

As shown, first amplifier stage <NUM> may include a transconductance amplifier (referred to herein as a "GMR amplifier"), which is discussed in further detail in <FIG>. As used herein, GMR may refer to transconductance (gm) times resistance (R). The transconductance (gm) may refer to the transconductance of the input stage which converts a differential voltage into a differential current (e.g., gm = Iout/Vin. ) Iout is then passed a resistance "R", resulting in Vout = R * Iout. Vout/Vin of the <NUM> steps = gm*R. These circuits are thus referred to herein as "GMR" circuits.

First amplifier stage <NUM> may comprise a direct GMR stage with gain of <NUM>, a low pass filter of <NUM>, a current consumed of <NUM>µA, apply clamping of internal nodes for rapid recovery of out of range conditions, and an offset injection of +/-30mV (+/-3mV input referred) at the stage output. Circuit <NUM> may include alternative blanking timing circuitry <NUM>, which may provide a blanking function. For example, alternative blanking timing circuitry <NUM> may switch-out second amplifier stage <NUM> during a stimulation state and/or an active recovery state. In this example, alternative blanking timing circuitry <NUM> may switch-in second amplifier stage <NUM> during a passive recharge state. Alternative blanking timing circuitry <NUM> may switch-out second amplifier stage <NUM> during a governed therapy state.

Second amplifier stage <NUM> may be configured to auto-zero at input and may include a direct GMR with gain of <NUM>. A direct GMR stage may become non-linear when the input exceeds a threshold voltage range, for example, approximately +/-20mV. Second amplifier stage <NUM> may include a trimmable low pass filter of <NUM>. Second amplifier stage <NUM> may be configured to add a trimmable amount of capacitance at the output of this stage to change the pole from, for example, <NUM> to <NUM>. The gain of second amplifier stage <NUM> may be <NUM>, compared to the gain of <NUM> of first amplifier stage <NUM>. The power usage of second amplifier stage <NUM> may be less than the power usage of first amplifier stage <NUM> because first amplifier stage <NUM> amplifies noise by a factor of <NUM>. Noise power is inversely proportional to current in these stages. Second amplifier stage <NUM> may include a current of <NUM>µA.

Third amplifier stage <NUM> may be configured to auto-zero at input, may comprise a linearized GMR with gain of <NUM> to <NUM>. A linearized GMR stage may apply an interior loop feedback technique to have a linear transfer function for larger input signals.

Fourth amplifier stage <NUM> may be configured to auto-zero at input, with an output voltage of <NUM> mV to <NUM> mV, may comprise S/H buffer with gain of <NUM>, and a current of <NUM>µA. The output of fourth amplifier stage <NUM> may be digitized by SAR ADC <NUM>. Fourth amplifier stage <NUM> may convert a high impedance input signal to a low impedance output signal. For example, fourth amplifier stage <NUM> may rapidly load a <NUM> pF sample and hold capacitor from ground, with the signal voltage to sub-mV accuracy, within about <NUM>. For instance, fourth amplifier stage <NUM> may comprise cascading source follower unity gain buffers.

<FIG> is a conceptual diagram illustrating an example digital circuit <NUM> for determining a sensor signal, in accordance with one or more techniques of this disclosure. In the example of <FIG>, circuit <NUM> may compute multiple (e.g., <NUM> to <NUM>) overlapping rolling sums (or averages) of waveforms (e.g., <NUM> to <NUM> waveforms) (<NUM>), which may reduce noise. Circuit <NUM> may then apply a finite impulse response (FIR) filter that is, for example, configurable, odd, symmetric, time variant edge handling (<NUM>), which may further reduce noise. Circuit <NUM> may perform a derivative on the output of step <NUM> to make an artifact invariant to a presence of an additive linear artifact (see step <NUM> of <FIG>). Circuit <NUM> may select the average directly from step <NUM> or the derivative on the average as the input to the FIR filter.

In this example, circuit <NUM> may apply an interpolator (e.g., a 4x interpolator) using zero insertions (e.g., <NUM> zero insertions) per input data point that may be followed by a FIR quarter low pass and that is implemented in, for example, polyphase form for efficiency (<NUM>). Circuit <NUM> may perform additive linear artifact invariant amplitude extraction, which is described in further details with respect to step <NUM> of <FIG> (<NUM>) and generate a waveform observable register bank (<NUM>). In this example, circuit <NUM> may output a representation of waveform a Medtronic Extensible Programmable Sensor Bus (MEPS) bus transmitter to a master control unit (MCU) (<NUM>) using a local MEPS multiplexer (<NUM>). While the above example uses a MEPS, some examples may use another bus. Circuit <NUM> may output the representation of the waveform using a MEPS transmitter (e.g., <NUM> clock mode unless continuous mode w/ <NUM> clock) (<NUM>).

<FIG> is a circuit diagram illustrating an example stimulus state of operation, in accordance with one or more techniques of this disclosure. The stimulus hardware of <FIG> is an example of an electronically evoked compound action potential (ECAP) stimulus hardware. This stimulus hardware may be used to establish the relative voltage between device ground and the common body voltage, which may be important to ECAP sensing. In the example of <FIG>, stimulation generation circuitry <NUM> may apply current <NUM> to perform a stimulation state operation, which results in a voltage (e.g., +ΔV+Vo) being applied to patient <NUM> (<NUM>), which results in a total charge Q (<NUM>). The total charge Q may result in a residual voltage left on the <NUM>µP AC coupling capacitors of +ΔV+Vo and -ΔV+Vo, where Vo is the initial condition on the capacitor.

In <FIG>, Zbody represents the electrode body interface. The electrode body interface may be described as an ion double layer capacitor in parallel with an ion oxidation reduction pathway, which may be described by the Butler-Volmer equation. The ion double layer capacitor in parallel with the ion oxidation reduction pathway may be in series with an Ohmic body impedance. A further simplified model of the electrode body interface may be referred to as Randles circuit, which is a leaky capacitor in series with an ohmic body impedance.

<FIG> is a circuit diagram illustrating an example active recharge state of operation, in accordance with one or more techniques of this disclosure. In the example of <FIG>, stimulation generation circuitry <NUM> may apply current <NUM> to perform an active recharge state operation (<NUM>). The current being applied to patient <NUM> may remove the charge on the <NUM>µF coupling capacitors that was added during stimulus, which may return the capacitors to the initial voltage (Vo).

<FIG> is a circuit diagram illustrating an example passive recharge state of operation, in accordance with one or more techniques of this disclosure. Loop <NUM> may rapidly drain Cpar (e.g., <NUM>) to make Vbody equal device ground, which may help to improve an accuracy of a sensing state.

<FIG> is a waveform timing diagram illustrating example states of operation, in accordance with one or more techniques of this disclosure. In the example of <FIG>, processing circuitry <NUM> may operate in <NUM> states of operation. The ordinate axis of <FIG> represents a ping electrode pair current <NUM> and a governed therapy electrode pair current <NUM> and the abscissas axis of <FIG> represents time.

In the auto-zero state <NUM>, processing circuitry <NUM> may obtain a "best" approximation of the differential and common mode offset that will be seen at the input of the amplifier during signal acquisition phase <NUM> so that the differential and common mode offset can be cancelled. Details of the auto-zero state <NUM> are discussed with respect to <FIG>. In the blocking state <NUM>, processing circuitry <NUM> may be configured to recover quickly from the presence of a ping stimulus and active recharge (e.g., about <NUM> V) and be able to sense a sensing signal as low as <NUM>µVpp, as early as <NUM> after the ping stimulus, a factor of <NUM> million in voltage difference. Details of the blocking state <NUM> are discussed with respect to <FIG>. In the signal acquisition state <NUM>, processing circuitry <NUM> may be configured to acquire a sensing signal to measure an amplitude value (e.g., an ECAP amplitude value). Details of the signal acquisition state <NUM> are discussed with respect to <FIG>.

In governed therapy stimulus state <NUM>, processing circuitry <NUM> may perform titrated therapy based on a feature of the sensing signal (e.g., an ECAP amplitude value). For example, during governed therapy stimulus state <NUM>, stimulation generation circuitry <NUM> may deliver stimulus according to <FIG>. Passive recharge of the governed (therapy) electrodes may not be the desired device state to perform an auto-zero. Instead, system <NUM> may be configured to the ping electrode passive recharge state (e.g., auto-zero state <NUM>).

<FIG> are a circuit diagrams illustrating an example of sensing circuitry during auto-zero state <NUM> of operation, in accordance with one or more techniques of this disclosure. Cancelling differential offset may be beneficial for observing, with a high resolution, sensing signals, which may include <NUM>µVpp (Volts peak-to-peak) to <NUM>µVpp signals. Cancelling common mode offset may be beneficial to staying within the common mode input range of high performance, low voltage, amplifier components. Furthermore, small variations in the common mode input signal may produce an offset, resulting from the finite common mode rejection ratio of the amplifier. In this auto-zero state <NUM> the common and differential mode offset at the sense amplifier input may be stored on the auto-zero capacitors <NUM> ("Cs,<NUM>") and <NUM> ("Cs,<NUM>"), which may be examples of calibration capacitors <NUM>, <NUM>, respectively. During measurement, auto-zero capacitors <NUM>, <NUM> may be placed in series with amplifier <NUM>, which may help to cancel differential offset and/or common mode offset. During auto-zero state <NUM>, auto-zero capacitors <NUM>, <NUM> may store the offset due to low frequency aggressors, such as, for example, <NUM> noise, as close in time as possible to the signal acquisition state, which may maximize the cancellation of differential offset and/or common mode offset. In some examples, during auto-zero state <NUM>, auto-zero capacitors <NUM>, <NUM> may store an inherent offset the device is expected to see in the subsequent signal acquisition state. Storing the inherent offset may be accomplished by placing the device (e.g., IMD <NUM>) in the same configuration that will exist in the signal acquisition state, when performing the auto-zero operation of auto-zero state <NUM>.

<FIG> represents a passive recharge of the ping electrodes. In the configuration of <FIG>, two charge balanced capacitors <NUM> ("Ct,<NUM>" and "Ct,<NUM>"), which may be examples of AC coupling capacitors <NUM> of <FIG> are connected between device ground and human tissue through the ping electrodes. AC coupling capacitors <NUM> may control the voltage (see <FIG>). The common mode voltage between device ground and the common body voltage may be the non-zero voltage stored on these capacitors.

Back to <FIG>, the common mode voltage seen at the input of amplifier <NUM> may incorporate the common mode voltage stored on charge balanced capacitors <NUM> as well as the second pair of charge balanced capacitors <NUM> ("Ct,<NUM>" and "Ct,<NUM>"), which may be examples of AC coupling capacitors <NUM> of <FIG>, that exist between the body and sense amplifier input. The differential voltage seen at amplifier <NUM> may be the differential voltage at the sense electrode interface and on charge balanced capacitors <NUM>. Charge balanced capacitors <NUM> may be configured to use electrodes as therapy electrodes. Charge balanced capacitors <NUM> may help to protect against DC current flowing into the body of patient <NUM>, resulting in tissue/electrode damage, during therapy. Charge balanced capacitors <NUM> also protect against silicon failure in the field, resulting in DC current, that may also result in tissue damage of patient <NUM>. As system <NUM> may be highly configurable for selected electrodes, the sense and ping electrodes may be selectable between <NUM> options, at the device level. The offset measured by this auto-zero process is only an estimate.

<FIG> is a circuit diagram illustrating an example of sensing circuitry <NUM> during a blocking state of operation, in accordance with one or more techniques of this disclosure. <FIG> illustrates an example blanking operation. The blanking operation may include processing circuitry <NUM> opening switches <NUM>, <NUM> to prevent capacitors <NUM>, <NUM> ("Cs,<NUM>" and "Cs,<NUM>") from changing their voltages. Capacitors <NUM> may be examples of AC coupling capacitors <NUM> of <FIG> and/or the <NUM>µF capacitors in <FIG>. The blanking operation may help to stop the sensing signal from being received by second amplifier stage <NUM>.

Circuit <NUM> may be configured to perform a blanking operation or clamping using switches <NUM>, <NUM> and a blanking operation using blanking switches <NUM>, <NUM>. For example, processing circuitry <NUM> may blank, using switches <NUM>, <NUM>, the input of first amplifier stage <NUM> at a time (e.g., at least <NUM>) beyond active recharge (e.g., at the end of blocking state <NUM> of <FIG>) and may blank, using blanking switches <NUM>, <NUM>, an input of second amplifier stage <NUM> at a time (e.g., at least <NUM>) beyond the active recharge, which may help to allow a transient of the received sensing signal to reach steady state prior to propagating the received sensing signal to longer time constant stages downstream (e.g., second amplifier stage <NUM> or second amplifier stage <NUM> with one or more additional amplifier stages).

In some examples, switches <NUM>, <NUM> may be configured to only clamp the sensing signal to a component safe voltage range. For example, processing circuitry <NUM> may clamp, using switches <NUM>, <NUM>, the input of first amplifier stage <NUM> to a target voltage range (e.g., a component safe voltage range). In this example, processing circuitry <NUM> may blank, using blanking switches <NUM>, <NUM>, an input of second amplifier stage <NUM> at a time (e.g., at least <NUM>) beyond the active recharge (e.g., at the end of blocking state <NUM> of <FIG>), which may help to allow a transient of the received sensing signal to reach steady state prior to propagating the received sensing signal to longer time constant stages downstream (e.g., second amplifier stage <NUM> or second amplifier stage <NUM> with one or more additional amplifier stages).

<FIG> is a circuit diagram illustrating an example of sensing circuitry <NUM> during a signal acquisition state of operation, in accordance with one or more techniques of this disclosure. During signal acquisition state <NUM>, sensing circuitry <NUM> may wide band a high pass filter (e.g., disabling the high pass filter). For example, sensing circuitry <NUM> may make the passband wider by moving the high pass poles from ~<NUM> to ~<NUM>. The frequency of a pole is fhp(Hz) = <NUM>/(<NUM>*pi*R*C). By opening up the switch in series with the resistor R becomes infinite and fhp(Hz) = <NUM>.

The benefit of disabling the high pass filters is more than just preserving all low frequency content of the targeted signal. Sensing circuitry <NUM> may exhibit offset jitter that cannot fully be controlled by any of our offset control mechanisms. When a step offset is passed through a cascade of <NUM> high pass filters (instead of an auto-zeros process), the step response may result in a complicated background signal that may be hard to separate from the sensing signal (e.g., an ECAP signal), and resulting amplitude value that is desirable to extract. In contrast, it is much easier for IMD <NUM> to devise a measurement of amplitude extraction that is invariant to a flat background signal. For example, a peak minus trough amplitude measurement is invariant to an offset, provided the offset is within the dynamic range of the amplifier.

Sensing circuitry <NUM> may help to increase the common mode rejection ratio (CMRR) of the amplifier system during signal acquisition state <NUM>, which may help to avoid signal degradation by common mode aggressors in the body of patient <NUM>. The disconnection of resistors of grounding circuitry <NUM> at the amplifier input may help to force the input impedance extremely high, corresponding primarily to the capacitance of the differential pair at the input of the amplifier. The input impedance at the body, which ranges from <NUM> kΩ at low frequencies to <NUM> kΩ at higher frequencies, and do not match, form an impedance divider with the amplifier input impedance, which may degrade the CMRR. If the resistors of ground circuitry <NUM> were not switched out, the common mode rejection ratio of the system may be poor, and sensing signals may not be measurable. During signal acquisition state <NUM>, the second differential offset cancelling mechanism, using a digital control loop, may be applied.

In accordance with the techniques of the disclosure, injection circuitry <NUM> may be configured to provide a differential offset cancelling mechanism. The differential offset cancelling mechanism of injection circuitry <NUM> may help to account for a slowly varying change in the offset between the auto-zero state (e.g., at the end of auto-zero state <NUM>) and after a ping pulse (e.g., at the end of blocking state <NUM>). For example, the offset difference between the auto-zero state and after the ping pulse may slowly vary as patient <NUM> changes a posture state (e. g, from supine to standing). In this example, injection circuitry <NUM> may be configured to inject a differential offset that cancels out changes in body interface since the auto-zero state <NUM>.

Injection circuitry <NUM> may be configured to inject a cancelling offset between the first stage amplifier <NUM> and second stage of amplifier <NUM>. Injecting the cancelling offset between first stage amplifier <NUM> and second stage of amplifier <NUM> may represent an improved operation compared to systems that inject the slowly varying cancelling offset before first stage amplifier <NUM> or after second stage of amplifier <NUM>. For example, when injection circuitry <NUM> injects the cancelling offset between first stage amplifier <NUM> and second stage of amplifier <NUM>, fidelity requirements may be relaxed compared to systems that inject the slowly varying cancelling offset before first stage amplifier <NUM> by, for example, having a partially amplified signal from first stage amplifier <NUM>. Moreover, when injection circuitry <NUM> injects the cancelling offset after second stage amplifier <NUM>, the allowed range of the amplifier stage <NUM> may be exceeded.

Injection circuitry <NUM> may be configured to generate the cancelling offset with a digital control loop. The digital control loop of <FIG> may be designed to realize a discrete time, single pole, high pass filter, with configurable pole location in the forward signal flow pathway. For example, injection circuitry <NUM> may be configured to generate the cancelling offset based on a set of waveforms (e.g., digital historical waveforms). For example, injection circuitry <NUM> may be configured to generate the cancelling offset based on a set of waveforms received by SAR ADC <NUM> of <FIG>.

Processing circuitry <NUM> may be configured to determine the weighted set of digital historical offsets of waveforms based on one or more previous sensing signals that occur before the sensing signal. For example, processing circuitry <NUM> may generate, for each waveform of a set of previous digital waveforms, a respective weighted digital historical offset to generate a set of weighted set of digital historical offsets of waveforms. Each of the respective weighted digital historical offset may be associated with a different previous "ping pulse cycle. " A ping pulse cycle may refer to a cycle of states <NUM>-<NUM> of <FIG>, where a waveform is sensed during signal acquisition state <NUM> using autozeroing techniques described herein during auto-zero state <NUM>.

For example, for a set of <NUM> previous ping pulse cycles, processing circuitry <NUM> may generate, for a first digital waveform associated with a first previous ping pulse cycle that occurs before a current ping pulse cycle, a first weighted digital historical offset by multiplying an offset of the first digital waveform by a first weight. In this example, processing circuitry <NUM> may generate, for a second digital waveform associated with a second previous ping pulse cycle that occurs before the first previous ping pulse cycle, a second weighted digital historical offset by multiplying an offset of the second digital waveform by a second weight. The second weight may be less than the first weight. In this example, processing circuitry <NUM> may generate, for a third digital waveform associated with a third previous ping pulse cycle that occurs before the second previous ping pulse cycle, a third weighted digital historical offset by multiplying an offset of the third digital waveform by a third weight. The third weight may be less than the second weight. While the above example uses <NUM> historical offsets, other examples may use <NUM> historical offset, <NUM> historical offsets, or more than <NUM> historical offsets (e.g., <NUM> historical offsets).

Injection circuitry <NUM> may be configured to generate the cancelling offset by applying a closed-loop control feedback using the weighted set of digital historical offsets of waveforms. For example, injection circuitry <NUM> may apply an integral controller (e.g., I controller) to the weighted set of digital historical offsets of waveforms to generate the cancelling offset.

<FIG> is a circuit diagram illustrating an example GMR amplifier <NUM>, in accordance with one or more techniques of this disclosure. GMR amplifier <NUM> may be an example of first amplifier stage <NUM> of <FIG>. GMR amplifier <NUM> may exhibit the following characteristics:.

To achieve these goals, the design of <FIG> does not use the more common bio-amplifier, low noise amplifier (LNA) approaches which utilize feedback. A common form of this is the capacitive feedback network (CFN). This is because CFN may cost significant extra power and may be slower with post-blocking state transient recovery. Instead, GMR amplifier <NUM> may use feedback's sister approach of invariance, where process parameters and temperature are made to drop out of the forward transfer function by having terms in the numerator and denominator cancel, by design, without feedback. This approach is targeted to the objectives above for the first gain stage. After the first stage, implementation approach is less important as the power required drops with gain squared for a targeted signal to noise amplitude ratio. Gain squared in this case may be <NUM>. The invariant GMR approach (gm (transconductance) * r(resistance)) may be highly suited to the of the first stage amplifier. The gain achievable by this circuit is limited, but this limitation works well with the analog offset injection control loop that requires offset be injected in a middle stage of amplification to avoid noise and fidelity sensitivities to injection, avoid limitations in the dynamic range of the system, and isolate this circuitry from degrading the <NUM> goals stated above for the input state.

Through the analysis below, the gain may be well controlled and be at least partially invariant to process variation and temperature. In fact, the gain is controlled by the ratio of two resistors which share the same process variation and is proportional the scaling of the IBIAS current sent to the amplifier. Signal to noise amplitude is observed to be proportional to the square root of the bias current sent to the different pair. By properly selecting the resistor ratio and current, required noise and gain can be independently targeted. Thus, GMR amplifier <NUM> may have no feedback in the forward signal path, which would have resulted in a slower and higher current system, yet may be controlled through the invariance technique. Also, the input impedance of GMR amplifier <NUM> may be matched and very high. <MAT> but <MAT> <MAT> so <MAT> where M<NUM> is a fraction of a bias gain (e.g., IBIAS*M), Rout is resistor <NUM>, and Rbias is resistor <NUM>.

<FIG> are pole-zero plane plots illustrating an example of an extraction of a sensing signal from a digitized waveform, in accordance with one or more techniques of this disclosure. In <FIG>, an additive linear artifact is described by <NUM> poles <NUM> at <NUM> on the unit circle, which may represent a linear line (see <FIG>). In <FIG>, any filter operation that has two zeroes <NUM> at one on the unit circle, removes the additive linear artifact of <FIG>. Any resulting measurement may be invariant to the presence of the artifact. An example solution for the invariant filter may include f(Z) = flp(z)(<NUM> - z-n)(<NUM> - z-m), where 'n'=<NUM> corresponds to a derivative (e.g., step <NUM>) and 'm' corresponds to a much larger number equal to the separation between peak and trough, of the derivative signal, in time steps, which may be implemented in step <NUM> of <FIG>.

Two example principles of extracting the ECAP amplitude value may include decreasing noise and aggressor content and making the measurement invariant to the presence of a time varying tissue intrinsic artifact. Noise and aggressor reduction may be achieved by: limiting the bandwidth with a digital low pass filter as thermal noise power (e.g., the dominant noise source) may be proportional to bandwidth and averaging waveforms as uncorrelated noise power decreases as <NUM>/N, where N is the number of waveforms averaged. The artifact at the body interface may be described as an offset + line + decaying exponential. In a small enough region of measurement, this is well approximated by a line with an offset. This artifact can vary with body position, time, and other factors. To have the measurement be invariant (e.g., not change with the artifact) the measurement may be invariant to the presence of an additive linear artifact.

<FIG> is a plot illustrating an example sensing signal <NUM>, in accordance with one or more techniques of this disclosure. In the example of <FIG>, processing circuitry <NUM> may calculate an amplitude value of a sensing signal (e.g., ECAP signal) as max derivative <NUM> between peak P2 and trough N1 and min derivative <NUM> between peak P2 and trough B2.

The nature of the low pass in the low passed derivative filter, preceding the peak - minus trough measurement, may be optimized for noise and artifact rejection, and signal strength based on a very large human database. The hardware implementation of a [<NUM>,<NUM>,-<NUM>] filter in cascade with an <NUM> tap symmetric FIR filter, may yield a general form <NUM> tap anti-symmetric filter, with the anti-symmetry implying <NUM> zero at <NUM> on the unit circle. This general form may be configured to realize the optimal filter determined from the human database, an optimized low passed derivative filter, where the low pass allows about <NUM> of content, in series with a discrete time derivative. The other zero at <NUM> on the unit circle of the measurement technique, for invariance to an additive linear artifact, may be achieved by a peak minus trough operation.

<FIG> is a flowchart illustrating an example operation for calibrating sensing circuitry of IMD <NUM>, in accordance with one or more techniques of this disclosure. <FIG> is discussed with <FIG> for example purposes only. Processing circuitry <NUM> may cause, when stimulation generation circuitry <NUM> does not provide electrical stimulation, storage of a first voltage at a first terminal <NUM> at first calibration capacitor <NUM> and storage of a second voltage at second terminal <NUM> at second calibration capacitor <NUM> (<NUM>).

After the first voltage is stored at the first calibration capacitor <NUM> and the second voltage is stored at the second calibration capacitor <NUM> and when the stimulation generation circuitry <NUM> provides the electrical stimulation, processing circuitry <NUM> may switch out (e.g., open a switch or refrain from generating a channel in a switching element) first calibration switch <NUM> to prevent the first voltage stored at first calibration capacitor <NUM> from changing and switch out second calibration switch <NUM> to prevent the second voltage stored at second calibration capacitor <NUM> from changing (<NUM>). For example, processing circuitry may open calibration switches <NUM>, <NUM> during stimulation (e.g., blocking state <NUM> of <FIG>), which may help to eliminate any path for a charge change on calibration capacitors <NUM>, <NUM>. As discussed further in <FIG>, first switches <NUM>, <NUM> may block or clamp the stimulation signal (e.g., ~<NUM> V ) from being received at inputs of amplifier circuitry <NUM> (e.g., first stage amplifier <NUM> of <FIG>). First switches <NUM>, <NUM> may be switched off during stimulation (e.g., blocking state <NUM> of <FIG>), which may also help to prevent a change in voltage stored at calibration capacitors <NUM>, <NUM>.

After the electrical stimulation is blocked and when stimulation generation circuitry <NUM> does not provide the electrical stimulation, processing circuitry <NUM> may determine, with sensing circuitry <NUM>, a sensing signal based on the first voltage at first terminal <NUM> offset by a first calibration voltage stored by first calibration capacitor <NUM> and based on second voltage at second terminal <NUM> offset by a second calibration voltage stored by the second calibration capacitor <NUM> (<NUM>). Processing circuitry <NUM> may cause stimulation generation circuitry <NUM> to deliver therapy to patient <NUM> based on the sensing signal (<NUM>).

<FIG> is a flowchart illustrating an example operation for amplifier circuitry, in accordance with one or more techniques of this disclosure. <FIG> is discussed with <FIG> for example purposes only. Switches <NUM>, <NUM> may receive a sensing signal (<NUM>). Switches <NUM>, <NUM> may block or clamp the received sensing signal from being received by first amplifier stage <NUM> (<NUM>). For example, switches <NUM>, <NUM> may block the received sensing signal from being received by first amplifier stage <NUM> during the blocking state <NUM>. In some examples, switches <NUM>, <NUM> may clamp the received sensing signal to be less than a component safe voltage range (e.g., during states <NUM>-<NUM>).

First amplifier stage <NUM> may amplify, for example, using a GMR amplifier, the sensing signal (<NUM>). When stimulation generation circuitry <NUM> provides electrical stimulation ("YES" of step <NUM>), blanking switches <NUM>, <NUM> may block the amplified sensing signal from being received by second amplifier stage <NUM> (<NUM>). For example, blanking switches <NUM>, <NUM> may block the amplified sensing signal from being received by second amplifier stage <NUM> while first switches elements <NUM>,<NUM> clamp the sensing signal to a threshold voltage range, such as, for example, a component safe voltage range.

In some examples, switches <NUM>, <NUM> may blank the input of first amplifier stage <NUM> at a time (e.g., at least <NUM>) beyond active recharge (e.g., at the end of blocking state <NUM> of <FIG>) and blanking switches <NUM>, <NUM> may blank an input of second amplifier stage <NUM> at a time (e.g., at least <NUM>) beyond the active recharge. For example, switches <NUM>, <NUM> may be configured to block the sensing signal after a first time delay from when stimulation generation circuitry <NUM> no longer provide the electrical stimulation. In this example, blanking switches <NUM>, <NUM> may be configured to block the sensing signal after a second time delay from when stimulation generation circuitry <NUM> no longer provide the electrical stimulation, where the second time delay is different from the first time delay. The second time delay may be longer than the first time delay.

When stimulation generation circuitry <NUM> does not provide electrical stimulation ("NO" of step <NUM>), at least second amplifier stage <NUM> may generate, using one or more amplifiers, a second amplified sensing signal from the amplified sensing signal (<NUM>). Processing circuitry <NUM> may cause stimulation generation circuitry <NUM> to deliver therapy to patient <NUM> based on the second amplified sensing signal (<NUM>).

<FIG> is a flowchart illustrating an example operation for feature extraction, in accordance with one or more techniques of this disclosure. <FIG> is discussed with <FIG> for example purposes only. Processing circuitry <NUM> may generate a waveform based on a sensing signal. For example, processing circuitry <NUM> may determine an averaged waveform from an amplified sensing signal (<NUM>). Processing circuitry <NUM> may perform a derivative operation on the averaged waveform, which supplies one zero at <NUM> on the unit circle (<NUM>).

Processing circuitry <NUM> may FIR filter, after performing the derivative operation, the averaged waveform to generate a FIR filtered waveform, thereby decreasing noise bandwidth (<NUM>). The FIR filter may primarily apply low-pass filtering. Processing circuitry <NUM> may apply a peak minus trough operation to the FIR filtered waveform to measure an amplitude value (e.g., an ECAP amplitude value) of the FIR filtered waveform, which supplies one zero at <NUM> on the unit circle, making the total measurement invariant to an additive linear artifact (<NUM>). As shown in <FIG>, a solution set for an invariant filter may include f(Z) = flp(z)(<NUM> - z-n)(<NUM> - z-m), where 'n'=<NUM> corresponds to a derivative (e.g., step <NUM>) and 'm' corresponds to a much larger number equal to the separation between peak and trough, of the derivative signal, in time steps (e.g., step <NUM>), which together is invariant to an additive linear artifact. That is, for example, (<NUM> - z-m) may correspond to subtracting the present value from the value m steps before (e.g., step <NUM>). The artifact may be from the body interface and may be described as an offset + line + decaying exponential. Processing circuitry <NUM> may cause stimulation generation circuitry <NUM> to deliver therapy to patient <NUM> based on the amplitude value (<NUM>).

<FIG> is a flowchart illustrating an example operation for providing therapy based on a sensing signal, in accordance with one or more techniques of this disclosure. <FIG> is discussed with <FIG> for example purposes only. During an auto-zero state, processing circuitry <NUM> may cause storage of a first voltage at a first terminal <NUM> at first calibration capacitor <NUM> and storage of a second voltage at second terminal <NUM> at second calibration capacitor <NUM> (<NUM>). Examples of causing storage of the first voltage and storage of a second voltage at second terminal <NUM> are described in <FIG>.

During a blocking state, blanking circuitry <NUM> may block or clamp the sensing signal (<NUM>). For example, when stimulation generation circuitry <NUM> provides electrical stimulation, blanking circuitry <NUM> may block or clamp the electrical stimulation from being received at amplifier circuitry <NUM> (e.g., an input of first amplifier stage <NUM> of <FIG>). In some examples, when stimulation generation circuitry <NUM> provides electrical stimulation, alternative blanking timing circuitry <NUM> may block the amplified sensing signal from being received by second amplifier stage <NUM>. In some examples, during the blocking state, processing circuitry <NUM> may switch out first calibration switch <NUM> to prevent the first voltage stored at first calibration capacitor <NUM> from changing and switch out second calibration switch <NUM> to prevent the second voltage stored at second calibration capacitor <NUM> from changing (see <FIG>).

During a signal acquisition state, IMD <NUM> may generate a sensing signal using the first calibration capacitor <NUM> and the second calibration capacitor <NUM> (<NUM>). For example, after the electrical stimulation is blocked and when stimulation generation circuitry <NUM> does not provide the electrical stimulation, processing circuitry <NUM> may generate, with sensing circuitry <NUM>, the sensing signal based on the first voltage at first terminal <NUM> offset by a first calibration voltage stored by first calibration capacitor <NUM> and based on second voltage at second terminal <NUM> offset by a second calibration voltage stored by the second calibration capacitor <NUM>.

During a signal acquisition state, IMD <NUM> may generate, using a GMR amplifier and one or more amplifiers, an amplified sensing signal based on the sensing signal (<NUM>). For example, first amplifier stage <NUM> may amplify, using a GMR amplifier, the sensing signal to generate a first amplified sensing signal and at least second amplifier stage <NUM> may generate, using one or more amplifiers (e.g., amplifier stages <NUM>-<NUM>), the amplified sensing signal from the first amplified sensing signal.

During a signal acquisition state, IMD <NUM> may generate, using an artifact filter with two zeroes at <NUM> on the unit circle, including a peak minus trough function, a feature based on the amplified sensing signal (<NUM>). For example, processing circuitry <NUM> may determine an averaged waveform from the amplified sensing signal and may FIR filter the averaged waveform to generate a FIR filtered waveform, which may improve an accuracy in determining the feature. In this example, processing circuitry <NUM> may filter out an artifact (e.g., from the artifact at the body interface) by applying one zero at <NUM> on the unit circle using a derivative operation (e.g., step <NUM>) and apply another zero at <NUM> on the unit circle by applying a peak minus trough operation (e.g., step <NUM>; see <FIG>, <FIG>).

During a governed therapy state, processing circuitry <NUM> may cause stimulation generation circuitry <NUM> to deliver therapy to patient <NUM> based on the amplitude value (<NUM>). For example, processing circuitry <NUM> may determine, based on the amplitude value (e.g., an ECAP amplitude value), a set of stimulation parameters, such as, for example, one or more of an electrode combination, a voltage amplitude value, or a current amplitude value, a pulse width, or a pulse frequency. The amplitude value may represent a function of how much the nerve responded to the stimulation. In this example, processing circuitry <NUM> may cause stimulation generation circuitry <NUM> to provide the stimulation with the set of stimulation parameters.

For example, various aspects of the described techniques may be implemented within one or more processors or processing circuitry, including one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or any other equivalent integrated or discrete logic circuitry, as well as any combinations of such components. A control unit including hardware may also perform one or more of the techniques of this disclosure.

In addition, any of the described units, circuits or components may be implemented together or separately as discrete but interoperable logic devices. Depiction of different features as circuits or units is intended to highlight different functional aspects and does not necessarily imply that such circuits or units must be realized by separate hardware or software components. Rather, functionality associated with one or more circuits or units may be performed by separate hardware or software components or integrated within common or separate hardware or software components.

Claim 1:
A system (<NUM>) for providing therapy to a patient, the system comprising
stimulation generation circuitry (<NUM>) configured to provide electrical stimulation to the patient:
sensing circuitry (<NUM>) configured to sense a first voltage at a first terminal and to sense a second voltage at a second terminal; and
processing circuitry (<NUM>) electrically connected to the sensing circuitry and the stimulation generation circuitry, the processing circuitry being configured to:
when the stimulation generation circuitry does not provide the electrical stimulation, cause storage of the first voltage at the first terminal at a first calibration capacitor (<NUM>) and storage of the second voltage at the second terminal at a second calibration capacitor (<NUM>);
after the first voltage is stored at the first calibration capacitor and the second voltage is stored at the second calibration capacitor and when the stimulation generation circuitry provides the electrical stimulation, switch out a first calibration switch (<NUM>) to prevent the first voltage stored at the first calibration capacitor from changing and switch out a second calibration switch (<NUM>) to prevent the second voltage stored at the second calibration capacitor from changing;
while the first calibration switch is switched out and the second calibration switch is switched out and when the stimulation generation circuitry does not provide the electrical stimulation, determine, with the sensing circuitry, a sensing signal based on the first voltage at the first terminal offset by a first calibration voltage stored by the first capacitor and based on the second voltage at the second terminal offset by a second calibration voltage stored by the second capacitor; and
cause the stimulation generation circuitry to deliver the therapy to the patient based on the sensing signal.