Method and software to determine probability of sleep/wake states and quality of sleep and wakefulness from an electroencephalogram

09763589 · 2017-09-19

Assignee

Inventors

Cpc classification

International classification

Abstract

Method and software are provided to format a probability index that reflects where an electroencephalogram (EEG) pattern lies within the spectrum of wakefulness to deep sleep, which employs a computer/microprocessor that performs frequency domain analysis of one or more discrete sections (Bins) of the EEG to determine the EEG power at specified frequencies, optionally calculates the total power over specified frequency ranges, assigns a rank to the power at each frequency, or frequency range, assigns a code to the Bin that reflects the ranking of the different frequencies or frequency ranges, and determines an index that reflects where said EEG pattern within said Bin(s) lies within the spectrum of wakefulness to deep sleep by use of a reference source, such as a look-up table or other suitable decoding instrument. The reference source is obtained by calculating the probability of Bins with different codes occurring in epochs scored as awake or asleep in reference files scored by one or more expert technologists or by an automatic scoring software.

Claims

1. A method for determining the probability of an electroencephalogram (EEG) pattern within an EEG test record of a subject having occurred in sections of reference EEG records scored previously as awake or EEG arousals, said method employing a computer/microprocessor that: performs frequency domain analysis of one or more discrete sections of the EEG test record to determine EEG test record power at specified frequencies, calculates EEG test record power over specified frequency-bands, assigns, for each specified frequency band, a rank to the calculated power-in each discrete section of the specified frequency band, each rank being determined based on values of power encountered in a plurality of the previously scored reference EEG records, assigns a code to each discrete section that reflects the ranking of the calculated powers in different frequency bands, incorporates a database/lookup table constructed from previously scored reference EEG records that indicates the probability of each code to occur in sections of said reference EEG records scored previously as awake or EEG arousals, determines, for each assigned code, the probability indicated in the database/lookup table that corresponds to the assigned code, and reports the determined probabilities that reflect the probability of the electroencephalogram (EEG) pattern within the EEG test record of the subject having occurred in sections of reference EEG records scored previously as awake or EEG arousals.

2. The method of claim 1 wherein probabilities of codes assigned to more than one discrete section are averaged over specified intervals.

3. The method of claim 1 further comprising using the reported probabilities as a component of another system that determines stages of sleep, respiratory events, arousals, cardiac arrhythmias, or motor events during sleep.

4. The method of claim 1 further comprising outputting the probabilities after the EEG test record has been analyzed.

5. The method of claim 4 wherein the probabilities are outputted in real time as streaming data and loaded in computer memory.

6. A non-transitory computer readable medium embodying program code that when executed by a computer or microprocessor, performs the operations of: performs frequency domain analysis of one or more discrete sections of the EEG test record to determine EEG test record power at specified frequencies, calculates EEG test record power over specified frequency bands, assigns, for each specified frequency band, a rank to the calculated power in each discrete section of the specified frequency band, each rank being determined based on values of power encountered in a plurality of the previously scored reference EEG records, assigns a code to each discrete section that reflects the ranking of the calculated powers in different frequency bands, determines, for each assigned code, a probability indicated in a database/lookup table that corresponds to the assigned code, the database/lookup table being constructed from previously scored reference EEG records that indicates the probability of each code to occur in sections of said reference EEG records scored previously as awake or EEG arousals, and reports the determined probabilities that reflect the probability of the electroencephalogram (EEG) pattern within the EEG test record of the subject having occurred in sections of reference EEG records scored previously as awake or EEG arousals.

7. The non-transitory computer readable medium of claim 6 wherein the operations further comprise averaging probabilities of codes assigned to more than one discrete section over specified intervals.

8. The non-transitory computer readable medium claim 6 wherein the operations further comprise using the determined probabilities as a component of another system that determines stages of sleep, respiratory events, arousals, cardiac arrhythmias, or motor events during sleep.

