Login| Sign Up| Help| Contact|

Patent Searching and Data

Document Type and Number:
WIPO Patent Application WO/1995/028874
Kind Code:
A method of detecting and analyzing sleep disorders is provided. The method includes the step of monitoring sound produced by a sleeping subject through a sensor (10) proximate the sleeping subject and continuously recording the monitored sound. The method further includes identifying snoring within the recorded sound and analyzing the identified snoring to localize upper airway structural sources of snoring.

Application Number:
Publication Date:
November 02, 1995
Filing Date:
March 13, 1995
Export Citation:
Click for automatic bibliography generation   Help
International Classes:
A61B7/00; G06F17/00; A61B5/00; A61B5/0205; A61B5/024; A61B5/11; (IPC1-7): A61B5/00
Other References:
INTERNATIONAL JOURNAL OF PEDIATRIC OTORHINOLARYNGOLOGY, Vol. 20, 1993, SCHAFER et al., "Digital Signal Analysis of Snoring Sounds in Children", pages 193-202.
MEDICAL AND BIOLOGICAL ENGINEERING AND COMPUTING, Vol. 21, September 1983, PIERICK et al., "Automated Apnoea Detection by Computer: Analysis of Tracheal Breath Sounds", pages 632-635.
AMERICAN REVIEW OF RESPIRATORY DISEASE, Vol. 147, 1993, PEREZ-PADILLA et al., "Characteristics of the Snoring Noise in Patients With or Without Occlusive Sleep Apnea", pages 635-644.
Download PDF:
I claim;
1. A method of detecting and analyzing sleep disorders comprising the steps of: monitoring sound produced by a sleeping subject through a sensor proximate the sleeping subject; continuously recording the monitored sound; identifying snoringwithin the recorded sound; and analyzing the identified snoring to locate upper airway structural sources generating the snoring.
2. The method as in claim 1 wherein the step of monitoring sound of the sleeping subject through a sensor further comprising the step of locating a microphone proximate a nose and a mouth of the sleeping subject.
3. The method as in claim 2 further including the step of searching the recorded sound for temporal gaps exceeding an apnea threshold and upon detecting such a temporal gap outputting indication of apnea.
4. The method as in claim 1 further including the step of analyzing the recorded sound using frequency domain methods.
5. The method as in claim 1 further comprising the step of encoding the recorded sound on a single channel of an audio recorder.
6. The method as in claim 2 further comprising the step of allocating a separate recording channel for each microphone for continuously recording the monitored sound.
7. The method as in claim 1 further comprising the step of recording physiological data of the sleeping subject including at least one parameter from the group including blood oxygen de saturation level, body position, respiration effort, and video image of the sleeping subject.
8. The method as in claim 2 further comprising the step of using two separate microphones, one proximate the nose and one proximate the mouth and ruling out the nose or mouth of the sleeping subject as the source of the snoring when the sound from the respective microphones is negligible.
9. The method as in claim 2 wherein the step of monitoring the sound of the sleeping subject further comprises the step of detecting an audio signal from the sleeping subject through use of at least one contact microphone.
10. The method as in claim 1 wherein the step of monitoring the sound of the sleeping subject further comprises the step of detecting an audio signal from the sleeping subject through use of at least one cordless microphone.
11. The method as in claim 1 wherein the step of analyzing the monitored sound for respiratory system structural sources of snoring further comprising the step of generating a raw data file and a reduced file.
12. The method as in claim 1 wherein the step of analyzing the monitored sound for respiratory system structural sources of snoring further comprising the step of identifying a soft palate of the sleeping subject as the source of the snoring and as a velum snore when the snoring is substantially of a fundamental frequency of from 20 to 130 Hertz and harmonics of the fundamen¬ tal frequency.
13. The method as in claim 12 wherein the step of analyzing the monitored sound for respiratory system structural sources of snoring further comprising the step of identifying a set of tonsils of the sleeping subject as the source of the snoring, and as a nonvelum snore, when the snoring is substantially of a fundamental frequency greater than 130 Hertz and harmonics of the fundamental frequency.
14. The method as in claim 13 wherein the step of analyzing the monitored sound for respiratory system structural sources of snoring further comprises the step of identifying one of a pharyngal and nose as the source of snoring, and as a nonvelum snore, when a fourier transform of the recorded sound indicates a diffused sound source, and otherwise a mixed snore when the snoring contains an indicia of multiple sources.
15. The method as in claim 4 wherein the step of analyzing the monitored sound for respiratory system structural sources of snoring further comprises the step of using a plurality of tem¬ poral sizes of data for frequency analyzing the snoring.
16. The method as in claim 11 further comprising the step of tabulating and outputting a number indicating total velum, nonvelum, and mixed snore during a time interval.
17. The method as in claim 16 further including the step of calculating a velum snore index from the total velum, non velum, and mixed snore during a time interval.
18. The method as in claim 16 further comprising the step of projecting a likelihood of success of uvulopalatopharnygo plasty based upon at least one of the calculated total velum, nonvelum, and mixed snore per time period, and/or the velum snore index.
19. The method as in claim 16 further comprising the step of displaying a raw data file or a reduced data file of the recorded sound on a computer monitor.
20. The method as in claim 16 further comprising the step of randomly accessing the raw data file and scrolling one of the raw data and data envelope in either a forward or backwards direction on a computer monitor.
21. The method as in claim 16 further comprising the step of randomly accessing the reduced data file and one of expanding and scrolling and, upon occasion, reproducing a corresponding portion of the raw data file in either identical interval size or expanded interval size and scrolling in either a forward or reverse direction on a computer monitor.
22. The method as in claim 13 further comprising the step of selecting intervals of data from the raw data file and displaying the selected interval under an expanded format on a computer monitor.
23. The method as in claim 1 further comprising the step of automatically identifying a data interval of the recorded sound as breathing by comparison with an amplitude breathing threshold and temporal breathing threshold.
24. The method as in claim 23 further comprising the step of automatically identifying a data interval of the recorded sound as snoring by evaluating a frequency content of the spectrum in the data interval and comparison with a sound threshold.
25. The method as in claim 2 further comprising the step of automatically searching the recorded sound for temporal gaps exceeding an apnea threshold level and upon detecting such a temporal gap, outputting indication of apnea.
26. The method as in claim 12 further comprising the step of determining a relative sound contribution of fundamental frequencies and harmonics.
27. The method as in claim 16 further comprising the step of marking displayed raw data and frequency domain transforming the marked raw data into a second display window.
28. The method as in claim 16 further comprising the step of marking displayed data and outputting the data to an audio speaker for verification of the event as one of breathing, apnea, hypopnea and snoring.
29. The method as in claim 16 further comprising the step of deleting markers of selected data intervals.
30. The method as in claim 16 further comprising the step of manually classifying data intervals as one of breathing, apnea, hypopnea, and snoring.
31. The method as in claim 16 further comprising the step of manually identifying the structural source of the snoring of the classified data intervals.
32. The method as in claim 13 further comprising the step of graphically outputting a distribution of snoring classifica¬ tions.
33. The method as in claim 13 further comprising the step of simulating an effect of surgery by reproducing the recorded sound without fundamental frequencies and harmonics of the fundamental frequencies.
34. The method as in claim 1 further comprising the step of comparing the monitored sound with a first recording threshold level and deactivating the recorder when the monitored sound ex¬ ceeds the first threshold levels for at least a first time period and otherwise reactivating recording when the monitored sound does not exceed the threshold for a second time period.
35. The method as in claim 34 further comprising the step of comparing the monitored sound with a second threshold and reactivating the recorder when the monitored sound exceeds the first and second thresholds for a third time period and deacti¬ vating the recorder when the monitored sound exceeds the first threshold but not the second for a fourth time period.
36. The method as in claim 1 further comprising the step of analyzing for structural sources of snoring while the moni¬ tored sound is recorded through use of a processor attached to the recorder.

The present indention relates to sleep disorders and in particular to methods and apparatus for analyzing snoring and apnea.

Background An awareness of the risks of sleep disorders in recent years has prompted a number of discoveries associated with sleep apnea and snoring. Sleep apnea is a known factor associated with heart problems.

Sleep apnea is generally regarded as an interruption in the breathing pattern of a sleeping subject. Interruptions of a breathing pattern may be spontaneous or may result from a breathing obstruction such as a sleeping subject's tongue blocking the airway or from partial or complete upper airway occlusion where the upper airway collapses, particularly under the reduced pressure generated by inhalation. Obstructive sleep apnea may result in lowered arterial blood oxygen levels and poor quality of sleep.

It is estimated that there are more than 40 million chronic snorers in the United States. Snoring is often a factor associated with sleep apnea. In addition to heart problems, sleeping disorders degrade the quality of rest for a person with the sleeping disorder as well as other people, such as a spouse, sharing the sleeping quarters.

Prior art efforts to provide data relative to sleep disorders have included the Sleep Apnea Monitor of U.S. Patent

No. 4,802,485. U.S. patent No. 4,804,485 provides a method of monitoring for sleep apnea that includes a number of sensors

(blood-oxygen sensor, snoring sensor and head position sensor) mounted to headgear of a monitored subject. The sensors are, in turn, interconnected with a data logger for recording and subsequent analysis by a doctor or technician. Other patents, such as U.S. Patent No. 4,982,738, have included additional sensors for recording the time intervals between snoring events. Such advances have improved the content of the data recorded for later analysis by trained personnel.

