Sign in

username:

password:



Not a member?

Search piclist



Search tips

Subscribe to piclist



piclist by Keywords

12F675 | 16F628 | 16F84 | 16f877 | 16F877A | 16F88 | 18F458 | ADC | AVR | Bootloader | CAN | CCS | CRC | EAGLE | EEPROM | ICD | ICSP | IDE | JDM | LED | Macros | Microchip | MPLAB | PCB-CAD | PIC10F | Pic12f675 | PIC16F84 | PIC16F84A | PIC16F877 | PIC18 | PIC18F452 | PicBasic | PICC | PICSTART | PWM | RS-485 | RS232 | SMT | SPI | UART | USART | USB | Wireless | Wisp628 | Xilinx

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | Piclist | Pulse analysis with a PIC

A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.

Pulse analysis with a PIC - Jason Hsu - Jul 26 22:26:42 2009

Page 2 of the following document shows two pulses that I need a PIC to analyze:
http://www.phoenix.tc-ieee.org/0001_Bibliography/2007-05-24%20EMB%20Presentation/2-Carl-Sensors_20070520_Phoenix%20Sensor2.ppt

Basically, there are two pulses from two sensors. The systolic blood pressure we're measuring is a function of the time difference between the peaks of the two pulses. The diastolic blood pressure we're measuring is a function of the time difference between the troughs of the two pulses.

I have never before used a PIC to analyze a pulse. I'm trying to think of the best way to do this. If you forced me to try something right now, here is how I would do it:
1. Use the A/D converters to obtain voltage measurements, one from pulse 1 and one from pulse 2.
2. Save these voltage measurements in variables.
3. Repeat steps 1-2 many times until data has been collected for at least a full cycle.
4. Go through the set of pulse 1 measurements and pulse 2 measurements. Use a counter to keep track.
5. Identify the variables representing the peaks and troughs.
6. Compare the timing of the peaks and troughs in the two pulses.
7. Use the timing data obtained in the previous step to calculate the blood pressure numbers.

What do you think? Is this a good way, or is there a much better way?

Are there examples of PIC programs that analyze pulses that I can look at? It would help me tremendously to look at examples of pulse analysis programs.

--
Jason Hsu
http://www.jasonhsu.com/swrwatt.html
http://www.jasonhsu.com/swrwatt-c.txt
http://www.jasonhsu.com/swrwatt-asm.txt

------------------------------------

to unsubscribe, go to http://www.yahoogroups.com and follow the instructions



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )


Re: Pulse analysis with a PIC - William Gebers - Jul 27 4:20:56 2009

Hi Jason.

I am not an expert in PIC's, but have identified some issues below
that occured to me.

2009/7/27 Jason Hsu :
> Page 2 of the following document shows two pulses that I need a PIC to
> analyze:
> http://www.phoenix.tc-ieee.org/0001_Bibliography/2007-05-24%20EMB%20Presentation/2-Carl-Sensors_20070520_Phoenix%20Sensor2.ppt
>
> Basically, there are two pulses from two sensors. The systolic blood
> pressure we're measuring is a function of the time difference between the
> peaks of the two pulses. The diastolic blood pressure we're measuring is a
> function of the time difference between the troughs of the two pulses.
>
> I have never before used a PIC to analyze a pulse. I'm trying to think of
> the best way to do this. If you forced me to try something right now, here
> is how I would do it:
> 1. Use the A/D converters to obtain voltage measurements, one from pulse 1
> and one from pulse 2.

Be careful how you set this up. Remember that the trigger time of
each of the ADC's will affect your measurement.
i.e. if you trigger ADC1 first then ADC2, the first will be 1
instruction cycle earlier that the second. I stand corrected, as you
may be able to trigger the sample and hold simultaneously.

> 2. Save these voltage measurements in variables.

Check how long it takes to write the voltage measurement to memory &
the precision with which you want to do this. Depending on your
sample rate, you may be limited in how much you can write to memory &
how quickly you have to write. This also affects which memory in the
PIC you can use.

> 3. Repeat steps 1-2 many times until data has been collected for at least a
> full cycle.
> 4. Go through the set of pulse 1 measurements and pulse 2 measurements. Use
> a counter to keep track.
> 5. Identify the variables representing the peaks and troughs.

I am interested to see what method you use for this. I would assume
you need to check for noise on the signal and perform some sort of
filtering to avoid detecting false troughs / peaks.

> 6. Compare the timing of the peaks and troughs in the two pulses.

> 7. Use the timing data obtained in the previous step to calculate the blood
> pressure numbers.
>
> What do you think? Is this a good way, or is there a much better way?
>
> Are there examples of PIC programs that analyze pulses that I can look at?
> It would help me tremendously to look at examples of pulse analysis
> programs.