9. The non-transitory computer readable medium of claim 6 wherein the operations further comprise outputting the determined probabilities after the EEG test record has been analyzed.

10. An apparatus comprising: memory embodying computer executable code; and a microprocessor configured to communicate with said memory and to execute said code to cause said apparatus to: perform frequency domain analysis of one or more discrete sections of an EEG test record of a subject to determine EEG test record power at specified frequencies, calculate EEG test record power over specified frequency bands, assign, for each specified frequency band, a rank to the calculated power in each discrete section of the specified frequency band, each rank being determined based on values of power encountered in a plurality of reference EEG records scored previously as awake or EEG arousals, assign a code to each discrete section that reflects the ranking of the calculated powers in different frequency bands, determine, for each assigned code, a probability indicated in a database/lookup table that corresponds to the assigned code, the database/lookup table being constructed from previously scored reference EEG records that indicates the probability of each code to occur in sections of said reference EEG records scored previously as awake or EEG arousals, and report the determined probabilities that reflect the probability of an electroencephalogram (EEG) pattern within the EEG test record of the subject having occurred in sections of reference EEG records scored previously as awake or EEG arousals.

11. The apparatus of claim 10 wherein the apparatus is further caused to average probabilities of codes assigned to more than one discrete section over specified intervals.

12. The apparatus of claim 10 wherein the apparatus is further caused to use the determined probabilities as a component of another system that determines stages of sleep, respiratory events, arousals, cardiac arrhythmias, or motor events during sleep.

13. The apparatus of claim 10 wherein the apparatus is further caused to output the determined probabilities after the EEG test record has been analyzed.

14. The apparatus of claim 13 wherein the determined probabilities are outputted in real time as streaming data.

15. The apparatus of claim 10 wherein said apparatus is a portable device that measures EEG activity of the subject.

Description

BRIEF DESCRIPTION OF DRAWINGS

(1) FIG. 1 is a block diagram of the major components of software and the data flow in the analysis of processing records to determine ORP;

(2) FIG. 2 is a block diagram showing various pre-processing options;

(3) FIG. 3 is a block diagram of the algorithm for removing the R-wave artifact;

(4) FIG. 4 is a block diagram showing the steps used for Frequency domain analysis;

(5) FIG. 5 is a flow chart of the step of “Calculate Summary Powers”;

(6) FIG. 6 is a block diagram showing the assign Bin Code;

(7) FIG. 7 is a flow chart showing the step of assigning the ORP values

(8) FIGS. 8a-b shows the typical results of ORP values over several hours of recording for two patients with the results of conventional sleep scoring into five stages (awake, N1, N2, N3, REM);

(9) FIG. 9 is a flow chart showing the processing of streaming data for ORP determination;

(10) FIG. 10 is a block diagram of the components of a mobile device that implements the present invention;

(11) FIGS. 11a-d shows details of the Front End Analog Circuitry of the instrument of FIG. 10;

(12) FIGS. 12a-c shows details of the micro-controller and associated circuitry of the instrument of FIG. 10;

(13) FIGS. 13a-d shows details of the power supply and associated circuitry for the instrument of FIG. 10; and

(14) FIGS. 14a-q is the ORP Table.

DESCRIPTION OF PREFERRED EMBODIMENTS

(15) 1) Analysis of Pre-Existing Records:

(16) This form of implementation is particularly suitable when this invention is used on pre-existing files or when the generation of the Probability Value is a preliminary step to be followed by more detailed analysis of the EEG that require examination of large sections of the file (e.g. as an aid to scoring sleep stages). This form of implementation is preferably done on standard computers.

(17) The software of the preferred embodiment was developed in C# (C sharp) on a standard desktop computer with the following specifications:

(18) 1) Processor: 3.4 GHz

(19) 2) RAM: 4 GB

(20) 3) Operating System: Windows XP, 32-bit

(21) 4) Development Environment: Visual Studio 2008

(22) 5) Hard Drive Size: 1.00 TB

(23) FIG. 1 is a block diagram of the major components of the software and the data flow. The file is loaded in memory (1). The next step involves optional pre-processing (2) (See FIG. 2). The file is then split into 3-sec bins (3) with a total number, M, corresponding to ⅓ file length in seconds. Beginning with the first bin (4) frequency domain analysis is performed (5) (sec FIG. 4) followed by calculation of total power in different frequency ranges (6) (see FIG. 5). From this, bin code is assigned (7) by reference to lookup table 1, which is stored in memory. This is followed by determination of ORP for the 3-sec bin (8) (see FIG. 7), by reference to the stored ORP lookup table. The ORP value is stored (9). Bin number is increased by one and the process repeats until the end of the file.

(24) FIG. 2 shows the various pre-processing options (2). One or more of these is executed depending on the pre-existing properties of the file. These properties are inputted into the computer along with the file.

(25) The hand-pass filter (0.3-35.0 Hz) option (10) is applied if the file in memory is not pre-filtered. This is to comply with recommended standards for processing of the EEG. The current software operates on the assumption that the sampling frequency in the file is 120 Hz. If the sampling frequency is <120 Hz, the file is rejected. If >120 Hz, the data is re-sampled at 120 Hz (11) using the “Nearest Neighbor Approximation” (the value of the data point nearest the time required for 120 Hz is used). This is followed by a 0.05 high-pass filter (12). Finally, if the R wave artifact of the electrocardiogram (EKG) has not been filtered out in the stored file, an R-wave artifact removal algorithm is applied to the EEG signal (13). This requires the presence of an EKG channel in the file.

(26) Details of this R-wave artifact removal algorithm are shown in FIG. 3. Briefly, the times of R wave peaks (Pi) are located for each cardiac beat in the file (14). Any of a number of standard R wave detection algorithms can be used. For this embodiment, a 5-point derivative of the EKG signal is obtained and then squared. An 11-point integral is performed on the squared derivative (IFRDi). A 10-sec integral of the IFRD is obtained (IFRD.sub.10s) and the difference between IFRDi and IFRD.sub.10s is calculated. Peak R wave is identified as the highest point in a transient in which IFRDi >IFRD.sub.10s for >100 ms. Subsequent steps are performed on the EEG channel from which the R wave artifact is to be removed. EEG data in the interval Pi±35 points (≈0.6 sec) of each R wave are stored (15). These stored values are then broken into consecutive blocks, each containing 100 beats (16). The average of the 100 sets of 71 points is then obtained for each block and this 71-point average replaces all 100 sets in the block (17). This process is performed for each block in the file. Finally, the stored averages are subtracted from the original EEG data (18).

(27) FIG. 4 shows the steps used for Frequency domain analysis (5). Our software, which uses a variation of the Fourier transform, calculates the power X[k] at frequency k as:

(28) [ A [ k ] = .Math. n = 0 n - 1 xn cos ( 2 π N ( k + 1 ) ( n + 1 ) ) ] [ B [ k ] = .Math. n = 0 n - 1 xn sin ( 2 π N ( k + 1 ) ( n + 1 ) ) ] X [ k ] = ( ( A [ k ] ) 2 + ( B [ k ] ) 2 ) / N 2
For integer values of k,

(29) k = [ 1 , N 2 ]

(30) k = [ 1 , N 2 - 1 ]
Where;
f.sub.s=Sample Rate of the EEG window=120 Hz
N=Length of input EEG window, in samples=3f.sub.s=360
n=Current sample index in EEG window
x.sub.n=Value of the EEG signal for sample n
k=Index of the frequency we are examining. The actual frequency is:

(31) f k = ( k + 1 ) 3 Hz

(32) f k = ( k + 1 ) 3 Hz
X[k]=The power at a frequency index of k
C=Scaling coefficient, equal to

(33) 1 N = 1 360

(34) To save computation time, since the following two terms

