fig1 is a block diagram illustrating a high level view of a sleep tracking and waking optimization system according to an embodiment . a sleep tracking and waking optimization system 100 includes a bio - amplifier 102 , a processing control unit 110 and an alerting module 116 . the bio - amplifier 102 includes an eeg / pressure sensor matrix 104 , a raw signal processor 106 and an alerting device 108 . the alerting device may produce an audio signal or it may vibrate to awaken the subject . according to an embodiment , the eeg / pressure sensor matrix 104 is a flexible sheet in which both pressure and electrical signal sensors have been embedded . by way of illustration and not by way of limitation , the flexible sheet is embedded on a pillow . as will be explained in more detail below , the eeg / pressure sensor matrix 104 sends analog electrical and pressure data to a raw signal processing module 106 that digitizes the data and stores it in a memory 107 . fig2 a is a block diagram illustrating a bio - amplifier according to an embodiment . in an embodiment , electrodes 202 are placed on a sheet on which the head of a subject under test rests . contacts between the fabric near an electrode and the subject &# 39 ; s head acquire electrical signals from the subject &# 39 ; s head . the electrodes 202 feed electrical signals to a raw signal processor 106 . pressure sensors 204 are also embedded in the flexible sheet and acquire pressure data that is used to orient the subject &# 39 ; s head as more fully described below . fig2 b is an exploded perspective view illustrating components of a pillow assembly incorporating a bio - amplifier according to an embodiment . in an embodiment , components of a bio - amplifier 102 are integrated into with a foam portion 118 to form a pillow assembly 120 . the pillow assembly 120 may be used in various embodiments described below . referring again to fig1 , the digitized electrical and pressure data are communicated from the memory 107 to the processing control unit 110 . by way of illustration and not by way of limitation , the bio - amplifier may communicate the digitized electrical and pressure data to the processing control unit 110 using a wired or wireless link . the eeg signal is not acquired from an array of electrodes that are affixed to a subject &# 39 ; s head . rather , the motion of the subject will constantly change the electrode measurement and the reference state of the eeg signal . fig3 a , 3 b and 3 c illustrate pressure distributions resulting from three orientations of the head of a subject on pillow incorporating a bio - amplifier 102 . in fig3 a , the subject &# 39 ; s head is flat on the pillow . in this orientation , the pressure is distributed evenly . the pressure gradient is described by a parabolic function orthogonal to the axis of the head defined by the middle of the forehead through the chin . fig3 b and 3c illustrate distribution functions that are not parabolic . additionally , the eeg signal is a three - dimensional time - varying vector that measures a mean electrical potential of the brain . a two - dimensional electrical map is not sufficient to map to a three dimensional space . in an embodiment , pressure is used as an additional variable to create “ depth ” on the two - dimensional electrode map . the three - dimensional surface defined by pressure is used to solve for the current orientation of the subject &# 39 ; s head , as well as for generating a surface to give electrical signals a three - dimensional orientation . in an embodiment , a pressure surface is defined by the following vector function ( where x and y are indices and x and y are real space ): the following equation is used to obtain the unit normal vector for each electrode ( which is given index e ). fig4 a is a graphical representation illustrating the cross products of the normal vector equation according to an embodiment . the mean normal vector for the electrode is determined from the following equation : fig4 b is a graphical representation illustrating the mean normal vector 410 according to an embodiment . fig4 c is a contour drawing illustrating unit normal vectors 420 . when a subject lies on the eeg / pressure sensor matrix 104 , a two - dimensional contour map of the pressure on the device is generated . this contour may be represented as the following function : exemplary contours are illustrated in fig3 a , 3 b and 3 c . the directional derivative is obtained for the entire vector map in the y direction . all values of y in which the directional derivative passes the 1 st derivative test for maxima as points y max are obtained , where j is the unit vector in the y direction : the function g ( x ) is treated as linear so the rotation θ of the head about the z - axis is defined as : all the functions of pressure orthogonal to the linear function g ( x ) are obtained by reorienting the pressure map and holding the new variables constant . if “ a ” is held constant to a 0 , a function h of “ b ” that maps pressure may be obtained : when the head is laying flat on the pillow , regardless of its rotation about the z - axis , it spreads pressure evenly across the pillow . this state may be modeled as a parabola orthogonal to the axis of the head . however , if the head is tilted in either direction , the pressure gradient is no longer parabolic . fig3 b and 3c illustrate distribution functions that are not parabolic . the difference in pressure growth on both sides of the head can be represented as the 2 nd derivative of both sides of the pressure map . the following equation takes the difference of both sides of the pressure curve formed by h ( b ) and normalizes them to generate a “ tilt index ”: where + and − indicate which side of the parabola the average is taken from . table 1 is an illustration of a look - up table that maps measured tilt index values to tilt angles of the head of a subject , based on a sample population deemed representative of typical subjects . in an embodiment , because the function to map tilt index to real head tilt varies significantly from person to person due to head weight , size and shape , a look - up table for a particular subject may be generated by calibrating the pillow for a particular subject . the look up table will then map the tilt index for a given subject to the subject &# 39 ; s actual head . see table 2 for a sample subject &# 39 ; s pillow calibration . this vector is then converted into cartesian space and then dotted with the relative mean eeg vector to give the absolute scalar eeg signal : absolute scalar eeg =& lt ; r sin φ cos θ , r sin φ sin θ , r cos φ & gt ;· relative mean eeg this signal is the magnitude projection of the eeg vector onto its correct measurement orientation . this scalar signal is then processed to solve for sleep state . referring again to fig1 , in an embodiment , the processing control unit 110 includes an eeg vector analysis module 112 , a lookup table 114 and an alerting module 116 . the processing control unit 110 receives the electrical and pressure data from the raw signal processor and uses a lookup table 114 to derive a correctly oriented eeg mean vector . this vector is computed at fixed intervals to produce an eeg mean vector timeseries . by way of illustration and not by way of limitation , the processing control unit 110 is incorporated into an alarm clock device , which device also accepts input from the user . in another embodiment , the functions of the processing control unit may be performed by a computing device , such as a computing device illustrated in fig6 , executing software instructions . by way of illustration and not by way of limitation , the computing device may be a laptop computer , a desktop computer , or a portable computing device such as a tablet or a smart phone . the absolute scalar eeg timeseries is provided to the alerting module 116 . the alerting module 116 processes the absolute scalar eeg timeseries to determine a sleep state of the subject under test . the alerting module 116 uses the sleep state to issue an alarm signal to an alerting device 108 in the bio - amplifier 102 . as further illustrated in fig5 and discussed below , the alerting module may activates an alarm device that is incorporated into a processing control unit or an alarm device that is external to the processing control unit . in an embodiment , the sleep state of the subject may be mapped over time to determine a sleep cycle pattern . this pattern may be used to project a future sleep state of the subject . fig5 is a block diagram illustrating a processing control unit with added functionality according to an embodiment . as described above and illustrated in fig1 , the processing control unit 110 includes an eeg vector analysis module 112 , a lookup table 114 and an alerting module 116 . fig5 illustrates a processing control unit 502 that includes additional functional elements that provide user - controllable features . a wireless interface 504 provides communications with the bio - amplifier 102 . the wireless interface may be any short - range protocol including , for example , bluetooth , wi - fi , and zigbee . the processing control unit 502 may receive signal inputs ( filtered and amplified eeg and pressure signals ) from the memory 107 of the bio - amplifier 102 and may send alarm signals to the alarm 108 and / or an alarm device 517 incorporated into the processing control unit 502 and / or an alarm device 518 that is remote from the processing control unit 502 using the wireless interface 504 . the processing control unit 502 may also include a user interface 506 that receives user selected alarm and timing data . these data are provided to the timer circuit 508 to set a time for display on an led display device 512 . the data may also be used to establish a preferred wake - up time that is provided to the alerting module 116 . in an embodiment , the eeg vector analysis module 112 uses the pressure and eeg data to determine the sleep state of a subject and provides this information to the alerting module 116 . the alerting module assesses the trends of the sleep state of the subject against the preferred wake - up time to determine when to activate the alarm 108 component of the bio - amplifier 102 . thus , the activation of the alarm 108 may occur before the preferred wake - up time if needed to optimize the wake time of the subject relative to the subject &# 39 ; s sleep state and / or projected sleep state . fig6 a is a flow diagram illustrating a process by which data from an eeg / pressure sensor matrix is processed according to an embodiment . at block 602 , eeg electrode signals are acquired from the memory 107 of the bio - amplifier 102 ( see , fig1 ). at block 604 the signals are band passe filtered . at block 606 a scalar eeg value is obtained . at block 612 pressure data are acquired from the memory 107 of the bio - amplifier 102 ( see , fig1 ). vector operations are performed on the pressure data ( block 614 ) and a pressure normal unit vector is obtained ( block 616 ). operations to determine g ( x )= y max are performed a maximum pressure operation ( block 620 ). the rotation angle of the head θ is determined ( block 622 ). the tilt index is determined ( block 624 ). the tilt index is used to determine the tilt angle φ ( block 626 ). the pressure normal unit vector is generated ( block 628 ). at block 632 , the scalar eeg and pressure normal unit vector are multiplied to obtain a relative mean eeg vector . at block 634 , an absolute scalar eeg vector is obtained from the dot product of the relative mean eeg vector and a unit orientation vector . at block 636 , the sleep state of the subject is determined from the absolute scalar eeg vector . at block 638 , the sleep state is provided to an alerting module . fig6 b is a flow diagram illustrating a process by which a sleep state is identified according to an embodiment . the eeg signal data from the absolute scalar eeg vector are acquired ( block 632 ) and converted to a frequency domain using a fourier transform ( block 634 ). the amplitude and frequency of the signal is determined ( block 638 ). each stage of sleep has its own unique signature of frequencies and amplitudes that identify it . the amplitude and frequency signature of the signal that are obtained by fourier transforming include real and imaginary components which differ based on the phase shift of the incoming signal . fig6 c includes graphs illustrating various sleep state signatures . attributes of the sleep state signatures may be used in at block 640 to identify a current sleep state of a subject . referring again to fig6 b , a determination is made at block 640 whether the data are sufficient to identify the sleep stage of the subject . if the sleep stage cannot be identified from the data , that is , if the result of block 640 is “ no ,” the process waits for an updated absolute scalar eeg . in an embodiment , additional data are acquired from the from the memory 107 of the bio - amplifier 102 ( see , fig1 ). in an embodiment , several signal acquisitions may be made and summed to improve the signal to noise ratio . in other embodiment , eeg and pressure data may be recorded for an extended amount of time to mitigate the effects of disturbances to the device and noise . if the sleep stage can be identified from the data , that is , if the result of block 640 is “ yes ,” at block 634 the sleep state is provided the alerting module 116 of the processing control unit 110 ( see , fig1 ). the process continues with additional data being acquired from the memory 107 of the bio - amplifier 102 ( see , fig1 ). once an evaluation yields a conclusive result , the algorithm may inform the alerting module of the subject &# 39 ; s current sleep stage . in an embodiment , the process illustrated in fig6 a occurs several times each second , and 6 b occurs several times each minute , allowing the processing control unit 110 to maintain a strict definition of each stage of sleep . the processing control unit 110 will only alert the alarm component that a change in sleep stage has occurred when it has conclusively made such a determination . thus , even though the processing control unit 110 may not be able to determine the individual &# 39 ; s stage of sleep upon each signal acquisition , it will still report changes in sleep stage with high accuracy . in an embodiment , when the subject is in a deep sleep and is not projected to be in a light sleep state at a time chosen by the subject to be awakened , the alerting device may be signaled to issue an alarm of a type and / or magnitude that will not awaken the subject but is likely to raise the sleep level of the subject from heavy toward light . the non - awakening alarms may be repeated with varying intensity in order to encourage the subject into a lighter level of sleep . at a point when the subject enters a light level of sleep or the time for awakening have been reached , the alerting device may be signaled to issue an alarm of a type and / or magnitude that will awaken the subject . fig7 is a system block diagram of a computing device useful to perform functions of a processing control unit . while the computing device 700 is illustrated as a laptop computer , a computing device providing the functional capabilities of the computer device 700 may be implemented as a tablet , a smartphone , a desktop computer or a handheld computer . a typical computing device 700 may include a processor 701 coupled to an electronic display 704 , a speaker 706 , a volatile memory 702 and to a nonvolatile memory , such as a disk drive 922 . when implemented as a laptop computer or desktop computer , the computing device 700 may also include a floppy disc drive , compact disc ( cd ) or dvd disc drive coupled to the processor 701 . the computing device 700 may include an antenna 710 , a multimedia receiver 712 , a transceiver 718 and / or communications circuitry 920 coupled to the processor 701 for sending and receiving electromagnetic radiation , connecting to a wireless data link , and receiving data from the bio - amplifier 102 . additionally , the computing device 700 may include network access ports 724 coupled to the processor 701 for establishing data connections with a network ( e . g ., lan coupled to a service provider network , etc .). a laptop computer or desktop computer 700 typically also includes a keyboard 714 and a mouse pad 716 for receiving user inputs . it will be understood by those skilled in the art that the present invention may be embodied in other specific forms without departing from the scope of the invention disclosed and that the examples and embodiments described herein are in all respects illustrative and not restrictive . those skilled in the art of the present invention will recognize that other embodiments using the concepts described herein are also possible . further , any reference to claim elements in the singular , for example , using the articles “ a ,” “ an ,” or “ the ,” is not to be construed as limiting the element to the singular .
analog electrical and pressure data obtained by an eeg / pressure sensor matrix from the subject are sent to a signal processing module that derives digital eeg data from the electrical signal and pressure data without using sensors attached to a subject &# 39 ; s head . the pressure data are used as a secondary signal to measure the physical orientation of the subject &# 39 ; s head . the physical orientation is used to transform the derived eeg signal to a known coordinate axis to obtain useful , consistent , and accurate eeg data . the eeg may be used to determine a sleep state of a subject and to awaken the subject while in a particular state .