You may want to look at examples of digital osciliscopes. They
generally do some sort of waveform analysis to capture and hold a
repetitve waveform.

>
> --
> Jason Hsu
> http://www.jasonhsu.com/swrwatt.html
> http://www.jasonhsu.com/swrwatt-c.txt
> http://www.jasonhsu.com/swrwatt-asm.txt

Regards,

William
------------------------------------

to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Pulse analysis with a PIC - Temtu - Jul 27 12:20:26 2009

Jason

To solve this problem, is it possible to use the principle used by HP3575A
Phasemeter ( http://www.hpl.hp.com/hpjournal/pdfs/IssuePDFs/1972-05.pdf ) so
that time between two pulses is measured as phase using an external; "noise
immune" phasemeter hardware ?

Of course one of the channels of the phasemeter input amplifier could be
used to measure the period using PIC 16F688's "external timer gate". Then
one can use a moving average algorithm to filter the period and convert to
frequency. Please see
http://www.codeproject.com/KB/recipes/SimpleMovingAverage.aspx beside many
others..

What do you think ?

Regards

M

----- Original Message -----
From: William Gebers
To: p...@yahoogroups.com
Sent: Monday, July 27, 2009 4:19 AM
Subject: Re: [piclist] Pulse analysis with a PIC
Hi Jason.

I am not an expert in PIC's, but have identified some issues below
that occured to me.

2009/7/27 Jason Hsu :
> Page 2 of the following document shows two pulses that I need a PIC to
> analyze:
>
http://www.phoenix.tc-ieee.org/0001_Bibliography/2007-05-24%20EMB%20Presentation/2-Carl-Sensors_20070520_Phoenix%20Sensor2.ppt
>
> Basically, there are two pulses from two sensors. The systolic blood
> pressure we're measuring is a function of the time difference between the
> peaks of the two pulses. The diastolic blood pressure we're measuring is a
> function of the time difference between the troughs of the two pulses.
>
> I have never before used a PIC to analyze a pulse. I'm trying to think of
> the best way to do this. If you forced me to try something right now, here
> is how I would do it:
> 1. Use the A/D converters to obtain voltage measurements, one from pulse 1
> and one from pulse 2.

Be careful how you set this up. Remember that the trigger time of
each of the ADC's will affect your measurement.
i.e. if you trigger ADC1 first then ADC2, the first will be 1
instruction cycle earlier that the second. I stand corrected, as you
may be able to trigger the sample and hold simultaneously.

> 2. Save these voltage measurements in variables.

Check how long it takes to write the voltage measurement to memory &
the precision with which you want to do this. Depending on your
sample rate, you may be limited in how much you can write to memory &
how quickly you have to write. This also affects which memory in the
PIC you can use.

> 3. Repeat steps 1-2 many times until data has been collected for at least
a
> full cycle.
> 4. Go through the set of pulse 1 measurements and pulse 2 measurements.
Use
> a counter to keep track.
> 5. Identify the variables representing the peaks and troughs.

I am interested to see what method you use for this. I would assume
you need to check for noise on the signal and perform some sort of
filtering to avoid detecting false troughs / peaks.

> 6. Compare the timing of the peaks and troughs in the two pulses.

> 7. Use the timing data obtained in the previous step to calculate the
blood
> pressure numbers.
>
> What do you think? Is this a good way, or is there a much better way?
>
> Are there examples of PIC programs that analyze pulses that I can look at?
> It would help me tremendously to look at examples of pulse analysis
> programs.

You may want to look at examples of digital osciliscopes. They
generally do some sort of waveform analysis to capture and hold a
repetitve waveform.

>
> --
> Jason Hsu
> http://www.jasonhsu.com/swrwatt.html
> http://www.jasonhsu.com/swrwatt-c.txt
> http://www.jasonhsu.com/swrwatt-asm.txt

Regards,

William



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Pulse analysis with a PIC - rtstofer - Jul 29 22:29:12 2009

To sample the waveform, you need to determine that highest frequency in the signal. The Nyquist-Shannon sampling theorem deals with that:

http://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem

So, first you need to know what the highest frequency is! One way to do this is to perform a fast Fourier transform of samples of the signal. These samples need to be taken at a much higher rate - but only once for testing. http://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem

Once you know the sample rate required of the A/D converters you can then figure out how to program the PIC.

The problem I have is that I don't know what kind of time delays are involved.

Anyway, after you capture both waveforms to arrays then you just wander through the data looking for max and min values and their associated timestamps (may be implicit from the sample number).

Actually, you can keep track simultaneously of the max and min sample timestamps and you don't even need to store the data.

At some point you will be able to figure out whether the PIC is a good choice.

Richard
------------------------------------

to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )