Demodulating FM Signal - Respiratory Inductance Plethysmography

Thread Starter

reviver

Joined Jun 19, 2017
8
Hi all,

I am trying to make a respiratory inductance plethysmography device (https://go.aastweb.org/Resources/PDF/A2Zzz17_2/Understanding.pdf). The device measures breathing rate by measuring the expansion and contraction of the chest. The way these devices work is by sending a sine wave through a chest strap, which acts like an inductor. As you breath in and out the diameter of your chest changes which acts as a change in the inductor core.

The way I have started building this is by using a Colpitts Oscillator and using the band as the inductor. My frequency is about 125kHz and "modulates" when I inhale or exhale. You can see the change in frequency below.ScopeData.png

What I don't know how to do is demodulate the signal. The frequency of breathing signal is fairly low less than 1Hz. What are my options?
My ultimate goal is to feed this into an A2D and count the breathes per minute.

Thank you in advance.
 

RichardO

Joined May 4, 2013
2,270
I would try a phase lock loop such as a CD4046. This will give you a voltage as a function of frequency. The relationship will be non-linear.
 

GopherT

Joined Nov 23, 2012
8,009
Hi all,

I am trying to make a respiratory inductance plethysmography device (https://go.aastweb.org/Resources/PDF/A2Zzz17_2/Understanding.pdf). The device measures breathing rate by measuring the expansion and contraction of the chest. The way these devices work is by sending a sine wave through a chest strap, which acts like an inductor. As you breath in and out the diameter of your chest changes which acts as a change in the inductor core.

The way I have started building this is by using a Colpitts Oscillator and using the band as the inductor. My frequency is about 125kHz and "modulates" when I inhale or exhale. You can see the change in frequency below.View attachment 129305

What I don't know how to do is demodulate the signal. The frequency of breathing signal is fairly low less than 1Hz. What are my options?
My ultimate goal is to feed this into an A2D and count the breathes per minute.

Thank you in advance.

If you are changing frequency, why are you measuring voltage with an ADC? Just amplify your signal and count the time between pulses. each time you reach a minimum, you completed a breadth.
 

Thread Starter

reviver

Joined Jun 19, 2017
8
If you are changing frequency, why are you measuring voltage with an ADC? Just amplify your signal and count the time between pulses. each time you reach a minimum, you completed a breadth.
GopherT - Thanks for the suggestion. I didn't think of that. So basically, count the time between peaks or crossings and if the time deviates from the average there is an event. I am not sure if it will work but can give it a try. One issue I will run into is having the bandwidth to do this. Right now I am using a 8bit Arduino. I can reduce the frequency of the oscillator but that would require even bigger capacitors. I am already using 1uF.
 

crutschow

Joined Mar 14, 2008
38,322
You might use a voltage to frequency converter such as one of these.
Then just us a comparator to trip at some nominal output voltage.
That will give a pulse output at the breathing rate.
 

Thread Starter

reviver

Joined Jun 19, 2017
8
You might use a voltage to frequency converter such as one of these.
Then just us a comparator to trip at some nominal output voltage.
That will give a pulse output at the breathing rate.
Crutschow, wouldn't I need a Frequency to Voltage converter? Or am I missing something?
 

Sensacell

Joined Jun 19, 2012
3,768
I would go direct to digital- as it sounds like you need the signal in a MCU at the end of the day?

It's simple and requires nothing other than a micro-controller.

1) Clean up the signal into a square wave.

2) Define a sample rate. (for the sake of this example, lets's say 50 msec)

3) Divide the signal down with a programmable prescale counter: 125,000 * 0.05) = 6250
Now you have down-converted the signal to a pulse every 50 ms.

4) Now use the period of this counter roll-over to gate another counter driven by a fast clock, say at 10 Mhz.

5) Take each each period measurement count from the fast counter,
either subtract a fixed baseline, or subtract the previous sample from the current to get a delta signal.

You now have an FM demodulator with 100 nanosecond resolution.

A $3.00 PIC18F MCU can do the whole thing with no external components, using the internal counters.
Don't use the internal oscillator, use a crystal, the internal oscillator has too much jitter.
 

