Disclosure of Invention
Aiming at the problems to be solved, the invention aims to provide an anti-epileptic electrical stimulation hardware-in-loop simulation system, compared with the system for directly testing a patient, the hardware-in-loop simulation system can simulate the test conditions close to the real environment, can repeatedly carry out the verification work of a control algorithm, greatly reduces the risk of clinical tests, and has an important promotion effect on the pre-clinical optimization of electrical stimulation.
In order to achieve the purpose, the invention adopts the technical scheme that an anti-epileptic electrical stimulation hardware-in-loop simulation system is provided, and is characterized in that: the simulation system also comprises an epilepsia electroencephalogram real-time generator (2), a signal acquisition module (18), an electrical stimulation controller (25) and an upper computer (38),
the epilepsia electroencephalogram real-time generator (2) is used for obtaining personalized model parameters in a physiological model of an epilepsia electroencephalogram patient through electroencephalogram data drive identification of the epilepsia patient, and further loading the personalized model parameters into a nerve cluster model to reproduce an epilepsia-like discharge signal (17);
the signal acquisition module (18) is used for converting a discharge signal (17) generated by the epilepsia electroencephalogram real-time generator (2) into a simulated electroencephalogram signal with the same amplitude-frequency characteristic as an electroencephalogram signal of a real epilepsia patient, converting the simulated electroencephalogram signal acquired in real time into a discrete digital signal and outputting the discrete digital signal to the electrical stimulation controller (25);
the electrical stimulation controller (25) is used for acquiring the digital signal output by the signal acquisition module, performing filtering processing on the digital signal, performing parameter identification and estimation on an individual neural cluster model by using an unscented Kalman filter, calculating an anti-epileptic stimulation signal through a PI control law, and applying the anti-epileptic stimulation signal to the epileptic electroencephalogram real-time generator (2) to reproduce the real response of a clinical epileptic patient after being electrically stimulated;
the upper computer (38) comprises a human-computer interaction interface (39), the human-computer interaction interface (39) is realized by the upper computer (38) through LabVIEW programming, and data interaction is carried out with the electrical stimulation controller (25) through the SCI serial port communication module (37) to complete data communication and waveform display.
The epilepsia electroencephalogram real-time generator (2) is composed of a plurality of DSP chips, each DSP chip is responsible for reproduction of two epilepsia electroencephalogram signals, two personalized neural cluster models (9) are embedded into each DSP chip, the number of channels output by the epilepsia electroencephalogram real-time generator (2) corresponds to the epilepsia electroencephalogram derivative to be researched, and each personalized neural cluster model is identified by a unscented Kalman filter according to corresponding electroencephalogram signal parameters.
The epilepsia electroencephalogram real-time generator (2) has eight output channels in total, generates 8 paths of recurrent epilepsia-like discharge signals (17) which represent the individual specificity of an epileptic patient, and acquires anti-epilepsia stimulation signals generated by the electrical stimulation controller (25) in real time through the AD module of the corresponding DSP chip, thereby replicating the real response of a clinical patient after being electrically stimulated.
The signal acquisition module (18) comprises a signal conversion module (19) and a signal real-time acquisition amplification module (24), the signal conversion module uses a four-stage voltage division follower circuit, four low-noise two-channel AD8606 amplifiers are used as voltage followers, and the amplitude of an analog signal output by the epilepsia electroencephalogram real-time generator (2) is compressed to complete signal conversion;
the electroencephalogram signal real-time acquisition module (24) adopts ADS1299 as an acquisition chip, and selects an ADS1299-FE suite as a signal real-time acquisition amplification module (24), so that the acquisition, amplification, analog-to-digital conversion of 8 paths of analog signals and the communication with the signal processing module (26) are completed.
Compared with the prior art, the invention has the beneficial effects that:
the simulation system realizes real-time simulation verification of an electrostimulation closed-loop control strategy for epileptic patients. An individual nerve cluster model of an epileptic is identified based on data drive, an epileptic electroencephalogram real-time generator and a signal conversion module are designed by combining a hardware-in-loop idea, real-time epileptic electroencephalograms matched with physical characteristics (amplitude, time scale and noise) of electroencephalograms of the epileptic are reproduced, an in-loop real-time electrical stimulation controller is designed, a PI control strategy based on online identification of an unscented Kalman filter is realized, and the epileptic closed-loop control clinics is promoted. The research innovatively provides an anti-epileptic electrical stimulation hardware-in-the-loop simulation system, which has the following advantages:
1. the system can reproduce analog signals with the same characteristics of electroencephalogram signals of epileptics in time domains and frequency domains, and performs real-time closed-loop control;
2. the system adopts the DSP chip to process and transmit data, ensures a reliable data transmission mechanism in the experimental process and meets the real-time property and stability of mass data interaction;
3. in the epilepsia electroencephalogram real-time generator and the electrostimulation controller, the used high-speed memories are flash modules in the DSP, the modules have high reading and writing speed, internal programs cannot be erased due to re-electrification, high-speed storage is realized, the system has a memory space for storing a large amount of data and instructions, high-performance hardware resources (multifunctional peripheral interfaces and digital signal processing resources) which are easy to expand, and the realizability and the execution efficiency of the algorithm are ensured.
4. The invention adopts a lumped parameter model for simulating the interaction among different neuron clusters. The lumped parameter model models the neural cluster network by the idea of 'mean field approximation', and the sub-cluster state in the neural cluster model is described by the excitability or inhibitivity mean membrane potential and the mean discharge rate; the connection coefficient between the sub-clusters represents the average number of synaptic connections; adjusting the model parameters can alter the interaction of excitatory neuron sub-clusters and inhibitory neuron sub-clusters, thereby causing the model to produce rhythmic oscillations; the neural cluster model has the advantages that the rhythm characteristics of epileptic activity are simulated through the rhythm change of the cluster, so that overlarge calculated amount and high dimensionality in the micro model are avoided, and the neural cluster model is suitable for describing epileptic electroencephalogram states. The problems of complexity, high dimensionality and incapability of simulating larger-scale electrical activity caused by using detailed biophysical parameter research on a microscopic level are avoided.
The structure of the neural cluster model can be established according to the anatomical and electrophysiological bases, and the method adopts a data driving strategy to obtain corresponding model parameters from the electroencephalogram signals containing noise. The unscented Kalman filtering is used for the parameter identification problem of the epilepsy model, and the unscented Kalman filtering completes the estimation process of key parameters by calculating a state estimation value on line, observing the estimation value and updating Kalman gain. Compare in least square estimation to discern the EEG signal, be applicable to and discern complicated electrophysiological activity, for the PSO algorithm discerns the EEG signal, can not consume a large amount of memory in the numerical simulation, this application system has realized the preliminary verification of hardware in the loop simulation platform.
The invention completely utilizes real clinical electroencephalogram data drive of epileptics, uses a data drive identification strategy-unscented Kalman filter to identify an individualized nerve cluster model, establishes a model reflecting individual differences of different patients, builds an anti-epileptic seizure hardware-in-the-loop simulation system, completes an anti-epileptic electrical stimulation hardware-in-the-loop experiment, and has important significance for treating epilepsia in the later period.
An individual nerve cluster model of an epileptic is obtained based on a data-driven identification strategy, an epileptic electroencephalogram real-time generator and a signal conversion module (digital-to-analog conversion and four-stage voltage division following circuit) are designed by combining a hardware-in-the-loop idea, and real-time epileptic electroencephalogram matched with physical characteristics (amplitude, time scale and noise) of an electroencephalogram signal of the epileptic is reproduced.
The invention uses a plurality of DSPs, the DSPs are serial operation, the DSPs can carry out complex nonlinear operation and can complete high-precision floating point operation, and the development efficiency is faster by using C language programming. According to the invention, the core device is subjected to model selection, the design and the construction of interfaces among modules (DAC, ADC and SCI modules in DSP are used) and the PCB design of a signal conversion module according to the aspects of the computing performance and the real-time performance of the system. Because the digital signal received by the signal real-time acquisition and amplification module (24) and transmitted by the SPI is a microvolt brain electrical signal, a large amount of high-frequency noise and power frequency interference are mixed in the signal, in order to ensure the accuracy of the signal, a real-time digital filter needs to be designed in the signal processing module (26) to remove the high-frequency interference, and a Butterworth low-pass IIR digital filter is selected for filtering, so that the accuracy of the system is improved.
Detailed Description
The anti-epileptic electrical stimulation hardware-in-the-loop simulation system of the present invention is further described in detail with reference to the accompanying drawings.
The invention relates to a design idea of an anti-epileptic electrical stimulation hardware-in-the-loop simulation system, which is characterized in that firstly, an epileptic patient electroencephalogram signal (1) is subjected to data driving, a personalized nerve cluster model is established based on data driving identification, a differential equation of the model is solved in a DSP (digital signal processor) by using a four-order Runge Kutta algorithm, an epileptic sample discharge signal is simulated, embedded realization (10) of the model is completed, and a recurrent epileptic sample discharge signal (17) is output; then, a signal conversion module (19) reduces the voltage of a reproduced epileptic sample discharge signal generated by the epileptic electroencephalogram real-time generator (2), converts the reproduced epileptic sample discharge signal into a simulated electroencephalogram signal with the same amplitude-frequency characteristic as the real electroencephalogram signal, and reproduces the clinically acquired real electroencephalogram signal; weak analog electroencephalogram signals are acquired in real time by a signal real-time acquisition and amplification module (24), the continuously changed analog electroencephalogram signals are converted into discrete digital signals, communication with a signal processing module (26) is completed by a high-speed digital communication interface, and the signal processing module (26) filters the acquired signals to eliminate high-frequency interference; the controller module (27) calculates an anti-epileptic stimulation signal through a PI control law (30) based on the average excitatory synapse gain feedback of a key physiological parameter, and applies the anti-epileptic stimulation signal to the epileptic electroencephalogram real-time generator (2); and finally, designing a human-computer interaction interface (39) of the upper computer, transmitting the multi-channel discharge signals received in the controller module (27) to the upper computer (38) at the same time, and displaying the multi-channel discharge signals on the human-computer interaction interface (39) through different waveform charts.
The individuation in the application refers to identifying an individuation model parameter, namely average excitatory synapse gain, in a physiological model corresponding to an epileptic according to data driving of electroencephalogram signals of the epileptic, substituting the identified average excitatory synapse gain into a neural cluster model in a DSP (real-time generator for epileptic electroencephalogram), and constructing to obtain an individuation neural cluster model (9), wherein the identification of the individuation model parameter is also carried out by using an unscented Kalman filter.
The anti-epileptic electrical stimulation hardware-in-loop simulation system comprises an epileptic electroencephalogram real-time generator 2, asignal acquisition module 18, anelectrical stimulation controller 25 and anupper computer 38, wherein the epileptic electroencephalogram real-time generator 2 converts an input EEG signal of an epileptic patient into a reproduced epileptic sample discharge signal through a data driving identification strategy and embedded implementation of a model, the discharge signal acquisition and processing are carried out, epileptic sample discharge of a personalized nerve cluster model is inhibited through a PI closed-loop control strategy (figure 5) based on an unscented Kalman filter, the program flow of each module is realized by C language programming and is compiled and downloaded into a DSP, communication between the upper computer and theelectrical stimulation controller 25 is completed through a LabVIEW platform, and the upper computer is mainly used for data communication and waveform display and real-time display control effect.
The epilepsia electroencephalogram real-time generator (2) comprises an individualized nerve cluster model 9, an embeddedimplementation 10 of the model and a recurrent epileptic-like discharge signal 17, the epilepsia electroencephalogram real-time generator (2) uses DSP-TMS 320F28377DPTP as a Micro Control Unit (MCU) to replicate the physiological activity of a neuron cluster in a brain of a patient during epileptic seizure to obtain the individualized nerve cluster model (9), the embedded implementation (10) of the model converts the solving process of a nonlinear constant differential equation, namely the individualized nerve cluster model, into iterative calculation of a differential equation by adopting a four-step dragon-Kutta (Runge-Kutta) algorithm in the DSP, and generates 8 recurrent epileptic-like discharge signals (17) representing the individual specificity of the epileptic patient by using 8 DACs (Digital-to-Analog converters, DACs) of 4 DSPs as output channels, the signal is output to a signal conversion module (19), and an anti-epileptic stimulation signal generated by the electrical stimulation controller (25) is acquired in real time through an Analog-to-Digital Converter (ADC) and an AD module of the DSP chip, so that the real response of a clinical patient after being electrically stimulated is reproduced. The epilepsia electroencephalogram real-time generator is provided with four independent DSPs which work simultaneously, each DSP uses 2 DAC output channels, two personalized neural cluster models are embedded into each DSP, each DSP is responsible for construction of the personalized neural cluster models of two electroencephalogram signals (epilepsia signals), each personalized neural cluster model identifies corresponding electroencephalogram signal parameters through an unscented Kalman filter, corresponding epilepsia-like discharge signals are reproduced, the epilepsia electroencephalogram real-time generator outputs eight epilepsia-like discharge signals in total, each epilepsia-like discharge signal is connected with asignal acquisition module 18, and output signals of all the signal acquisition modules are sent to an electrical stimulation controller.
The signal conversion module (19) uses four-stage voltage division follower circuit, adopts four low-noise two-channel AD8606 amplifiers as voltage followers, compresses the amplitude of the simulated epileptic sample discharge signal output by the DAC of the output channel of the epileptic electroencephalogram real-time generator, completes signal conversion, and meets the design requirement.
The chip model of the signal real-time acquisition and amplification module (24) is ADS1299, the signal real-time acquisition and amplification module comprises an ADS1299 chip and an ADS1299-FE suite of TI company, can complete acquisition, amplification and analog-to-digital conversion of 8 paths of analog signals and communication with the signal processing module (26), and meets the design requirements. In the embodiment, the electroencephalogram data of the electroencephalogram signals (1) of the epileptic patients are derived from PhysioNet, the Ali Shoeb acquires the scalp electroencephalograms of 22 epileptic patients in the Boston child hospital, and uploads a data set to the PhysioNet, the acquired electroencephalogram signals are 23-lead data, and the acquisition frequency is 256 Hz.
The real electroencephalogram data of the epileptic patient used in the construction of the loop simulation system come from 8-lead electroencephalogram signals with more regular epileptic-like discharge in 23-lead data, and 8 paths of epileptic-like discharge signals need to be reproduced. In addition, the arrangement of 8 paths can meet the real-time requirement of a DSP chip, and the control signal (anti-epileptic stimulation signal) in one control period can be calculated by the electric stimulation controller within 4ms (ADS1299) of one sampling period.
The electric stimulation controller (25) is also realized by adopting a DSP, the model of a chip is TMS320F28377DPTP, and a DAC (digital-to-analog converter) of the TMS320F28377DPTP outputs analog signals, and the analog signals are subjected to data interaction with an upper computer (38) through an SCI (serial interface communication) module (37), so that the design requirement is met. The electrical stimulation controller (25) comprises a signal processing module (26) and a controller module (27),
the signal processing module (26) receives digital signals transmitted by the signal real-time acquisition and amplification module (24) through the SPI, the acquired signals are microvolt brain electrical signals, a large amount of high-frequency noise and power frequency interference are mixed in the signals, a Butterworth low-pass Infinite unit Impulse Response (IIR) digital filter is designed to remove the high-frequency interference, communication with the signal acquisition module (18) is completed, and data are processed.
The controller module (27) comprises an unscented Kalman filter (8) and a PI control law (30), and the identification of a key physiological parameter, namely average excitatory synaptic gain, is completed through an unscented Kalman filtering parameter estimation algorithm; and adjusting the stimulation signals in real time through an incremental PI control law according to the deviation of the parameter estimation value and the expected value, outputting anti-epileptic stimulation signals to an epileptic electroencephalogram real-time generator (2) which is a controlled object, calculating the control signals through the PI control law (30), and outputting the anti-epileptic stimulation signals to be applied to the personalized nerve cluster model through a DAC (digital-to-analog converter) of the electrical stimulation controller.
The human-computer interaction interface (39) is realized by using a LabVIEW platform, data interaction between the upper computer (38) and the SCI serial port communication module (37) of the DSP is realized by using a VISA (Virtual Instrument Software Architecture) library, and functions such as VISA serial port configuration, VISA reading and VISA writing are mainly applied. A data identification bit is added before the highest bit of the serial port sending data, and the upper computer (38) displays the waveform of the 8-channel data by identifying the data identification bit, so that the real-time communication with the controller module (27) is realized.
The overall implementation of the anti-epileptic electrical stimulation hardware-in-the-loop simulation system of the present invention is described below:
as shown in figure 1, the simulation system structure of the invention is designed, a DSP-TMS 320F28377DPTP chip of TI company is selected as the MCU of the epileptic electroencephalogram real-time generator, the epileptic electroencephalogram (1) establishes an individualized nerve cluster model (9) through a data drive identification strategy, the embedded realization (10) of the model is completed by adopting a four-stage Runge-Kutta algorithm in the DSP, the epileptic sample discharge signal (17) is reproduced, a signal conversion module (19) reduces the voltage of the simulated epileptic sample discharge signal generated by the epileptic electroencephalogram real-time generator (2) and converts the simulated epileptic sample discharge signal into a simulated electroencephalogram signal with the same amplitude-frequency characteristic as the real electroencephalogram signal, the clinically collected real electroencephalogram signal is reproduced, a signal real-time acquisition amplification module (24) is used for acquiring weak simulated electroencephalogram signals and converting the weak simulated electroencephalogram signals into discrete digital signals, and a high-speed digital communication interface of the DSP is used for completing the, and the acquired signals are amplified and eliminated through filtering, the controller module (27) calculates anti-epileptic stimulation signals through PI control based on average excitatory synapse gain which is a key physiological parameter feedback, the anti-epileptic stimulation signals are applied to the epileptic electroencephalogram real-time generator (2), the received 8-channel discharge signals are transmitted to an upper computer (38) through an SCI serial port communication module (37), and the signals are displayed on a human-computer interaction interface (39) through different waveform charts. After the loop simulation system is constructed, the real-time electroencephalogram signal of the epileptic can be used for the later-stage epileptic treatment, the real electroencephalogram signal of the epileptic is directly input into the signal real-time acquisition andamplification module 24 and then enters theelectrical stimulation controller 25 for processing, and then the processed signal is directly acted on the electroencephalogram of the epileptic, so that the electrical stimulation controller can be used for clinical experiments.
In the embodiment of the invention, the used DSPs are TMS320F28377DPTP, the epileptic brain electrical real-time generator uses 4 TMS320F28377DPTP, and the electrical stimulation controller uses 1 TMS320F28377 DPTP.
As shown in fig. 2, for an epileptic patient electroencephalogram data driving identification strategy, firstly, to remove noise and artifacts of an epileptic patient electroencephalogram signal (1), data preprocessing (3) needs to be performed on the electroencephalogram signal, and data interception (4), artifact removal (5) and mean value elimination (6) are respectively performed to obtain preprocessed epileptic patient electroencephalogram data. The neural cluster model (7) can be used for generating simulated electroencephalogram signals of various states such as epileptic seizure and non-seizure, and is composed of a pyramidal neuron sub-cluster, an inhibitory interneuron sub-cluster and an excitatory interneuron sub-cluster, each sub-cluster is composed of two basic operators of a second-order linear transfer function and a nonlinear Sigmoid function (S (·)), and the dynamic characteristic of the neural cluster model (7) is represented by the following differential equation:
in the formula: x (t) represents the output signal of the second order linear transfer function, x represents six state variables, which satisfy the relationship of equation (1), "-" represents the derivative; c1,C2,C3,C4Representing the sub-clusters and the middle of pyramidal neuronsAn average number of synaptic connections between the subset of neurons; a represents the average excitatory synaptic gain, a parameter of physiological significance in the neural cluster model (7); a represents the mean excitability time constant; b represents the average inhibitory synaptic gain; b represents the average inhibitory time constant. The output equation of the model is:
y(t)=x1(t)-x2(t) (2)
in the formula: y (t) represents the post-synaptic membrane potential of the subset of pyramidal neurons simulating the brain electrical signal.
And secondly, integrating the electroencephalogram data of the patient and the neural cluster model (7) by using an unscented Kalman filter (8), completing state identification and parameter estimation in real time, and performing linear transformation on the electroencephalogram data before estimation to keep the range of the electroencephalogram data consistent with the range of output signals of the neural cluster model, thereby finally obtaining the personalized neural cluster model (9).
The estimation steps of the unscented Kalman filter (8) on the parameter A are as follows:
(1) initializing the filter: the initial value of the state vector estimate is
Can be set to 0; state covariance matrix
The initialization of (a) is as follows:
in the formula: qrRepresenting parameter uncertainty; q represents process noise.
(2) And (3) state vector prediction: in order to solve the problem that the matrix is not positively definite when the square root of the state covariance matrix is solved, the state covariance matrix at the previous moment is subjected to SVD (singular value decomposition), and a Sigma point X is calculated as follows:
in the formula: x is (n)x+nq)×2(nx+nq) A matrix of (a); n isXThe number of model states; n isqThe number of the parameters to be estimated; n represents the sum of the number of model states and the number of parameters to be estimated. Substituting the Sigma point X into the nonlinear state equation f (namely formula (1)) of the nerve cluster model (7), and weighting to obtain a new vector point set Zn-1|n-1As follows:
in the formula: u. of
nIs an input to the system. State vector predictor
As follows:
state covariance matrix prediction
As follows:
(3) and (3) observation vector prediction:
in the formula: h represents an observation matrix; and R is observation noise.
(4) Updating a Kalman filter: gain K of P-KarmannUpdating:
for state vector estimation value
-performing an update:
updating the state covariance matrix:
(5) and (4) returning to the step (2).
As shown in fig. 3, for the embedded implementation of the personalized neural cluster model, a differential equation is solved online by using a fourth-order Runge-Kutta algorithm in a DSP of the epileptic electroencephalogram real-time generator (2), and an analog epileptic-like discharge signal is output in real time through a DAC of the DSP, which is divided into five parts: firstly, setting an average excitability synapse gain value in an individualized nerve cluster model, initializing all variables (Gaussian white noise mean variance and parameters in the model) to complete parameter initialization of the individualized nerve cluster model (11), then, in order to simulate the external input in the personalized nerve cluster model, Gaussian white noise (12) is generated, a stimulation signal collected by an AD module (13) in the DSP is substituted into a differential equation of the personalized nerve cluster model, and (3) performing model differential equation solving (14) through a four-order Runge-Kutta numerical integration algorithm to obtain an output solution at a corresponding moment, and finally performing cyclic calculation (16) (calculation along with time lapse) to convert the model output into a voltage signal representing rhythmic epileptiform discharge by using a DAC (digital-to-analog converter) in a DSP (digital signal processor) of the epileptic brain electricity real-time generator (2), namely generating a simulated epileptiform discharge signal (15).
As shown in FIG. 4, the voltage reduction circuit of the signal conversion module (19) is provided, the amplitude range of the electroencephalogram signal of the epileptic is 0-1600 μ V, and the signal amplitude needs to be compressed in order to enable the platform to reproduce the real electroencephalogram signal of the epileptic. If directly aiming at personalized nerves in DSPDigital scaling is carried out on digital output signals of the cluster model, the range of analog signals output by the DAC is 0-3.3V, the range of digital quantity is 0-4095, and the data precision is seriously influenced by 1000-time reduction, so that a first-stage voltage division following circuit (20), a second-stage voltage division following circuit (21), a third-stage voltage division following circuit (22) and a fourth-stage voltage division following circuit (23) are used, and the four voltage division following circuits are completely identical and connected in sequence, wherein R1、R2、R3、R4、R5、R6、R7、R8For each stage of the resistor, V, of the voltage-dividing follower circuitinFor input voltage, VoutFor the output voltage, the relationship is as follows:
in order to improve the driving capability of the circuit and enhance the anti-interference characteristic, a low-noise dual-channel AD8606 amplifier of ADI company is selected for the chip, and four operational amplifiers are used as voltage followers to complete signal conversion.
As shown in FIG. 5, which is a block diagram of a PI closed-loop control strategy based on an unscented Kalman filter, in order to control a parameter of an average excitatory synaptic gain which cannot be directly observed, an EEG signal measurement value (33) formed by measurement noise (32) and an output signal of a personalized neural cluster model is calculated by using the unscented Kalman filter (8) in consideration of interference of input noise (35) which may occur in the system before control,
the controller module (27) uses a PI control law (30) to adjust the control signal based on an error signal (29) between a desired parameter value (28) and an estimated parameter value (36) of the unscented Kalman filter (8). In the closed-loop control strategy, an output signal of a controller module (27) (namely, an output signal of a PI control law) is input into an individualized nerve cluster model as an inhibitory external input, meanwhile, an average presynaptic pulse density of an incoming action potential from an adjacent or remote cluster is used as a model input (34), the inhibitory external input and the model input are jointly applied into the individualized nerve cluster model (9), the input of an unscented Kalman filter is a random signal, and therefore, system noise (31) needs to be added into the individualized nerve cluster model (9) to enable the unscented Kalman filter to have a good identification effect.
The man-machine interface (39) shown in fig. 6 uses a LabVIEW platform of NI corporation to complete data communication between the upper computer (38) and the controller module (27) and waveform display of data. The human-computer interaction interface (39) comprises a serial port parameter configuration interface (40), a VISA resource configuration interface (41) and a waveform display interface (42), and serial port baud rate, data bits and stop bits are configured on the serial port parameter configuration interface (40); a VISA resource configuration interface (41), wherein the reading controller module (27) outputs a signal to the human-computer interaction interface through the SCI serial port communication module (37) to complete data reading and conversion, and the interface in fig. 6 includes:
port number (com7, port for configuring communication between upper computer andelectrical stimulation controller 25, fixed)
Stop button (stop communication, stop reading channel data)
A reading window (at the current moment, 8-bit unsigned integer data is received (serial port transmission, 8-bit data is transmitted once, decimal representation is carried out, 8 times are transmitted in one channel, single-channel data is displayed in the figure, the type is judged according to the first bit in the data, the data is numbered from 0, 0 represents a first channel, 1 represents a second channel, the like is carried out, the sampling period is 4ms, the processing is fast, and the acquisition of all eight channels is completed within 4 ms),
read buffer (64-bit floating-point data (hexadecimal representation) of the collected data, the data changing at any time during the data collection process)
Result display area (analog signal value of collected data, unit V));
the upper computer (38) judges the data type (8 channels including thechannel 1 to thechannel 8, and the 8 channels respectively correspond to the control effect corresponding to the selected 8-channel real epileptic electroencephalogram data), transmits the data to a waveform display interface (42), completes waveform display of the 8-channel data, and finally clears the data in the reading buffer zone by means of a clear function in a VISA library. The human-computer interaction interface can display in real time and observe the control effect.
The simulation system of the invention has the following advantages:
(1) the invention provides a hardware-in-loop-based real-time simulation scheme for simulating an electrical stimulation optimization experiment aiming at an epileptic under a near-real environment, repeatedly verifying a control algorithm and reducing the risk of a human body experiment, and develops a set of verification and optimization system of an anti-epileptic electrical stimulation control strategy;
(2) an individual nerve cluster model of an epileptic is identified based on data driving, an epileptic electroencephalogram real-time generator and a signal conversion module (digital-to-analog conversion and voltage reduction circuit) are designed by combining the idea of hardware-in-the-loop, and real-time epileptic electroencephalogram matched with physical characteristics (amplitude, time scale and noise) of an electroencephalogram signal of a patient is reproduced;
(3) an on-loop real-time electrical stimulation controller is designed, a PI control strategy based on unscented Kalman filter online identification is realized, and the system provides a real-time simulation verification platform for anti-epileptic closed-loop control.
The invention is described as being applicable to the prior art.