Another advance, such as U.S. Patent No. 5,275,159, have used a computer in conjunction with a data logger to improve the presentation of recorded data. The data logged under the invention of U.S. Patent No. 5,274,159 could be presented under any of three possible formats: (1) as a graph of sensor value versus time; (2) as histograms and tables; and (3) as episodes per hour of a selected parameter.

While the prior art has offered a number of improve¬ ments in the technology associated with presenting recorded data, the final diagnosis of the source of the sleep disorder still lies with the attending physician. The most common surgical procedure used by physicians for correcting sleep disorders such as apnea or snoring is uvulopalatopharnygoplasty ( H UPPP") . other procedures often used include adenoidectomy, tonsillectomy, septoplasty, turbinectomy, and polypectomy. In some cases physicians even perform surgery of the hypopharynx and tongue.

In the case of snoring, if the generation site of the snoring is below the plane of the uvula, then surgery becomes very complicated and, often, impractical. Also, although there is no definitive method for identifying sources of snoring, statistics show that UPPP reduces apnea 50% of the time and snoring 75-80% of the time. Because of the importance of the proper diagnosis of sleep disorders, a need exists for a simple and convenient method of determining the sources and types of sleep disorders that is not completely dependent upon the judgment and experience of an attending physician. It would be further advantageous to be able to easily identify the source of

snoring to permit evaluation of the probability of success of the various surgical options.

Summary of the Invention In summary, the invention provides a method of analyzing sleep disorders. The method includes the step of monitoring sound produced by a sleeping subject through a sensor proximate the sleeping subject and continuously recording the monitored sound. The method further includes identifying snoring within the recorded sound and analyzing the identified snoring to locate upper airway structural sources of snoring.

Brief Description of the Drawings FIG.l is a block diagram illustrating a specific embodiment of a data recording apparatus in accordance with the invention.

FIG. 2 is a perspective view of a specific embodiment of an acoustic pick-up device on the head of a subject in accordance with the invention. FIG. 3 is a block diagram of a specific embodiment of an apparatus for analyzing data from a subject in accordance with the invention.

FIG. 4 is a flow chart of data analysis in accordance with the invention. FIGS. 5A and 5B is a flow chart for breath detection in accordance with the invention.

FIGS. 6A-6F is a flow chart of apnea/snoring analysis in accordance with the invention.

Brief Description of Appendix 1

Appendix 1 lists the source code routines of present invention. Table 1 provides key routines corresponding to the processes depicted in FIGS. 5 and 6.

Brief Description of Appendix 2

Appendix 2 contains a list of the text within FIGS. 5 and 6 along with references.

Brief Description of the Preferred τftnhrtf*H*m*»τ--»

The solution to the problem of analyzing sleep dis- orders lies, conceptually, in data logging appropriate physiolog¬ ical characteristics (such as sound, body position, blood oxygen levels, et cetera) of a sleeping subject and using the logged data within a formalistic process to identify types and sources of sleep disorders. It has been determined that frequency content of snoring of most subjects will differ based upon the structural source within the upper airway causing the snoring. The frequency of snoring caused by the palate and uvula will differ, for example, from the frequency content of snoring caused by sites lower in the throat. Further determination that a sleeping subject snores through the subject's nose instead of the subject's mouth (or visa versa) may be used to eliminate certain structures as possible sources of the snoring.

The technique of analyzing sleep disorders provided under the invention localizes the source of the sleep disorder based upon information contained within the logged data. Under the invention, apnea and hypopnea are identified by comparison of characteristic parameters within the logged data with characteristic threshold values. Snoring, on the other hand, is analyzed by relating the frequency content of the snoring with upper airway structural sources. To identify structural sources, an analysis is performed within the frequency domain on an audio portion of the logged data to identify and measure fundamental frequencies and harmonics associated with the upper airway structures of the subject's breathing passages. It has been determined empirically that snoring sounds associated with structures such as the soft palate and uvula have fundamental frequencies that are typically in the range of from 20-300 Hertz while snoring originating from other structures (other than the throat) lie at higher frequencies. Throat snoring, while having frequencies in the range of from 20-300 Hz has a diffuse frequency content.

It has also been determined that snoring sounds emanat¬ ing from nasal passages have higher fundamental frequencies than

sounds originating from the mouth. Snoring sounds originating from the mouth, while lower in fundamental frequencies, are also somewhat more diffuse in frequency content.

The tonsils of some subjects have been determined to affect the fundamental frequency of snoring. Where the tonsils interfere with movement of the tongue and uvula, a fundamental frequency of greater than 130 Hz would be expected.

FIG. 4 is a flow chart describing the method used under an embodiment of the invention. Reference will be made to FIG. 4 as appropriate to provide an understanding of the invention. It is to be understood that under the invention some steps of the invention may be performed manually or the entire process of FIG. 4 may be executed automatically under the control of a general purpose computer. To facilitate analysis of respiratory and snoring sounds, the data logged audio information is limited to a frequency range of from 0-1250 Hertz. Local maxima are then identified within the audio information as well as gaps in respiratory sounds exceeding 10 seconds. Where gaps in excess of 10 seconds are detected, an output is provided indicating possible apnea.

A frequency domain conversion [i.e., a fast fourier transform ("FFT") ] is performed on the audio information. The fast fourier transformed audio information is then examined at the temporal locations of the previously identified local maxima. Where the results of the FFT at the sites of the local maxima indicate that the local maxima is predominantly made up of a fundamental frequency in the proper frequency range and multiples of the fundamental, a determination is made that the sleep disorder is a soft palate event associated with the palate and uvula (velum snore) . Identification of the sleep disorder to be a soft palate event provides the beneficial effect of indicating, in advance of surgery, that UPPP will, more likely than not, be successful. Data logging under the invention may be accomplished by any of a number of prior art methods. Heart rate, respiratory and snoring sounds, oxygen saturation of the blood and body

position information, for instance, may be recorded as in U.S. Patent No. 5,275,159, the disclosure of which is hereby incorpo¬ rated by reference. Respiratory exertion may also be recorded from a strain gauge encircling the chest or abdomen of a sleeping subject. Under a preferred embodiment of the invention, a digital audio tape (DAT) recorder, Walkman AVLS, model TCD-D7 made by the Sony Corporation is used for logging audible and physiological events.

Turning now to FIG. 1, a two-channel DAT recorder 15 is shown in conjunction with a number of sensing devices 10, 17, 18 and 19. The Sa0 2 sensor 17 is a conventional blood oxygen sensor that may be used to determine blood oxygen saturation based upon spectral absorption of a beam of light passing through a body appendage such as a finger or an earlobe. The body position sensor 18 may be a plastic tetrahedron with a metal ball inside and wires located at each apex of the tetrahedron and wherein body position is determined by the metal ball making contact with the wires at a particular apex of the tetrahedron. The optional heart rate detector 19 may be an acoustic detector. Other suitable alternative sensors for oxygen, position and heart rate are known in the art.

The sensor 10 in one embodiment is an acoustical pick¬ up device for respiration and snoring sounds originating from the nose or mouth of a sleeping subject. The mode of use of this sensor 10 may be more fully appreciated by reference to FIG. 2 where a strap 14 (not shown in FIG. 2) of the sensor 10 is placed around the head of the subject, thereby holding an acoustic pick¬ up tube 13 in proximate relation to the nose and mouth of the subject. Two short tubes 21 positioned at the nostrils of the subject (FIG. 2) conduct sounds from the nose of the sleeping subject through the pick-up tube 13 to a microphone 12. An optional second microphone 11 may detect respiratory and snoring sounds from the mouth of the subject. Alternatively, mouth and nasal sounds may be detected by microphone 12 by using a short tube in place of the microphone 11 to conduct sound from the mouth to the pick-up tube 13.

Optionally, a single microphone may be placed approxi¬ mately 40 centimeters from the nose and mouth of a sleeping sub¬ ject (or a single contact microphone may be placed on the throat of the sleeping subject) for the acoustical pick-up of respira- tory and snoring sounds. The use of the sensor 10 or optional microphones has been determined to be more effective in detecting the sounds of snoring and/or airflow because of the proximity of the sound source to the sensor 10. Such detectors have been found useful under the invention in collecting apnea information as well as in providing improved signal-to-noise ratios.

Data encoders 16 and 20 are used to encode data for recording on each of the two channels of the DAT recorder 15. Data encoder 20 frequency limits microphones 11 and 12 to a bandwidth from 20-1250 Hertz and (where signals from two micro- phones are to be recorded on a single channel) may frequency shift (e.g., by modulating onto a 5 Khz carrier) the output of one of microphones 11 or 12 to a non-conflicting location within the 0-20 kilo-Hertz bandwidth DAT channel such that audio information from microphones 11 and 12 may be recorded and, later, separately recovered without loss of information. Other suitable encoding schemes are well known in the art.

Data encoder 16 may function similarly to data encoder 20 to encode data from the sensors 17, 18, 19, or use some other, simpler encoding process. Since the output of sensors 17-19 is analog and very low frequency, the information from the three sensors 17-19 may be either frequency shifted for storage on the DAT channel, as with encoder 20, encoded under a time division multiplex (TDM) format, or otherwise encoded to permit multiple sensor outputs to be recorded on a single channel. Alterna- tively, separate recording channels can be used to record each sensor output.

To maximize recording efficiency, the data encoder 20 may buffer 2-3 seconds of data and may compare a sound level at an input to the buffer with a number of threshold levels, including a first and second sound amplitude threshold values. (The first threshold may be referred to as an apnea threshold and the second threshold referred to as a snoring threshold) . When

the sound level rises above the first threshold, recording may be discontinued after some time period (e.g., 30 seconds) . When the sound level falls below the first threshold (indicating breathing has stopped) recording may be restarted, resulting in 2-3 seconds of buffered data (occurring before the threshold transition) being recorded first. If the sound level stays below the first amplitude threshold for a third time period (e.g., 90 seconds) (indicating that the subject has awakened or the micro¬ phone has fallen off) the recorder may be again stopped. Where the sound level exceeds the snoring threshold, recording is started after a fourth time period (e.g., 1 second) with, again, the buffered data recorded first. When the sound level falls below the snoring threshold, the recorder continues for a period allowing the sleeping subject to draw another breath. If the sound level does not again exceed the snoring threshold for a fifth time period (e.g., 45 seconds) recording may be again stopped.

After recording of physiological events for an approp¬ riate period of sleep (e.g., 4-8 hours), the DAT recorder 15 is disconnected from the sleep subject and the results analyzed. To facilitate recovery of the recorded data, the DAT recorder 15 is interconnected (FIG. 3) with a general purpose computer (pro¬ cessor 30) through analog to digital converters (A/D's) 28, 29. Decoding (and separation) of individual microphone 11, 12 outputs may be accomplished digitally within the processor 30, as is well known in the art, or within optional decoders 26 or 27. Likewise, recovery of sensor 17-19 outputs may be accomplished within the processor 30 or within the decoder 26 or 27.

Under one embodiment of the invention, recovery of data occurs at a very rapid rate by replaying the recorded data at 2-4 times recording speed into A/D's 28, 29 with frequency downcon- version occurring within the processor 30. Alternatively, a number of A/D's are provided and data from many recorders 15 are recovered in parallel by the processor 30 with the data from each recorder placed in a separate file for later analysis.

Upon transfer of the raw data into the processor 30, a first file containing audio information is created by the

processor 30. The file is used by the processor to monitor the sound of the sleeping subject and identify breathing and snoring events. To facilitate data analysis, the processor 30 creates a sound envelope of breathing activity detected by each audio sensor.

To create a sound envelope, the processor 30 breaks the raw data into overlapping blocks (e.g., 300 samples per block with 100 samples at a first end overlapping a previous block and 100 samples at a second end overlapping a subsequent block) . An absolute value of the largest sample of each block is stored in a reduced data file along with information detailing the location within the raw data of the largest sample of each data block.

Since the reduced data file contains a summary of the largest samples over a number of data blocks, the contents of the reduced data file may be displayed on a computer terminal as a sound envelope representation of the raw data file. Also, because of a 200:1 data reduction, several minutes of raw data may be displayed on the terminal as a sound envelope that is representative of the contents of the raw data file. Under an embodiment of the invention drawn primarily to practicing the invention under a manual mode, an operator (not shown) of the processor 30 may use the sound envelope to identify likely episodes of apnea, hypopnea, or snoring. Using appropri¬ ate icons, the operator may scroll the sound envelope or raw data displayed on the terminal forward or backward to quickly identify profiles within the sound envelope or raw data indicating such events. An icon such as a time bar may be used in conjunction with scroll icons to quickly move from one area of recorded data to another. Split screen capability is also provided such that sections of this sound envelope (or raw data) may be compared with other sections of data. The operator may identify such episodes to the processor 30 by clicking and dragging a computer mouse across such an episode displayed on the monitor. Upon identifying an episode in such a manner, the processor 30 retrieves corresponding raw data and reconstructs the sound of the raw data through an audio speaker proximate the operator. Using such a method, an operator may differentiate between

episodes of no breathing or inefficient breathing (apnea or hypopnea) and episodes of very quiet breathing. The operator may also use such an approach to differentiate between snoring and coughing or sneezing. 5 Alternatively, an operator may be trained to monitor the raw data through an audio speaker with the raw data played at 2-4 times the recorded speed. Upon identifying suspicious intervals, the operator may return the speed of play to a normal rate to hear a normal reproduction of a suspicious event.

10 In the case of apnea or hypopnea, the operator may identify such episodes by listening 100 to the sound and noting a duration of such an episode. Where episodes exceed some predetermined time length (e.g., 10 seconds) 102, the operator may cause that part of the sound envelope to be surrounded by a

15 box (marker) and labeled with an appropriate character (e.g., "A" for apnea or "H" for hypopnea) . The processor tabulates a total number of labeled boxes for the later generation of a summary.

In the case of snoring, the operator selects a section of data with an indication of snoring 103 and causes the

20 . processor 30 to do a frequency domain conversion (e.g., a fast fourier transfer) 104 on the selected data. [Fast fourier transformation may be accomplished by using the program provided on page 163 of The Fast Fourier Transform by E. Oran Brigham (Prentice-Hall 1974)]. The processor 30, upon transforming the

25 data then displays the results for the benefit of the operator.

Fast fourier transformation (FFT) allows an operator

. to examine the frequency components of selected snoring events.

Since different sections of the upper airway generate different signatures (frequency components) , the identification 105 of

30 those frequency components in the selected data provides a means of diagnosing the source of the snore. The most significant contributors to snoring in the upper airway (and the best candidate for UPPP) is the uvula and soft palate.

Snoring generated by the soft palate has a distinct

35 pattern. A fundamental frequency of snoring generated by the soft palate is typically between 25-150 Hz and depends on the size of the uvula and soft palate, whether the snoring takes

place during the inhalation or exhalation and whether the snoring was nasal or oral, or both. To evaluate fundamental and harmonic information within an episode (epoch) , the operator characterizes the FFT data using a snore index 106 (e.g., where the episode is primarily of a fundamental and harmonics, a snore score of 1 is assigned and where fundamental or harmonics are negligible, a snore score of 5 is assigned) . A snore index can be calculated as an average of the snore scores. The processor 30 tabulates the snore index and location as each episode is evaluated for purposes of the later generation of a summary report.

The fundamental frequency of snoring often changes during a snoring epoch (e.g., during inhalation or exhalation) because of changes in the size of the airway, air flow rate, etc. As a consequence, harmonics of the fundamental frequency are also present and changing. To accommodate and identify fundamental frequencies in a changing physical environment, the operator may be forced to reduce the affect of frequency changes in the search window. Narrowing the search window will often allow an episode that may originally have been a snore score 5 to be rated at a much lower snore score number. Narrowing the search window (reducing a terminal size of analogical data) offers such bene¬ fits by examining a much shorter term period where any shift in the fundamental frequency would presumably be much smaller. On the other hand, a narrow search window is to be avoided wherever possible because the use of a broad search window provides better resolution which is important at low frequencies.

It has been determined that an excellent candidate for UPPP is a subject with an identifiable fundamental and harmonics in each snoring epoch and very little energy in other frequencies (snore score = 1) . If the fundamental and harmonics are not easily identifiable, then the soft palate and uvula may not be a significant contribution to the snoring or that there may be other important sources of the snoring. (UPPP in such a case would be less successful in reducing snoring) . To simulate the effects of UPPP, the operator may eliminate 107 the fundamental frequency and harmonics within an episode, and simulate the effect through an audio speaker. The

operator may eliminate the fundamental frequency and harmonics by individually selecting each frequency on the display of the processor 30 and activating a delete or attenuation function. Simulation of the effect is accomplished by performing an inverse fast fourier transform (IFFT) and routing the result to an audio speaker. A simulation of the effect of UPPP may then be deter¬ mined by comparing decibel levels 108 of the original snores played back and the snores after deletion/reduction of fundamen¬ tal/harmonics. Where differences in decibel level exceed some threshold value 109 (e.g., 17 db) a snore score of 1 would be indicated. A snore index of 1 is an indication of a soft palate event 111. Where the difference is some other threshold (e.g., less than 17 db) , a higher snore index may be assigned indicating snoring of mixed origin ill. Upon completion of analysis under the manual mode, a summary report may be generated by the processor 30. The summary report may include tabulations of such events as total number of apnea/hypopnea and snoring events detected within the data. Based upon the number of snore events a listing may be provided as to the number of snore events assigned to each snore index. Based on the distribution of snores among the snore index values a projection as to the site of snoring generation may be provided as part of this summary.

In another embodiment of this invention, sleep analysis (snoring, apnea, etc.), and report generation may be performed automatically by the processor 30. To analyze sleep disorders, the processor 30 identifies breathing events and searches for temporal gaps in such breathing events for apnea and hypopnea. The temporal gap between may be analyzed for apnea and hypopnea. Also, when the period between inhalation and exhalation (or intervening non-breathing event) have been identified, the analysis of snoring may be limited to more relevant areas.

Turning now to the identification of breathing events, a block diagram of the process may be found in FIG. 5. Reference will be made as appropriate in the explanation of blocks of FIG. 5 to corresponding locations source code in Appendix 1. Refer-

ences to Appendix 1 will be to alphanumeric characters (Bl - B8) located in the left margins.

In the identification of breathing events, the data source is the reduced data file. After each sample is retrieved 200 from the reduced data file, the sample is compared 201 (source code location Bl) to a breathing threshold level (breath.thresh) . If the data sample exceeds breath.thresh, then a determination is made 202 of whether the data sample is the first of a breathing event (breath. eg = 0) (source code location B2) . If the sample is the first of a breathing event, then a breath counter is set to zero 203 (source code location B3) . To measure the duration of the breath. After the breath counter is set to zero 203, or if the sample wasn't the first in a breathing event, then the breath counter is incremented 206 (source code location B4) . A breath reset counter is also reset. A compari¬ son is then made as to whether the current sample is the largest sample for that breathing event 208 (source code location B5) . If the current sample is the largest sample, then a previous maximum is replaced by the current sample. Through the blocks described 200-208, the breathing event detector (FIG. 5) measures the duration of the breathing event and locates a relative maximum for that breathing event. At the end of the breathing event (or during apnea) data samples no longer exceed the breath threshold and a different path is taken out of block 201.

After a breath is over (breath samples no longer exceed breath.thresh) , the samples are each used to increment 204 (source code location B6) a breath reset counter. The contents of the breath reset counter are then compared with a threshold 205 (source code location B7) to determine if enough continuous samples below the breath threshold have been received to indicate that the breathing event is over. If so, the contents of the breath counter are then compared with a threshold 207 (source code location B8) to determine if the number of continuous samples exceeding the threshold were enough to consider the breathing event a full breath.

After the termination of breathing events, the breath threshold, an apnea threshold, and a hypopnea threshold are recalculated 211 (source code location BIO) based upon an average 210 (source code location B9) of the last 10 breath maximas. Afterwards, or if the breathing event were determined to be a breath, then an apnea counter (apnea.count) is set equal to a current value of non-breath samples (breath.reset) and the processor 30 proceeds to look for apnea.

To this end and in a general sense, the processor 30 identifies gaps 100 with very little or no respiratory sound. Gaps are identified by comparing sound levels within a moving ten-second block of audio information with a threshold value. Where the sound threshold (apnea threshold) is not exceeded for ten continuous seconds 102 (and did not continue for more than 90 seconds) , the processor 30 outputs indication 101 that the subject may have sleep apnea. In addition, the processor 30 may output an indication of blood oxygen level during the gap along with sleep position or may defer providing indication of sleep apnea unless the blood oxygen level falls below a threshold level.

During each breathing event (FIG. 5) whenever the breathing threshold (breath.thresh) is not exceeded for a number of samples exceeding a breath-reset threshold 205, the processor looks for apnea (FIG. 6) . The processor 30 looks 300 for apnea by reading another data sample 301 (source code location API) and compares the data sample with an apnea threshold (apnea.thresh) 302 (source code location Bl) .

If the data sample does not exceed the apnea threshold, then a determination is made as to whether the sample is the beginning of an apnea interval 303 (source code location AP2) . If the sample is the beginning of an apnea interval, an apnea counter (apnea.count) is set to zero 304 (source code AP3) . Afterwards, or if the sample was not the beginning of an apnea event, an apnea counter (apnea.count) is incremented 305 (source code AP4) and an apnea reset counter (apnea.reset) is reset. For as long as the apnea period continues, the processor 30 processes

data samples through blocks 301 - 305, each time incrementing the counter apnea.count.

At the end of an apnea period (the data sample exceeds apnea.thresh) , the apnea reset counter is incremented 306 (source code AP5) . When enough continuous samples exceeding the apnea threshold have been processed, such that the incrementing apnea reset value 306 exceeds a threshold 307 (source code AP6) a determination is made 308 that breathing has again begun.

After breathing again starts, a determination is made as to whether the duration of the apnea interval exceeded a threshold value 310 (source code AP7) . If they were, the interval is an apnea event 311 (source code A8) . If not, the interval was not apnea 313 (source code A8) and sets breathing parameters 312 (source code A8) to examine another breathing event.

Following the analysis of apnea, the processor 30 then analyzes snoring events. In a general sense and to be able to analyze snoring, the processor must be able to identify local maxima within the raw data. To identify 103 local maxima, the processor examines a moving one-half second block of audio information for the highest relative magnitude audio event. To insure that the maxima is a significant event, the processor compares the maxima with adjacent audio information within the one-half second block to ensure that the maxima is at least twice the average of the magnitude of adjacent information within the one-half second block. In processing the raw data, the processor 30 creates a second file detailing the location of the local maxima within the raw data. The raw data containing the local maxima is then fast fourier transformed 104 and may be stored in a third file by the processor 30. The previously identified local maximas are examined. Where the fast fourier transformed local maximas are comprised primarily of a fundamental frequency between 20-300 Hertz, and harmonics of the fundamental frequency, the processor 30 outputs 111 an indication that the snore or sound is substan¬ tially a soft palate event.

To facilitate the FFT in the illustrated embodiment, 1,024 data points (i.e., samples) centered around the local maxima are selected for transformation. Following transforma¬ tion, a fundamental frequency is identified by finding a second set of maximas within the FFT data. Maximas within the FFT data are identified by calculating a smoothed FFT for each FFT data point. The smoothed FFT (S,-) is calculated as follows:

where "i" is the frequency, F,- is the FFT amplitude at the "ith" frequency, M,- is the smoothing order (e.g., 4), and 20 Hz < i < 300 Hz. To determine a maxima each S, is compared with its neighbors on each side. S t is a maxima if S i is greater than or equal to S y for all i-m 2 < j < i + m 2 where m 2 is a range of evaluated FFT data points (e.g., 10). An actual maxima is determined around each frequency of S j (i .) for one data point is less than or equal to S j is less then or equal to m 2 data points. An FFT point is a maxima (F,^) if F^^ is greater than or equal to F Λ for any i k where i^ - m 2 < i k < i^ + m 2 .

Insignificant FFT maximas are eliminated by considering surrounding FFT data points. If the magnitude of surrounding FFT points do not drop to some proportional value (e.g., 1/3) within M 3 FFT points (e.g. , 10) and stay below the proportional value for an additional M 4 FFT points (e.g., 40), then the FFT maxima is dropped from consideration. To state the premise in another manner F^^ is a significant maxima if F^ is > 3Fj; where i max - M 3 - M 4 < i < i^ - M 3 . Once the insignificant FFT maximas have been eliminat¬ ed, the remaining FFT maximas are ordered in terms of increasing frequency. An attempt is made to group FFT maximas in terms of a fundamental frequency and its harmonics. The first FFT maxima of the ordered group, at the lowest fundamental frequency i ; , is used to identify harmonics through the use of the equality i k =

i ; * 1 +/- δ where i k is a harmonic of i,, 1 is an integer greater than one, and δ is an allowed error (e.g., 1). Any FFT maximas at a frequency of i, and i_ is considered part of a harmonic group which included the fundamental frequency and any harmonics. The process can be repeated for the next fundamental frequency (FFT maxima) of the remaining FFT maximas within the ordered group. The FFT maxima at the next highest frequency i 2 (and multiples) become part of a second harmonic group. The process may be repeated again and again until more FFT maximas have all been included in some harmonic group.

It has been noted in some cases that a fundamental frequency may not be included within the original group of FFT maximas. When this happens, it will not be possible to group some FFT maximas of the ordered group of FFT maximas within a harmonic group. One means of solving this problem is to divide the frequency of the lowest frequency FFT maxima of the remaining ordered group by 2 (or 3) and use the result as a fundamental frequency. Using such a procedure can make it possible to place more FFT maximas within a harmonic group. Once the FFT maximas have been placed into harmonic groups, the harmonic groups having fundamental frequencies in the range of from 20-300 Hz are identified 105. Since it has been determined that snoring having fundamental frequencies in the range of from 20-300 Hz is an event primarily associated with the structures of the soft palate and uvula and since UPPP can be effective in reducing snoring produced by the uvula, the deter¬ mination of the contribution of sound produced by the uvula provides an important benefit.

To evaluate the sound contribution of the soft palate and uvula, the identified 105 harmonic groups having fundamental frequencies in the range of from 20-300 Hz are subtracted 107 from the original sounds of snoring and the decibel reduction in volume of the FFT residual maxima evaluated 108. If it is noted that the reduction exceeds some threshold (e.g., 17 db) 109, then the site of snoring generation is the velum and the subject may be a good candidate for UPPP 111.

To facilitate a comparison of sound levels, the FFT maximas (data points) of the identified harmonic group are subtracted from the original fast fourier transformed data and the result is optionally stored in a fourth file. To obtain a decibel comparison between the FFT points in the third and fourth files, a weighing factor must be associated with each of the FFT values within each data file based upon frequency. Through the use of the weighing, the loudness of the third and fourth files can be compared. Given an FFT value of F, (0 < i < N-l and N is the order of the FFT volume) , the effective loudness L(f) in Db can be determined by evaluation of the function as follows:


L (f) =101og 10 ∑ W_F d


If the loudness of the original data is greater than 50 phons, then relative weight values for a range of frequencies can be described as follows:

W1000 Hz = W100 Hz X (3.2)

W500 Hz = W100 Hz X (2.5)

W200 Hz = W100 Hz X (1.8)

WIOO Hz = W 50 Hz X (1.8)

To determine an absolute set of weight values, an arbitrary weight value may be chosen for a particular frequency (e.g., W 100 Hz = 1) and weight values determined for other frequencies either directly from the above equations or by extrapolation.

Alternatively, linear weight values may be used. Other weighting schemes (e.g., logarithmic, et cetera) may also be used in accordance with the invention. In one embodiment of this invention, the above process is more fully described in FIG. 6. Following FFT 400, a density function is calculated for low frequency components of the FFT

of from 20-350 HZ. The density function is calculated 401 (source code Rl) in accordance with the invention by integrating the FFT across the frequency range (20-350 HZ) and dividing by the number of frequency components integrated. Likewise, a density function is calculated for mid-frequencies (350-750 HZ) 402 (source code R2) and for high frequencies (750-1200 HZ) 403 (source code R3) .

The density functions are then compared 404 (source code R4) . If the low frequency density function is greater than the mid-frequency, and/or the mid-frequency is greater than the high-frequency density, then the event is determined to be snor¬ ing 405. If not, then the event is not a snore 407. (Corre¬ sponding references HA and 406. HC and 418, H5 and 419, HB and 420, CL13 and 433, and EMULATE UPPP and 435 indicate connection only) . Another way to detect whether a breathing event is a snore, is to use another microphone not in the air flow path and to use a simple amplitude threshold criteria to identify snoring.

Following a determination that an event is snoring, a set of threshold values are calculated 408 (source code HI) . An FFT sample is then loaded 411 (source code H2) and compared with a threshold value 413 (source code H3) to insure that the FFT sample is not outside a range of interest.

If the FFT sample is within the range of interest, then a determination 414 (source code H4) is made as to where it falls within the spectrum (low, medium, or high) and the FFT sample is then compared 415-417 with an appropriate threshold value L.TH1, MTH1, or H.TH1) to eliminate insignificant peaks.

If the FFT sample is greater than the relevant thresh¬ old, then a determination is made 421 as to whether the sample is the first FFT sample of a new maxima 423. If it is the first

FFT sample of a new maxima, then the counter harm.reset is reset.

If the FFT sample is not the first FFT sample of a maxima, then a current harm.reset value is compared with a threshold value 424 (source code H6) and incremented 427 (source code H8) before being compared a second time with the threshold value 429 (source code H9) . If in either comparison 426, 429 it is determined that the value of harm.reset exceeds the threshold

(harm.term) the FFT sample is outside the range to be considered and is not a maxima 427 and the parameters are reset 428 (source code H7) for consideration of another maxima. If harm.reset value of an FFT sample were less than the value of harm.term, then the FFT sample will be retrieved under pre-existing parameters.

A sample number, "i", is incremented 409 and the incremented sample number compared 410 to an event size (1024 samples) . If the sample number is less than the event size, then another sample from the same maxima is retrieved 411. If not, the processor 30 proceeds 412 to look for fundamentals and harmonics.

The processor first tests if one of the identified frequencies was a maxima 430 (source code Cll) indicating the presence of a fundamental frequency. If no fundamental is found, the event is rated 431 (source code CL8) as a snore index 5 and the result reported 444 (source code CL13) to a summary file.

If a maxima is found 430 the processor 30 determines the fundamental frequency to be the first maxima frequency 432 (source code CL2) . The processor 30 then loads a next maxima 434 (source code CL3) and determines 436 (source code CL4) if it is an integer multiple of the fundamental. If so, another maxima is loaded 434 and considered 436. If not, the processor attempts to determine 437, 438 whether the first maxima is a multiple of the fundamental.

Follow the identification (grouping) of fundamentals and harmonics 106, the processor emulates the effect of a UPPP. The processor first sets 439 (source code CL8) a frequency width equal to the fundamental frequency divided by 4. The processor then zeros 440 (source code CL9) all FFT harmonic values closer than the calculated frequency width to the fundamental and the harmonics frequency. An FFT is then calculated 441 (source code CLIO) of a simulated UPPP to the original FFT ratios. The ratios are then used to determine 442 (source code CL11) a source index which is then corrected 443 (source code CL12) before saving and printing 444 (source code CL13) a summary report. A normalized snore index for each snore index classification (1-5) may be

calculated by squaring the snore index for each event of each class, summing the squared indexes of each class, and dividing the summed indexes of each class by the summed total of all classes. The summary may include a list of the dominant funda¬ mental frequencies as well as secondary fundamentals detected. An estimation of the relative energy in the fundamental (and harmonics) as opposed to all frequencies, may be provided. The energy content of certain fundamental frequencies, compared to appropriate threshold values, may be used as an indicia of snoring from multiple sources or, otherwise, as an indicia of a velum snore. The relative energy content of fundamentals and harmonics of from 20-300 Hz and harmonics against total energy of sound may be calculated and included in the summary as a velum snore index.

The summary may identify the soft palate of the subject as the source of the snoring and label the snoring as a velum snore when the sound is predominantly of a fundamental frequency of from 20-150 Hz and harmonics, and a non-velum snore involving the tonsils when the fundamental frequency is above 130 Hz. Where the FFT indicates a diffuse sound, the summary may indicate a non-velum snore implicating the pharyngal and nose or otherwise a mixed source when the snoring contains an indicia of multiple sources, such as when the energy of fundamental frequencies and harmonics compared to total sound is below a threshold. The summary may also provide an indication of the different types of events occurring during a sleep interval by indicating a velum snore index from the total velum, non-velum, and mixed snores during a time interval. In another embodiment of the invention other methods are used to identify the presence of harmonic patterns based in the 20-300 Hz range. One method involves finding a first value "d" and a second value "a ** such that during the snoring event the wave amplitude in the time domain will comply with the equation as follows:

S (t) = aS (t-d) + δ

where "d" is the cycle time of the fundamental frequency in seconds, "a" is an amplitude that is usually close to 1 that changes very slowly, and l■ *S•• is an allowed error. If "d" is greater than 30 milliseconds, then "d" is the fundamental fre- quency wave length in seconds. If "d" is much less than 30 milliseconds, then "d" will be centered around a harmonic wave length and the equation will be valid for only subsections of the snoring event.

The foregoing specification describes only the pre- ferred embodiments of the inventions as shown. Other embodiments besides the ones described above may be articulated as well. The terms and expressions, therefore, serve only to describe the invention by example only and not to limit the invention. It is expected that others will perceive differences which, while differing from the foregoing, do not depart from the spirit and scope of the invention herein described and claimed.

In another embodiment of the invention, data analysis is performed on data received directly from the subject by a processor 30 located near the sleeping subject. Data may also be recorded for later evaluation.


SUB check. apnea <pnt'/., tmctt, tmcStt, br . m.bsgtt, br . tm. eJπcJA. «p. tm.beg-*, ap.tm. f d#, bi.ifr7.O t breath. ma>: ) , breath, throsh ! , breath, beg"/., breath , resβty., m«x.act , apnea. thraβh ! , hypop. thresh ! , breath. -fnd * /., breath, end'/., breath, count/., br.mip ap.in-jx!- annaό. reset'/. , apnea. beg'/., apnea. oπd7., apnea. count"/. , now. breath/., sa l.rat-V., no. reath. act ! , i irst.br eath

SHARED breath, term'/, miπ.breath.dur'/. , breath. num'/., apnea. tarπι'1. , nμnea.win. ι- c'l., thl. breath!, fchl.iv/p-p ' , thl.a nso!

CONST bi-2ath.ter;n'/. - 3 '3 >'; i •? -for 'J points the? a plituda is low, tv- ath is over DNBT mm. breath. dur * • = 3 *Q * S means braath should be at least B pr nt long- rog ly .2 sec

CONST breath. num7. « 10 '10 - average last 10 breaths ' ' CONST apnea. term"/. « 3

CONST apnea.. mn.B£?c7. - 10 'minimum apnea length in seconds min.apnea. ύur'l. = apnea.miri.Bβc"/. * sa pl .rato7. 'sampl .rate"/. *** .1000000 * a_ιm£ft<r.ple! S300 * apnea.min.BHC/. / apnea. dip!

CONST thl. reath! <* .23'caπ be a brqath i-f > .3 average o-f last br»f* he

CONST thl.hypop! - .23 CONST thl.apnea! a .13


"fa*pnea.county. - apnea.count"/. + 1 'increase length o-f breath apnea. βaety. = :j tmc3ι* - tmct. br.tm.beg-4 « 0: breath.beg/, β 0 'pointer to start breath Is,

IF bu-fr'/. ( pnf/. ) > max.act! THEN max.act! = bu-fr"/.<pnt*/.> ELSE 'bu-fr<pnt) apnea.thrβeh

