Post Reply 
Fourier Analysis and other mathematical analysis of data
Author Message
wolson Offline

Preferred Members

Posts: 92
Joined: Dec 2015

Machine: PRS1 C-Flex
Mask Type: Other
Mask Make & Model: Dreamwear
Humidifier: Remstar
CPAP Pressure: 10 cm H20 C-flex x3
CPAP Software: SleepyHead EncoreBasic

Other Comments:

Sex: Male
Location: Red Canyon, Lander, Wyoming

Post: #1
Surprised Fourier Analysis and other mathematical analysis of data
I have been doing some mathematical analysis of the flow data taken from my APAP. The purpose is to understand my sleep apneas and COPD a little better and to communicate this to my doctors. Even though I hate writing papers (despite having well over 100 scientific publications), who knows? I might even publish on this.

I started with Fourier Analysis and now moving to a wavelet analysis. I will also probably be doing some system identification and time series analysis before I am done with the effort.

So far I will recap the effort as most of this was published in a private forum:

The data has come from a ***.005 file of a Philips Respironics Series 60 APAP. Initially, I was interested in characterizing the periodic breathing that I observe at various times throughout my sleep. Such a pattern is shown:

[Image: lQTKN91.jpg]

I started by using FFT which is very good for identifying dominant frequencies. This produced the following information:

[Image: xHEL5FX.jpg]

My interpretation is that the largest peak is my breathing frequency (near 15 cycles/minute), the peaks to the right that appear to be harmonics and the peak I am interested in is the small one near 2 cycles/minute.

Since I was interested in low frequency information, I zoomed to that region:

[Image: L41emFz.jpg]

What surprises me is that the low frequency peak is so small and indicates that periodic breathing is not as prevalent in the data I thought it was.

Below is a spectrogram of the data. The horizontal scale is time and the vertical scale is frequency. The lowest dark line horizontally across the spectrogram corresponds to my breathing frequency:

[Image: PTlD9ef.jpg]

What is noticeable is how the breathing frequency is disrupted by the event clusters. However the definition of the spectrogram is not fine enough for me to draw any conclusions at this point.

I did do some analysis of a few cycles but I don't think that it gave more information than I already had.

So now I am moving into developing wavelet forms but am not yet at point where I want to publish that yet.

Walter W. Olson, Ph.D., P.E.
Professor Emeritus
(This post was last modified: 01-23-2016 03:34 PM by wolson.)
01-23-2016 03:28 PM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
justMongo Offline

Monitors

Posts: 3,857
Joined: Sep 2013

Machine: ResMed VPAP Auto (S9)
Mask Type: Full face mask
Mask Make & Model: ResMed Mirage Quattro
Humidifier: ResMed H5i
CPAP Pressure: 18 IPAPmax - 11 EPAPmin, PS=5
CPAP Software: Other Software

Other Comments: μολὼν λαβέ

Sex: Male
Location: Калифорния

Post: #2
RE: Fourier Analysis and other mathematical analysis of data
I've been reading your posts in the Sleepyhead forum.
Looks like your software is MATLAB?
Over there, you spoke of sampling at 5 per second.
If I understand your goal, you wish to look at many cycles to get the rise and fall of periodic breathing.
However, do you not need more samples per second when inhalation is about 1.33 sec and exhalation 2.66 sec with fine structure to an individual breaths?
How do you prevent aliasing of the higher frequency components that make up a single breath cycle? Are you essentially implementing a filter in software to exclude exceeding Nyquist?

INFORMATION ON APNEA BOARD FORUMS OR ON APNEABOARD.COM SHOULD NOT BE CONSIDERED AS MEDICAL ADVICE. ALWAYS SEEK THE ADVICE OF A PHYSICIAN BEFORE SEEKING TREATMENT FOR MEDICAL CONDITIONS, INCLUDING SLEEP APNEA. INFORMATION POSTED ON THE APNEA BOARD WEB SITE AND FORUMS ARE PERSONAL OPINION ONLY AND NOT NECESSARILY A STATEMENT OF FACT.
01-23-2016 04:04 PM
Find all posts by this user Post Reply Quote this message in a reply
wolson Offline

Preferred Members

Posts: 92
Joined: Dec 2015

Machine: PRS1 C-Flex
Mask Type: Other
Mask Make & Model: Dreamwear
Humidifier: Remstar
CPAP Pressure: 10 cm H20 C-flex x3
CPAP Software: SleepyHead EncoreBasic

Other Comments:

Sex: Male
Location: Red Canyon, Lander, Wyoming