(35) cos ( 2 π N ( k + 1 ) ( n + 1 ) ) sin ( 2 π N ( k + 1 ) ( n + 1 ) )
are independent of x.sub.n, and as shown in the top of FIG. 4 (19), they are calculated ahead of time and stored in memory.

(36) FIG. 5 is a flow chart describing the step “Calculate Summary Powers” (6). In this step the sum of powers in specified frequency ranges is calculate in each 3-sec bin. The frequency ranges used in this embodiment were (6): 0.3-2.3 Hz (k=0-6): corresponding to conventional delta range (20); 2.7-6.3 Hz (k=7-18): corresponding to conventional delta range, excluding frequencies 6.7 and 7.0 Hz (21); 7.3-12.0 Hz (k=21-35): corresponding to conventional alpha range (22), 12.3-14.0 Hz (k=36-41): corresponding to conventional sigma range (23), 14.3-20.0 (k=42-59): corresponding to conventional Beta1 range (24), and 20.3-35.0 (k=60-104): corresponding to conventional Beta2 range (25).

(37) For the sake of ORP determination, alpha and sigma powers were combined (alpha/sigma power (26)) and beta 1 and beta 2 powers were also combined (beta power (27)), resulting in 4 frequency ranges.

(38) FIG. 6 shows the approach used to assign Bin Codes (7). The algorithm checks the delta power in the 3-sec bin against the thresholds for the 10 ranks in the delta column of the stored Table 1 and assigns the appropriate rank to the delta power. The same process is repeated for theta, alpha/sigma and beta power, assigning a rank to each. Finally a 4-digit number is generated having the delta rank, followed by the theta rank, followed by the alpha/sigma rank and finally the beta rank. The process is repeated for each 3-sec bin.

(39) FIG. 7 shows the step of assigning the ORP value (8). This simply consists of checking the ORP code in the ORP table and obtaining the ORP value associated with the code.

(40) FIG. 8 shows results of ORP values (generated according to the preferred embodiment) over several hours of recording in two patients along with the results of conventional sleep scoring into five stages (awake, N1, N2, N3, REM). By conventional criteria, the main difference between the two patients was a somewhat greater awake time in patient 1 (Table 3 below). However, by looking at the ORP values in FIG. 8, it is clear that even when patient 1 was technically staged asleep, the ORP was highly unstable, reflecting extensive and frequent intrusion of awake features within the EEG, and that the average ORP (white line within the ORP panel) was substantially higher inpatient 1 than in patient 2 for all sleep stages (see also Table 3). Thus, not only was there more awake time in patient 1 but, when he slept, his sleep quality was quite poor. FIG. 8 also shows that during awake periods in both patients ORP was not fixed at 2.5 (the highest level) but there were frequent decreases in ORP, reflecting intrusion of sleep features during awake time. Thus, the awake state is not a constant but incorporates different levels of vigilance that can be reflected by the ORP value.

(41) TABLE-US-00003 TABLE 3 Patient 1 Patient 2 Time (min) ORP Time (min) ORP Awake 155 2.28 85 2.28 N1 59 1.84 16 0.86 N2 147 1.39 195 0.42 N3 24 0.72 55 0.18 REM 52 1.59 29 1.00 Total Sleep 282 1.46 294 0.45 Total Recording Time 436 1.75 378 0.86

(42) 2) Generation of the Probability Index from Streaming Data (i.e. in Real Time):

(43) The same procedure, with minor modifications, is used to generate the probability index on a continuous basis by analyzing short segments of recording and outputting the result as the data flows in. It is particularly suited for applications that require rapid feedback about the patient's sleep state or state of vigilance. It can also be utilized as a preliminary step in other software that performs simultaneous scoring of sleep stages concurrently with data acquisition. This application can be implemented on standard desktop computers, laptops or other mobile computing devices depending on the clinical indication. With all such devices the EEG output of the data acquisition system is channeled to the computer via a USB port or other suitable means. The data is then streamed into memory using existing or custom software.