IF breath. sg7. ~ 0 AND bu-fr'/.<pnt'/.. > breath,thresh! THEN br.tm.bβg-tt --■ tmctti breath,beg'/. - pn '/. END IF ' IF bu*fr7..pnf/.> •* breath,thresh! THEM br.tm.fcβg* = 0: breath.beg =

'not pin apnea yet

Ap5 * c * pnβa.reset'/. =• apnea.reset * /. + 1 'increase counter to terminat breath '

>] *■ " -' apnea. eset * /. ". apnea.term'/. THEN r braath.reset'/. = 0 • • -, tmκ34t -• tmctt now.breath"/. = 1 'breach is next n.apnea. ur"/. THEM 'found new Breath, reset

- Aonoa.term' / .

•cr J

'-.fci v riC " ,, L.:iιc4t , ..'. !ϊ. [..,-. .i.. ϋ - . ™ ' -- ■*-.-- -. ■ "- ' --- -! ». bu-=r'. ( i . breath.masϋ O . eath: threah .Tbreath. beάκVbrβath . eset X , - - aci , apnea. thresh ! . hypcp. thresh ! , breath. -fndV. , breath, en,. . "/., breath, countVI, '-.r *-. * . .-.O..TS" ! . acnea. reset/., apnea. beg'/., asnsa. end * /. , apnea. county., now. breathy.. *=s,- 1.,-ate'/., no. breath, act ! , f: rs . breath"/.)

