....A
> "valid" breath has to have an inhalation phase and an expiration phase
> (to exclude random movements etc). Counting peaks or every time the
> signal exceeds a threshold value works, but that is only half of the
> inhale-exhale cycle, and also counts non-valid breaths. I can't seem
> to get the extract frequency vis that come with labview to work
This isn't really my cup of tea, but here is the way I'd go about it.
Look at the data looking for transitions between rising and falling
data. These apices are either the transition between an exhale and
inhale, or vice-versa. The likely problem is that there will be some
electrical noise, and some sensor noise that introduces smaller spikes
which aren't real breaths.
It will be necessary to determine the difference between valid and
invalid transitions. First off, it seems like a valid breath has a
minimum length. For adult humans, if the transition happens more than a
few times per second, that seems like noise, not rapid breathing. On
the other end, what is the difference between holding breath, and
determining that the unit is no longer connected, or respiration has
ceased. You will have to determine the numbers, but my guess is that
you should discard the transitions that take less than 100ms, and on the
other end 20 or 30 seconds is a long time between breaths. It also
seems like a valid breath has to have a given volume, perhaps a few
cc's. Value changes smaller than these are likely electrical noise.
Eliminating invalid transitions can probably be done in multiple ways, a
median filter will get rid of the high frequency jitter, as will other
low-pass filters. I'm not sure about using a bandpass for frequencies
that low, but perhaps Alain will have the anser for that. I think you
can measure all transitions, then loop through keeping the mins and maxs
that are large enough in amplitude and far enough apart in time.
Hopefully someone else will have something better than my adhoc
approach, but if not, I suspect it would work reasonably well since you
are only interested in frequency content.
Greg McKaskle