(44) FIG. 9 is a flow chart showing the processing of streaming data. Here, each specified interval (bin; for example 3 seconds) is treated as a separate file. When data for such interval has been received, the software goes through the same process described in FIGS. 1 to 7, including preprocessing (2, FIG. 2), frequency domain analysis (5, FIG. 4), Calculate Summary Powers (6, FIG. 5), Determine Bin Code (7, FIG. 6), and finally Determine ORP value (8, FIG. 7). A single ORP value is generated and displayed. The process repeats until the end of the study.

(45) FIG. 10 is a block diagram of the components of a mobile device that implements the present invention. A data acquisition chip (Texas Instruments ADS1299; 28) is used for collecting up to eight channels, any of which can be an EEG channel. The output is conveyed, via an SPI communication Bus, to a micro-controller (29) that incorporates Atmel ATmega256RFR2 (U1A and U2B) microcontroller (30) and a radio receiver/transmitter (BALUN; 31). The system is powered by a Lithium ion battery (32) with associated battery and power management circuitry (33).

(46) FIG. 11 shows details of the Front End Analog Circuitry (28) associated with Texas Instruments ADS1299 chip comprising: Analog front end for biopotential measurements Low noise delta sigma analog to digital converter 8 channels, simultaneous sampling 24-Bit analog precision Sample rates from 250SPS (samples per second) to 16 kSPS

(47) FIG. 12 shows details of the micro-controller (29) and associated circuitry comprising:

(48) Atmel ATmega256RFR2 (U1A and U2B)(30) with: 8-bit Microntroller at 16 MHz 256 KB Flash Memory 32 KB Program RAM (random access memory) Fully integrated RF Transceiver for the 2.4 GHz ISM Band (industrial, scientific and medical) RF Data rates from 250 kb/s up to 2 Mb/s ZigBee and IEEE 802.15.4 RF compliant

(49) Wurth Electronics—732-2230-1-ND (BALUN) (31) BALUN—Balanced to unbalanced converter blocks common mode waves and allows only differential mode waves to the antenna.

(50) Microchip—MCP102T (32) Micropower voltage supervisor Prevents unnecessary microcontroller resets due to brown out conditions

(51) FIG. 13 shows details of the power supply (33) and associated circuitry comprising:

(52) Lithium ion battery (32)

(53) Microchip—MCP73831T (34) Li-Polymer Charge Management Controller Employs battery charging algorithms and measurement logic

(54) Maxim Integrated—MAX1704 (35) Battery fuel gauge and low battery alert Provides battery data to the microcontroller Alerts the microcontroller in case of low battery percentage

(55) Texas Instruments—TPS27082L (36) PFET Load Switch Provides Fast Transient Isolation and Hysteretic control

(56) Linear—I.T3971-3.3 (37) 38V, 1.2 A, 2 MHz Step Down Regulator Switching power supply for the system Converts battery power to 3.3V for microntroller and analog front end power supply

(57) FTDI—FT230XQ (38) USB to UART (serial) converter Allows for data transfer between computer and onboard micro-controller.

SYSTEM OVERVIEW

(58) Power is applied to system Microcontroller enters bootloader which loads the firmware Firmware initializes all system settings to allow for operation between the ADS1299 and itself Firmware initializes radio connection between receiver and itself START command issued to ADS1299 to start sampling 2 to 8 channels Analog signal is converted to digital via the ADS1299 Digital data is sent over a serial protocol interface (SPI) to the microcontroller This process repeats until a STOP command is issued Appropriate signal conditioning and data analysis: As per steps 2, 5, 6, 7, and 8 (FIGS. 2, 4, 5, 6, and 7) Algorithm output is sent over a wireless radio link

SUMMARY OF DISCLOSURE

(59) In summary of this disclosure, the present invention provides a method of generating a probability index that reflects where an electroencephalogram (EEG) pattern lies within the spectrum of wakefulness to deep sleep, which employs a computer/microprocessor that performs the steps of method. Modifications are possible within the scope of the invention.