FHARED r p ath.t p rra ' /., rain, breath. dur'/., breath, nun.'/., apns t l. breath ! . t!:J . I.,, * πp : , '_!-. i . _=.^i.•£;__..

x-.- -»

.r.t.c th~ "i.iπ i t;'.ri * ** • - th i s over

CONST mm.breath , durM = 5 '3' 3 means breath should be at ' =s nt long, rochlv .5 sec

CONST breath.num"/. = 10 '10 - average le*=t 1'") brea +t ι=

CONST apnea. term"/. = .:. " "

CONST apnea. miπ. sec " /. = * = 10 'miniisuin apnea length in seconds mi n. apnea. dur"/. = apnea..τ.in. sec'/. *÷ sampl rate"/. 'sampl . rate " /.= ( 1000000 asi7.sa-r.pl 2 : ΞΞOOO ) * apnea. iTiin. sec;'. apncύ mp !

CGN3T thl.breath! .25 ' can be a breath i-f > .3 averaqe of last bre;

CONST thl. ypDp! * CONST thl.acnea! * 15 reath, —3 for BBΠ- - . ~r. J. l i •thrs breath .

i J apnea. county. = apnea. count!'. + '• ' increase length o-:- breath

A 9 l l I apnea. reset'/. = 0: tπ * c3 * S * = tmc# '