Post: #3
RE: Fourier Analysis and other mathematical analysis of data
(01-23-2016 04:04 PM)justMongo Wrote:  I've been reading your posts in the Sleepyhead forum.
Looks like your software is MATLAB?
Over there, you spoke of sampling at 5 per second.
If I understand your goal, you wish to look at many cycles to get the rise and fall of periodic breathing.
However, do you not need more samples per second when inhalation is about 1.33 sec and exhalation 2.66 sec with fine structure to an individual breaths?
How do you prevent aliasing of the higher frequency components that make up a single breath cycle? Are you essentially implementing a filter in software to exclude exceeding Nyquist?


No, I am using Mathematica. I have Matlab but prefer Mathematica. However, Matlab has better Systen Identification Tools and I may later use it. I also have some tools in Mathematica that we have never released, mainly because I was too lazy to write them up. (These basically, NARMAX methods.)

"However, do you not need more samples per second when inhalation is about 1.33 sec and exhalation 2.66 sec with fine structure to an individual breaths?"

I clearly would like a better sampling rate but I have what I have. Obviously, I have to get fine structure from wavelet analysis, not FFT's.

"How do you prevent aliasing of the higher frequency components that make up a single breath cycle? Are you essentially implementing a filter in software to exclude exceeding Nyquist ?"

That is why the limitation exists on the division of frequency in the FFT. You just cannot go finer than this without experiencing high frequency aliasing. So, in effect, I am filtering. As you know, this (digital filter theory) can get quite complex. I am ignoring these complexities as at this point, tacetly assuming that the complexities are in the noise level.

The roughness of the computations indicate that FFT is not the direction to go in. There really is nothing that I can see that pops out of the FFT's at this point. I can nothing predictive in the frequency space other than the frequency is disrupted by apnea events which should not surprise anyone. If there were frequency space events that preceded the disruption, now we might have something. But nothing is really popping.

Walter W. Olson, Ph.D., P.E.
Professor Emeritus
(This post was last modified: 01-23-2016 05:08 PM by wolson.)
01-23-2016 04:54 PM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
cpdaniel Offline

Preferred Members

Posts: 61
Joined: Nov 2015

Machine: Resmed AirCurve 10 VAuto
Mask Type: Full face mask
Mask Make & Model: F&P SimPlus
Humidifier: Built-in
CPAP Pressure: IPAP: 9-17, PS: 4
CPAP Software: ResScan SleepyHead

Other Comments: Untreated AHI: 58. Undiagnosed years: 20+

Sex: Male
Location: Central California, USA

Post: #4
RE: Fourier Analysis and other mathematical analysis of data
(01-23-2016 03:28 PM)wolson Wrote:  So now I am moving into developing wavelet forms but am not yet at point where I want to publish that yet.

Fascinating - can't wait to see your wavelet results Smile
01-24-2016 06:27 PM
Find all posts by this user Post Reply Quote this message in a reply
PoolQ Online

Advisory Members

Posts: 986
Joined: Jul 2015

Machine: AirCurve 10 VAUTO
Mask Type: Full face mask
Mask Make & Model: Amara View
Humidifier: Integrated
CPAP Pressure: 6.2, 15, PS4.0
CPAP Software: SleepyHead

Other Comments:

Sex: Male
Location: Sillicon Valley

Post: #5
RE: Fourier Analysis and other mathematical analysis of data
last time I did FFT's we were trying to decide if the blip was a single aircraft or several. In this case we had lots of data and it was data regarding everything we needed.

Would sure be nice to EKG and EEG data along with the data that sleepyhead can provide. You may or may not be able to get predictive information, but can you also know what is causing the predictive event.
01-24-2016 06:51 PM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
wolson Offline

Preferred Members

Posts: 92
Joined: Dec 2015

Machine: PRS1 C-Flex
Mask Type: Other
Mask Make & Model: Dreamwear
Humidifier: Remstar
CPAP Pressure: 10 cm H20 C-flex x3
CPAP Software: SleepyHead EncoreBasic

Other Comments:

Sex: Male
Location: Red Canyon, Lander, Wyoming

Post: #6
RE: Fourier Analysis and other mathematical analysis of data
(01-24-2016 06:51 PM)PoolQ Wrote:  last time I did FFT's we were trying to decide if the blip was a single aircraft or several. In this case we had lots of data and it was data regarding everything we needed.

Would sure be nice to EKG and EEG data along with the data that sleepyhead can provide. You may or may not be able to get predictive information, but can you also know what is causing the predictive event.


i absolutely agree. We can only model our data based on the flow rate, s aime time series. I sure would be nice to have the other values as well.

Walt

Walter W. Olson, Ph.D., P.E.
Professor Emeritus
01-24-2016 06:55 PM
Find all posts by this user Post Reply Quote this message in a reply
wolson Offline

Preferred Members

Posts: 92
Joined: Dec 2015