HW-nut

Joined May 12, 2016
97
You could also try detecting the zero crossing followed up by a fixed pulse width monostable, an rc filter on the output of the monostable is proportional to frequency. You would need do the math for your frequency range.
 

MrChips

Joined Oct 2, 2009
34,628
You can also go straight digital by digitizing the waveform and doing digital signal processing on the wave.
For example, you can determine the period of every zero-crossing.
 

Thread Starter

reviver

Joined Jun 19, 2017
8
I would go direct to digital- as it sounds like you need the signal in a MCU at the end of the day?

It's simple and requires nothing other than a micro-controller.

1) Clean up the signal into a square wave.

2) Define a sample rate. (for the sake of this example, lets's say 50 msec)

3) Divide the signal down with a programmable prescale counter: 125,000 * 0.05) = 6250
Now you have down-converted the signal to a pulse every 50 ms.

4) Now use the period of this counter roll-over to gate another counter driven by a fast clock, say at 10 Mhz.

5) Take each each period measurement count from the fast counter,
either subtract a fixed baseline, or subtract the previous sample from the current to get a delta signal.

You now have an FM demodulator with 100 nanosecond resolution.

A $3.00 PIC18F MCU can do the whole thing with no external components, using the internal counters.
Don't use the internal oscillator, use a crystal, the internal oscillator has too much jitter.
Sensacell - I have some PIC16Fs I will see if they are capable of it. I want to make sure I understand a few things first.


On step 3:
The change in frequency is small when someone exhales or inhales. I haven't been able to measure it accurately. Would down-converting the signal be an issue?

What can be used to do this? Is it the Signal Measurement Timer? (My PIC16Fs don't have this).

Thank you.
 

GopherT

Joined Nov 23, 2012
8,009
Sensacell - I have some PIC16Fs I will see if they are capable of it. I want to make sure I understand a few things first.


On step 3:
The change in frequency is small when someone exhales or inhales. I haven't been able to measure it accurately. Would down-converting the signal be an issue?

What can be used to do this? Is it the Signal Measurement Timer? (My PIC16Fs don't have this).

Thank you.
The CCP module can do this. This is a multifunctional unit that couples with Timer2.

You can measure how many CPU clock ticks accumulate on Timer2 between up or down transistions on an external pin.
 

Sensacell

Joined Jun 19, 2012
3,768
Sensacell - I have some PIC16Fs I will see if they are capable of it. I want to make sure I understand a few things first.


On step 3:
The change in frequency is small when someone exhales or inhales. I haven't been able to measure it accurately. Would down-converting the signal be an issue?

No, the ratio of frequency change remains, the reason to down-convert is to increase the number of timer cycles per measurement.

What can be used to do this? Is it the Signal Measurement Timer? (My PIC16Fs don't have this).

Use the COMPARE function as the prescaler, you can make it toggle a pin on match, that pin can trigger a CAPTURE on another counter.

All the CPU needs to handle is the final measurement, it has plenty of time to do this because the core function is all done in hardware, no code-dependent latency to fret over.


Thank you.
 

HW-nut

Joined May 12, 2016
97
Or...you can use the signal to trigger a one-shot, say 2 or 3 microseconds for a 100 kHz signal and then low pass filter the result. You can find the respiration rate by Ac coupling the signal and detecting the zero crossings.

Here is something along the same idea, bu Harry Lythall
http://213.114.137.49/use/fmif-det.htm
This is basically what I suggested yesterday. I have used this approach for tachometers.
 

Thread Starter

reviver

Joined Jun 19, 2017
8
Hi Sensacell, I don't think I am getting it. I used an Arduino board (ATmega328) instead. The functionality is similar enough to a PIC16F.
What I have is:
- Signal goes into the comparator module
- Capture is triggered (interrupt) every time the comparator module has a rising edge
- I calculate the period between two capture interrupts.

So my period reads about 122, which makes sense (1/16MHz * 122 = ~131kHz). I haven't done any down-converting, mainly because I can't figure out how. Any suggestions on what to read or where to look to better understand down-converting. I would like to increase the resolution.

Thanks again.
 
Top