" < br.tr * .. beg# = 0: breach. begX = 0 breatn 'pointer to start i

IF bu-frX ( pnty.) if.an.act JEN irsax.act! = bu*?r"/. (pnt:'.5 ELSE 'bu- r (ont) apnea.thresn

IF breath.beg " /. = 0 AND bu÷rt'.Cpnf/.) > breath,thresh ' THEN br.t.Ti.oeg* = tmcS: breath. hsaY. = onf/. END IF "

IF bu-fr " /. ( pntX ) . ' breath,thresh ! THEN br m.beς# = 0: breath. eg'/ = 'not an sonea vet

' .pnea.reset.! = apnea. reset". + 1 bre ath ' " " increase counter to terminatt apnea.ressty. "■ aonea. term".'. THEN breath, see-v. — -iTlC-. = t,T.C r iiow.hrsi-.th"/. = 1 ' breath is ne*:t THEN ' -found new breath, reset

apnsa.coun* ' = '•' -!***- * ■a.r*- * ■* ** i *1* = Oi r- T^ r.c-3 -ELSE ' apnea.ccur.t n. rxπεa. -JUΓ 'f ts- i_i 1 • V I tϋ^. - .' ' .._ .-.pnea.ben'/. = 0 apnea.end * /. = 0 apnea.ccL'.ntX = 0 apnea.reset'/. = 0: tiτ.c3 * » = t.τ,c=t 'END IF 'apnea. cunt"'. " Ftin. apnea. durJ