Machine: PRS1 C-Flex
Mask Type: Other
Mask Make & Model: Dreamwear
Humidifier: Remstar
CPAP Pressure: 10 cm H20 C-flex x3
CPAP Software: SleepyHead EncoreBasic

Other Comments:

Sex: Male
Location: Red Canyon, Lander, Wyoming

Post: #7
RE: Fourier Analysis and other mathematical analysis of data
After considerable different ways of looking at the data including multiresolution analyses, I have come tot he conclusion that there are no obvious prevent clues that an event is about to occur. The easiest information to understand is in the time domain.

In normal sleep, my breathing patterns are remarkedly stable and have dominant shape:

[Image: svYExH4.jpg]

Immediately ( the breath before the event/instability starts) there is nothing significantly different than normal sleep patterns:

[Image: Ae7WWxt.jpg]

But during the event, the total pattern is one of instability:

[Image: JwFUVEE.jpg]

Walter W. Olson, Ph.D., P.E.
Professor Emeritus
01-30-2016 01:05 PM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
PoolQ Online

Advisory Members

Posts: 986
Joined: Jul 2015

Machine: AirCurve 10 VAUTO
Mask Type: Full face mask
Mask Make & Model: Amara View
Humidifier: Integrated
CPAP Pressure: 6.2, 15, PS4.0
CPAP Software: SleepyHead

Other Comments:

Sex: Male
Location: Sillicon Valley

Post: #8
RE: Fourier Analysis and other mathematical analysis of data
Interesting, but not surprised. Question, is the data you are using taken from the CPAP with the settings in a useful range? Is the CPAP reacting to what you might be looking for and treating it so you cannot see it stand out? I am not sure what settings you would select to not treat apnea's and yet still be able to collect the data you want, maybe true CPAP with a pressure too low to prevent apnea?

From what I have read, CPAP does not try and stop or correct an apnea that has already started, but instead tries to prevent another one from happening. ASV machines on the other hand do indeed treat centrals by trying to trigger a breath that has been or is being missed.

If this is the case you should be able to detect the prelude to that first triggering apnea, the same as the CPAP machine does. Both major suppliers have significant patent positions and there should be a clue in what exactly they are detecting.
01-30-2016 03:20 PM
Find all posts by this user Post Reply Quote this message in a reply
wolson Offline

Preferred Members

Posts: 92
Joined: Dec 2015

Machine: PRS1 C-Flex
Mask Type: Other
Mask Make & Model: Dreamwear
Humidifier: Remstar
CPAP Pressure: 10 cm H20 C-flex x3
CPAP Software: SleepyHead EncoreBasic

Other Comments:

Sex: Male
Location: Red Canyon, Lander, Wyoming

Post: #9
RE: Fourier Analysis and other mathematical analysis of data
(01-30-2016 03:20 PM)PoolQ Wrote:  Interesting, but not surprised. Question, is the data you are using taken from the CPAP with the settings in a useful range? Is the CPAP reacting to what you might be looking for and treating it so you cannot see it stand out? I am not sure what settings you would select to not treat apnea's and yet still be able to collect the data you want, maybe true CPAP with a pressure too low to prevent apnea?
.

Yes, this has crossed my mind too. I think with the baseline pressure (7 cm H20) CPAP may already be opening the airway enough to prevent and hide precursors. I don't think flow rate is the full story though. I would like actually airway pressure, EKG and blood gases to know where to look for precursors. Of course, I am not going to be able get these.

There is still some room for further exploration here: I think the next place to look is to integrate the flowrates over the breaths as well as look at the rate of changes in the flowrate over a period. This may provide a lead to some useful results.

Walter W. Olson, Ph.D., P.E.
Professor Emeritus
01-30-2016 07:40 PM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Comparative Analysis of 8 APAP Machines Sleeprider 15 980 09-16-2016 09:41 AM
Last Post: KSMatthew
  Sleepyhead data vs. Doctor's data Daisylouu 8 1,413 09-01-2016 06:10 PM
Last Post: eseedhouse
  Revised Post Regarding "I need help with SH data" - with data included! Jeffo1 3 595 05-16-2016 11:28 PM
Last Post: Jeffo1
  Question about SH analysis of a rare 0 AHI night Possum 11 882 01-25-2016 03:32 PM
Last Post: Possum
  Dataset Analysis napnaptime 10 1,110 10-28-2015 09:37 AM
Last Post: napnaptime
  Event Analysis Thread C-PAP 14 1,804 09-10-2015 07:17 PM
Last Post: ginzo
  Sleep Analysis Question Crimson Nape 3 807 11-18-2014 03:03 PM
Last Post: Peter_C

Forum Jump:

Who's Online (Complete List)