SUB check.breath .pnt'/., tmc-S, t.τ,c3 * S, br.tm.beg * S, br. tm.end", ap.tm.beg*S, i.p.tm. nd«, bu-fr"/.H , breath.ιτιa ** ! C ) , breath,thresh: , breath,beg'/., breath,reset'/., eiax.a ' ! , apnea.thresh ! , hypop.thresh! , breath,fnd"/., breath,end'/., breath,count'/., br.π, ! , ap. a>:! . apnea.reset'/., apnea.beg'/., apnea. end'/., apnea.count'/., r.Gw.breath?., s pi.rate'/., no.breath,ac ! , -fi st,breath"/.)

SHARED breath,term ' /.. .τ.in.breath.dur'/., trreath.num'/., apnea.term'/., apnea.min. _;.'., thl.breath!, thl.hypop! , thl.apnea!

CONST breath,tsr.ri"/. -= '3 > i-f -for 3 points the amplitude is low, ath is over

CONST min.breath. ur7. = 5 * S * 8 means breath should be at least S p r.t long, rog ly .5 sec

CONST breath. u '/C = 10 '10 - averaαe last 10 breaths

CONST thl. breath! = . —rt c n ut jreath i averaαe of las


CONST thl.hypcp! = . CONST thl. apnea! = .

— rη-ή — IF b.-sath. reset-/ , breath, tsr.,.. " I HEN

-.Γ.I.I. l - * "th". innea i "3 r.ς : ,.

breath.count' = 0 breath.rsset'Λ = 0 max. ct! = 0 END IF LOCATE 1, 1: PRINT "ap.thr"; apnea.thresh! ; ''input z *


E INT Λ-I rt ! . * -■ --=<=l -•-•+ *-, ' \

'routine to calculate no activity base line i nύ:: 'l. = ind::"/. + 1

IF bu+r.'..pnt-/.! . no.breath! THEN no.breath! = bu-fr"/.(onf/.) IF iπdx"/. ..= baselngth"/. THEN max"/. = no.breath,act ! = no. reath! iiu. ur eά i ' - lErl ru TF

IF no.breath! ; 0 THEN STOP error


-LB C j rapii*-!-'-•—'•"="-1 • r■ ' '■• . - ' • • i r;! -, :::! ϋ , rphas:

• •• '=UB <3r-?ph4. connect ( score/., oointno"/., /' () . _:! .) , -/phase' '.) , zphasel t) , col

. -,a>:l! , asmsample! , -fo"/., rt! , tt! () , c f)

•2.45. . "/..:. are -fcr zero ( cr reduce ) component o-f curser, diεpla without =eroin *r rtι«=nlav a-fter 0 ing, restet to no O-ing. '-- will set scorε=-l means simulate tne operation, i to b a,-- a * .-,. _._.,, y =1 _,_.r e ύ i r.ose c r etchinα LtO! ■» -1 i ..i * **...-! the component 1 i*f n cmode' = 0 cd>* = "Y" 'in

SHARED score * /., *foy"/., my"/., numpty-/., uεcale! , vscalεl! , •. εcale2! , asmsample!, rt ! gainl! , gaιπ2! , chS, Fointno'/., c lX. max 1 ! , ,7„.disy7. rHARED kr.dim"/., i * j.di.n7.

SHARED harm'/.O , m x . pnt7. ( ) , arm, th ' , harm. term-/. , min.sep'/., harm. sep7., harm.rss zV.. wave. ma. * ! , ill"/., ιl27.. ιhl7., ιh27., ιhhl"-:, ιhh27., Idensl!, .nden≤l ! , hdensl ! . tdenεl ! . εbg. thresh!

SHARED li.i:, li.2_, li.3! , 1 i . ! , .T.,: .1 ! , _ * -.> * .2., .τ* * :.3! , * r.**.4! , tri.i: , tri.2., ri.3! . tri.4! , tr;:.l! , trκ.2!, tr;: .3! , tr>:.4!

LOCATE 1, 1: FRINT "entry qraph4, stac =" ; FRE(-2. : INPUT z.5

≡nore.th! - .4 ' 'threshold fcr snore (amount o-f lew -frεcuency re* ired

1.6 ' therεhel o-f irinifsu** ma>:ιιιa ratio midl ! = 1.6 id! = 1! 'threshold o-f minimum densi fcv ratio hid! = 1 mh ! -- 1

'threshold -for increamg the uvula score zzzY. i-f low-freq pπcr 'remαvale of harmonics do not dominate the mid and low -frsq a-fter the i .-.oval o-f t e hnrmon. mldS.l! = 1! hldS.l ' = 2.2 ml Ξ.2! = 1.5

CONST curs.col = 1 CG ΞT blue = 1 CONST red = 4 CONST i-.hite = 7 CONST b gnd = white

:3.dιε.4- FOR i7. = t TO fcX tt ! !ι * '.) = ',

:εxτ i::

:l. ιs.4: ttd7. - l'l i to displa/ r.cn Currsctεd -f -f t , •.> to displu, * the c .rt

30T0 c4.d.4 :2.dl S. : ' Cls I CLa 1

1 :'6 '4 '12

scalc-l ! - 1 ! ' " l '

r al * :-? 1 - rcsl..ι ' * rt ' ' ' 1 ! ' 1

' ' ' ::i-S 7. - 236 '200

If" T I ' -,- * __i_.2 T! !___.' i „! * .;;; =_. . _• *, 2 2Z --..*/ _ < . .._., , „

IF P*int oX . ' :r B =.v. THEM .ιr«π. = oo n-tnDjfELSE Mr SEIX *= - !reS */.

^ : ':: ' ^ 1 £V " " ' :reB' " THEN XΓBEI-. = i x i isy * /. ELBE xresiX * = v.resV. SCREE"*'. g SCREEN 3 '2 COLOR blue, whits

'~n\ VIEW ( 10, ICO-.-OO, SO ) , , 2 '2 -for red * -"- active VIEW ( 10, 100 ) - ( 6~0, 180 ) , , 2 for red = acr i v-. σαl

WINUUW :'. r ssi. , i

COLOR blue, ..hits

-rreeqq.. εsttep! = ass.san.pl s ! * 1000000! / '-foV. r- 5500 ') C :LLSS 11

:j7. = 0

I^ [hder.sl ' -= hintgrl ! / ihhZY. - ihhl.'.) * .01 - .-nxdisy ' /. ) '

l , , hl d ! ) TKEN br . typ ! * midl ! ) THEN br.typ

-ii i-.:.r-r:s r f <3t5C*;= ' j rr .-*--./

CM.!. !""ΠΠP. (v 1 ' ^ ' alculat maxima Dcmts which ar - ar.di dat •for harinonic pattarn

'now - ind the -f undamsntal component

■-- tv.i i

arge en, .01 * cr-

END IF NEXT Y.r'l. LOCATE 1, -.0: PRINT "-fundam"; -f undam"/': FCR l.r * /. = 1 TO kr.dim * /.

IF ma:;.nπt7. Ckr7.) "- 0 THEN PRINT " '; (max. pnt'l.ikr'λ) - 1); NEXT rV. GOTO s.;ip.no.*f no. -f n da : ^ j ς^ LCCATE 1, -10: PRINT "no uvula

' -JJ * -* ' ' i-f *fundam"/.=0 then sccr is 5. ~ GDTO no. sharp. pea

≡'.Λ' p. no. t :



= f!

NEXT 11 .

-imtgr ' -r-.l i'.l at*= !■ ■>-=t r? l ntδcsti on

-÷: il7. = .01 * .T. dis "'. > ιhl7. + 1 TO .01 *■ .idis * /. -*- I hL7. upp.mintςrl 1 = t'.pp. mi ntgr 1 < ι- y' (il7.) * tt.'dl"/.) IF r.ep.midπ-ax ' . y'<ιl7.) * tt! (ιl7.) fh≤ upp. mi αma.: ' = y!

7.) ≤XT i !.

"- 'ftMdicy'. * ιhhl7. + 1 TO .01 * -n-: isv7. ι '/. ' = upp.hintgr1 ! «• y! (il7.) * tt! .il7.) ! -. y' <ιl7.) * tt! <il7.) T! !EN upp. hi.-nax

"- upμ..ιιi l. * ns.!! THEN upp. ave.max ' = upp.1owmax ! E! ' ' upp.hims.:' THEN upp.wave,max • - upp.hi ax ! upp.tot1! = upp. lintgr1 ' + upp.mintg 1 ' - upp. intgrl' OCATE 1 , 1

PRINT "low intπrl ratio"; '.'.pp.1intgr1.' / lintgrl!: PRINT "mεd πtgrl ratio"; upp.mmtgrl! / mtgrl!; PRINT "hi intgrl ratio"; pp.hmtqrl! / hintgrl!; PRINT "low max ratio * '; v.Dp.1owmax ! / lowmax.'; PRINT "t.-.t mtgrl ratio"; ι * ._: .tetl' / totl!; PRINT * 'meα ma.: ratio"; -..pρ..τιidmax : / midii-ax!: ' ' PRINT "hi ma.: ratiϋ"; μμ.himax ! / himaxi;

-..-rt :ιo": upp.wa e..max ' / wave. ax!;

LPRINT "l-. intgrl rstio"; upp.] intgr1 ' / lintgrl!; LPRIMT "τ-ed intgrl ratio"; upp..r.intgr1 ! / intαrl!; LFRINT "hi intgrl ratio": uan. intgrl ! / hintgrl!; LPRINT "tot intgrl ratio"; upp.totl! / totl!;

LFRINT "lew max ratio"; upp.icwma 1 / lowmax';

LPRINT "mad max ratio"; up . i ma ! / idmax!:

LPRINT "hi max ratio": upp.hi ax' / hicnax!;

LPRINT "tot a*: ratio"; uop.wa JS.max ! / wave.max

LOCATE 1, 1: PRINT "Y -for dump": INPUT *-*.? IF z* = "Y" THEN

FDR };r * -_ = 1 TD ..r.di.'.V/. LPRINT "..r": S.r"'.; ".v.ax.cnt" ; r . pnt7. Cicr"/.) FDR ! j7. = 1 TD isj. dim'/.

LPRINT "!..-" krY.; "-. "; :.j * '.; harm"/. (l.rV., !.j*'.) ; NEXT ..j . LFRINT NEXT ι.r"'. END IF

; r "'. = i : !. j '/. =-* 1 -HR iv. *•* 1 TO mxriisv"/. J - ttd'/. = '.> TKc i i ' - _. ' ._.'.. Li. ' 1A .i; ELSE YY (;


iH cr. ι- - * j **

' dstercni ne co_.t_.r, red ι " r na isoriic, JU-. Ϊ - zituArtf / tSi.

IF kr * /. . '* = t'r.dim'/. THEN ' -f not d aw »ιa;: Tt of har-nomc > ' -•"- IF naι * rr./. V,.rY., i-j5:> = V,: AND isa.: . pn .....-".'.> " _ T..EN col or 1 = red I..,"/. -= kJY. -r :

IF H j V. r- Uj.di.-n7. THEN _;j7. -= Is Ur7. = i. . + '_

IF harm7. ( kr7., Uj7.) = 0 AND i;j7. ^ 1 THEN kr5_ = kr*/. t- 1:

IF fcj " /. "- i.j.di.T/. OR harm"/. < fc '/., j7> = 0 THEM TF l-:7. = \ THEN tcj7. = 1 kr * /. = I * r7. + 1 ' IF krV. > Ur.dirr. * /. THEN V-

TO done.dr

END IF END IF' ''-j colorl = blue END IF ELSE color! = blue END IF


PSET Cκ j '/., JX! * scalel! * j>:>:7.) , color! ' 'blue

NEXT .75. !

IF i7. :> INTU7. / ::resl"/.5 •>• ::resl7. THEN GOTO glCOΞ.4 -:j . = 0 IF ctr.Bde * /. = 0 THEN '.xαde of c rsor if 1

.:$ - "C"

IF >ι $ < "c" AND >: * < > "C" THEN GOTO no. cursor . :.4 cmode'/. = 1 END IF'ccnode"/. yavrg! = 0: ys r! = 0 FOR ij7. = 1 TO pointno"/. yavrg ! vavrg ! + y ' (i j7.) ysqr! ^ ysqr! + y! <ij"/.) - v' <ij'/.5 NEXT j .

IF yavrg! .- IE-OS THEN std! = ( ysqr! - yavrg 1 * yavrg! / pointno"/.) - .5 * pointπ*

/ yav g !

LOCATE !, 1: PRINT "yav"; yavr 1 ; "ysqr"; vsqr ! ; "std"; s' : INPUT =* END IF

scor!" - . GOTO casn

Tr 11 ι nt. ratio ! ,' li.3! THEM ' between values -fcr score 3 -for 1 L_.W ire range scori'/. = r.



IF Hint. ratio! ', THEM :ween values fcr score 4 -fcr low ir range zorlY. -

_">w i*r"eι_| i" .,._,_ ' ■ ■ " ThFN ahove value -for score 4 -for so or 17. = Ξ END IF caem: .





G-OTO ,--_.= , END IF

<-rr tr-

-for score 3 -for t.oi

-for - f core 4 -for tπ÷

or tot int range caε-τ-4:

' totl.mt is insensitive and cant ≡-frir.ciate well between scor 3 and 4, the' -fore the determination will be αeciced by taking score!, ,-1 into consi eration IF cor37. ' - 2 AND scor37. . 5 THEN ==>: ! = ECDΓIΛ -I- cccr27. + -scor47. ==7. = CINT<= * - * >:! / 3!)

IF zzY. < '. THEN ECor37. = 3 ELSE si.tr37. = 4 END IF

::::! - '.εccrl" ÷- scorC". -'- __:c •:cor4 * ' - 31)

' ' ' 2=7. = CINTCz^.*: ! / 4)

final.i , i÷ l -f e do not d .T.int * : ase i ._ _y

LOCATE - , 1: PRINT "1.r.-t - ■■ • rl': "ininc- :p.mintgr_

V' -.int— * n..."- * ." ".np.hiπtnr1 ' - mld PUT z£

caret! ' = 0 lintgrl' upp.mintgr1 ildΞ. s lintgrl! ' upp. hintg l 1 * hldf".

' THEM rcorct ! zcorct! * 1 ' IF IF lintgrl 1 . upo-miπtgπ 1 - ,*nld5.2! OR lintπrl upp.hintgr_. ! -v* hld5

' THEN zcαrct' = zcorct! + 1! END IF zzY. = CINT zzy. ! + πcorct!" / 4)

LOCATE 1, 1: PRINT "si": scorl7., "=2"; =cor27., "s3"; scor37., "=4"; see, "cc"; :corct ! :

PRINT "manual score"; zY. "'auto score' =="/.: I PUT zS

* j" * ._ LFRINT l_ l LPRINT "score=":

' ' ' 'ggggg cursor .1 c-c". -- 0

■I * .:.1 OC 2.4ϊ cdϊ = TN..EY? ldcirs': = .-.L.rsc-r .1 oc7.

IF cdi = ". " THEN cursor.1 cc''. - cursor. locV. + , IF el? - " ." THEN cursor, loc'/. = cursor. Ice*/. - 1 IF cάs =-"/" THEN cursor, loc7. = cursor. loc7. ÷ 3 IF ea- ' - * = -, ' " : !i___.IJ cLir__,oι .l-ji.7. — c rs o r .1 oc.7. - 3 ;F :....t -.: ** .1. : ' . "* . THE.'. ;■ r - -.1 =,-". -** *r--= 1 . TF c.iu- .-r . Ire','. ** reεl7. THEN ct-.rsor.loc7. = 0

_r Cύϊ — ' I : ,__.!•. __ ,..ι"tr/. — ".: _.-__, i _J " tO. Cur a -r . -4

IF crt-5 = "(=" THEN i * t ' (i ,τιιrE".l =• tt ! : tt ' '. o7. - icurs * /. 2) = ttO! 'S i*f cutting the co ponenet .out

IF c i * '.?" THEN Ltdl — >.ι! 30T.J -.2.dis. A ' i- .f tnen ii≤ 'ay corrected -f-ft (simulate uppp)

IF cd-÷ = ""T?" THEN JTC l.uϊ=.-5 'i »- - then display L.-,* r-ina 1 f*?t, and dont reverse the correction

* IF cdS = "7." THEN GOTO c3.diε.4 'i-f 7. then display cr

IF cd.Ξ = "n" CR ed-T **** "ti" THE score * /. = 0: GOTO r,o.cur * - *

IF VAL.cd*) - 0 AND ALCcdf) ; ό THEN score"/. = VAL<cdi:

SOTO no.cur_.or2.4

IF cdS = "!," THEM Funl.-I: LOCATE 1, 3 PRINT "enter -furidau-i&r.tal frεq. in cursor steps

INPUT -fund!

IF -fund! < 2 OR fund! .-• 30 THEN SOTO -fun1.4


PRINT "enter 1/2 o-f the width

INPUT fun.w * /.

IF fun.w * /. < 0 UR -fun.w * /. ' -f nd.' / 2 THEN SOTO -funl.--. i 1 ! = 'uncii + 1 illX = ii!

DO WHILE ill"/. *fo7. / 2 - -fun.w"/. - 1

FOR ij7. = ill"/. - -fun.w * /: + 1 TO ill'/. ÷ -fun.'-.

÷ 1 tt ! (ij7) = ttO! tt! '*fo7. - ij7. ÷ 2) = ttO! NEXT ij . il! = il! ÷ fund!: ill" = il! LOOP END IF 'S.

IF cd? = TH issl.4:

PRINT "enter starting point to 0

INPUT istrtl'/.


PRINT "i-rnding point

INPUT iend17

IF istrt!7 . 0 OR iendl7 ' rrι::disy7. OR iendl7. = istrtl * .'. THEN GOTO issl.

FOR ill * .'. -= istrtiT. r -. TO lend17. tt! (ill7.) = ttO! tt! (-fo7. - ill7. + 2) = ttO! NEXT 1117. END IF'* FEE ) , bi.gnd 'vs ** old curεer ursor, loc'/. IF tt' dcurε * /.) ELSE ts! = 1 vcurs' = ( /! (ieurεl.) ) * ts! ÷- scaiel' ÷ ma>: ! / 16! PΞET (curso . loc-.'., .curs!) , cu s.col 'new cursor

-CCATE. .,

Hnl ft '1 — '. (-?ΛΠ) •*- 7 * 4. *-- ιc , .'.r r im/sec

zr rreq: = ,., Ir , cιv o-f 1 ! .*__ .., =L≤E ie d to subtract . *. 6 *a a=radι us to find the- actual length °

IF cd* = ■• ■• A f.j D cύilS = ..„.. THEN GDT0 curs ! -. Λ cd>:-S = "N" ' rn:r;τ "-...--- c.--"-,

PRINT USING - «##--. -.cure'/.; , PRINT " f rεq"; PRINT i .ISING "* *#•».•»•» » . i rβq ,. - 4 LπOcCAA-TrrE"1,=5 : , : ' , ,40- ' ' " S ^ eC lVε "lE;,gth,,:e÷1 -"

, r , i ... rB . f ,. ,. PR1NT USINB ''»™P β * * -*****. »- * * ■■ , y! ( icura7.) * tε! ; "" phΛ

GOTO curs.loop2.4 ΪO.cur=cr2.4: ''g C|_S •

31002.-1: NEXT, i7.

LOCATE 13, ",0 PRINT " LOCATE 14, 40 'eraεs -?-ft in-fc PRINT " LOCATE 13, H PRINT " VIEW <10 ' 100> - (3 ° 0 ' iS0 >" . 1 ' I tar b lue - pa S5 ιv 2 for red r IEW <:-: , ι o)-(63 , ιso> , , _ ._ , or blϋ . = paεsivc = far r≡d = act=

" -rsdefc:

= i'B hsr nn 'v' () _ onintnπ"/.} shήRED i.r.Ji.Ti.;, i.j.uii T i Λ arm 111.. s i-.ε * _-rp.*. Iir.rm.re- Y. , " .ft", Idei


SDTO π::t.l.

•" ; harm"/. ( l.i-".. ; j *. -= 1 - r' L ' i r i tM * to ne,:*; component oi* t reς. 1; , t ma.-: . nt'-i '! po i nter to largest component in the or :

ELBE 'I'.&rr.. DE y * -

«J- i;j7.

H& - -

■ /ii .-•/ .-_..- T. C- .. £ '• I ■' ' j7) = Jointer o ne*:t onent TΓC-:

END 1 , - ' i iTi. ey— : GOTO nwt.i g ELBE ' () lιarm. thresri

GOTO -iS ' ..-t.,'. falling into nsut. g END Zr ',".)> harm, th re oh

ra.zer ' i . AND harm. beg7 * 0 THEN nt harmonic peat: * .- * :ry . > kr . diM TKEN GCT3 c rm, reset"/


NEXT i7.

- ."-.iJ * OLD

Aft e, 4ϊ* 2.



Page PI

B: breath -finder

AP: apnea -fir.dor

Fetch new event


R: Separating the sπorej -from other breathing events

Is it a snore?

CL: Claεi-fy the snores into one o-f the following scores: 1,_ " _,3,4,5

Note: 1 is the almost ideal harmonic pattern (most usually' the so*ft palate but some times can be the tonsils

5 is the score when there is hardly any -fundamental or its harmonics.

Page PZ

Look -for breath

Bis Load ne:*:τ reduced data point

Bl: Is this ne>:t point larger then the breath threshold"

B2: Is it the begining o-f an event (breatn. beg=0 ?)

B3: Initial ir £= breath, count to 0, and the current maxima to

0 (begir.ing o-f event) B4s Increase breath. counter and reset the breat .r&set B5: Chock if the* ooint amplitude i = greater then the current *** _.:ιιs * ., if ves uptiae the current ma:ifiιa. Bώ: Increase b eath . eset counter B7: Is breath, €_■_=.• * .•: '. a-g«_. enough to indicate that the breath is ovsi-" 1 B8: Breath i -_. over , . :. troat . counter larger then the minimum required fcr " reath" *

Was a breath.

Page P3

B9: Average the m ximas o-: last 10 breaths

BIO: Multiply* the above average by thl. breath, thl. apnea and thl.hypopma and store the results as the breath, apnea or hypocma threshold respectively.

Bll: Set nurnoer of nun breath samples t.D be equal to breath. eset.

Look fcr aonea

Lcoi. TCΓ apnaa * ,-

P'-'l; Read ns :t &d'izee

API: Is the- d.r.- a p::.-,: r: - z ' :--- th:

AP3: Probably start o-f apnea. Setup apnea.count to 0, set apnea.beg AP4: Increase apnea.count, reset apnea.reset AP5: Increase apnea.reset AP6: Is apnea.reset greater then apnea.term?

A breathing event is probably starting

AP7: Is apnea.count greater then minimum apnea duration

(min.apn.dur) AP8: It was an apnea it was not an apnea

Setup parameters -for next breath

Loot: -for breath. Page P5

Separating snores -from other breatning events

FFT o-f event

Rl: Integrate the amplitudes o-f the low -frequencies and calculate the amplitude density at the low -frequency region. (20-350HZ)

R2s Integrate the amplitudes o-f the mid -frequencies and calculate the amplitude density at . the mid -frequency region. <3Ξ0-750Hz)

R3: Integrate the amplitudes o-f the high -frequencies and calculate the amplitude density at the high -frequency rsaion. (750 to 1200Hz)

R4: Is the amplitude density at low -frequency . weighted amplitude density at the mid and high -frequency or is the maximum amplitude at the low -frequencies greater then the weighted maxima at the higher frequency' *

A snore Not a snore

Page P6

HI : Determine al l the threshol d vi a the maximum FFT value calculated previ ousl y + other i ni ti al izati ons i ncrease i done? is high = FFT order (usually 1024 or Ξώ>"

H2: Load ne;:t FFT coi-riDonent (i—th component) H3: Is FFT al er nroater then harm, thresh?

H4: Ideπti-fv to which range o-f frequencies the current i-th component belongs low range mi range lu n range

Is FFT value 1= p- a ι ue j= pp * *- ,,_-.i ue less then l.thl '., ** =£ then m.thl IEES then h.thl

Continue current ma.-iima Beginning o-f new ma.cimf

H6: Is the maxima too wide?

(harm. eset harm.term) reset harm.reset

Not a maxima

H7: Reset parameter to prepare -for next maxima HS: increase harm. eset H9: Is harm.reset greater then harm.term

Page PS

C l i Was any maxima -found?

CL2: Bet -fundamental frequency to be equal to the -first maxima ' s -frequency

CL3: Load next Maxima Emulate uppp

CL4: Is next maxima -frequency an integer multipl ication o-f the fundamental -frequency?

CLΞ: Is next maxima -frequency an integer mult pl icati on o-f sti l l equal to the first maxima frequency?

CL6: set fundamental requncy=f undamental frequency/2

Page P9

Emulate UPPP

CLS: Set wιdth= undamental frequency/4

CL9: Zero all FFT component at integer multipeles ui the fundamental frequency pius/minus width.

CLIO: Calculate the amplitude and maxima ratios between the simulated LJPPP and the original FFT by the region and as a whole.

CL11: Use the above ratios to calculate scorl ,scor2,5Cor3.scor4

CL12: Add high -frequencies corrections to the av-erage of scor1 ,scor2,scor3 and scor4.

CL13: Print ana save the snore and the other parameters calculated above.