LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Phonocardiography

Hi Gurus,
I am Biology student, I am working on this.
 I have extracted a sound signal from the heart using electret microphone, I want to calculate the heart beat per minute. I am new to this software and I started out using a threshold peak detector for the DAQ.
I am able to see the number of peaks but I can only see that the peaks are not being counted continously. Peak detector is counting the number of peaks per second and reseting itself, is it possible for me to count the data continously for 1 minute and then resetting it to zero, do anyone have tried this before, or if any one have the program can you send it to me.
This is for our students in the lab to see the function and see the variations in the heart beat.
Any help will be appreciated.
 
Thank you.
 
Brian.
0 Kudos
Message 1 of 20
(5,288 Views)
The easiest way to make this measurement is to take data for 10 to 15 seconds, then use Extract Single Tone Information.vi.  The output should be the frequency in beats/sec.  Multiply by 60 and you are there.  This VI is Fourier transform based, so needs about 10 cycles to get a reasonably accurate measurement.

If you need more info, let us know.
Message 2 of 20
(5,273 Views)

Thanks Gray,

But I dont want to a post proocessor for the 10 or 15 seconds.

What I want is the peak detector should keep on counting the peaks for the first minute and then reset to zero and start counting the peaks for the next minute and so on..

I think I made sense.

Thank you.

 

Brian

0 Kudos
Message 3 of 20
(5,259 Views)
Could you post a picture of the waveform you are observing?  Peaks are defined in different ways for different applications.
S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
Message 4 of 20
(5,241 Views)
The easiest way to do this is to loop on the data you are streaming from the DAQ card using either Threshold Peak Detector PtByPt.vi or Peak Detector PtByPt.vi.  Increment your count every time you hit a peak.  To reset every 60s, use Tick Count (ms) as the x input to the Quotient & Remainder primitive, 3600 as the y.  When the R output goes from 3599 to 0, reset your count to 0.  You can find this by passing the R output to a shift register.  When the new value is less than the old value, reset your count.

There are other, more complex, ways to do this, if you run into trouble.  But that should get you started.  Let us know if you need more help.

P.S.  If you want, there is no reason you can't use both the peak detector and FFT based methods simultaneously.  Your data rates are very low, so your computer should be able to do both calculations in real time.
Message 5 of 20
(5,225 Views)

Thanks Gray,

I will try it out today and let you know what happens.

Brian

 

0 Kudos
Message 6 of 20
(5,211 Views)

Hi Gray,

I am sending you the VI for the description you have sent but still I am not able to get the out put, can you please check the VI and if wrong can you please correct me.

Thank You.

 

Brian

0 Kudos
Message 7 of 20
(5,157 Views)

Hi Sudir,

Here is the screenshot of the output of my circuit, can you have a look at it.

Thank You.

 

Brian.

0 Kudos
Message 8 of 20
(5,153 Views)
Sorry for the long delay.  Most of the company is on vacation last week and we are trying to get things out the door for NI Week.  My apologies.

The VI you posted will never change its outputs because the input data to the analysis in the loop is static.  However, after looking at some of your actual data, I think a simple peak detection will cause you problems.  This is due to the fact that your signals are complex and not all the same amplitude.  This results in some of the minor peaks on the larger signals being about the same size as the major peaks on the smaller signals.  While you may be able to tweak the threshold to get a good signal, it is a very brittle solution that will not work reliably.

To solve this, use a cross correlation function with a representative pulse to "prefilter" the data.  Then run a peak detector.  Information on correlation functions can be found in most statistics books and in Numerical Recipes in C, by Press et. al.

You can make your posted code "work" by changing the WHILE loop to a FOR loop (right click on the loop and select "replace with FOR loop") and wiring the 2D array directly into the peak detect VI, using autoindexing at the loop boundary (default behavior).  This will cycle through your data and give you a changing output.  In a real-time environment, you would keep the WHILE loop and put your data acquisition block inside it.  You will probably need to deal with half-pulses showing up on the edges of your data.  Shift registers are your friend in solving this issue.

Note that your dt and sampling rate inputs are simple inverses of each other, so you only need one of them.  In addition, you have a lot of redundancy in the FOR loop and top code paths.  These could be combined into a single FOR loop fairly easily.

Finally, you might try searching these forums for other examples of this type.  For example, Analysis of ECG Signal may have something of interest.  As that thread says, heart beat analysis is not trivial.  Good luck.
Message Edited by Support on 03-16-2009 09:41 AM
Message 9 of 20
(5,114 Views)

Hi Gray,

Thanks for the information, I tried working on what you said  and made changes accordingly but didnot work, if possible can you make changes on my program,

P.S.: I am not of a good programmer, It would be very helpful if you can edit the changes needed for the VI.

THANK YOU IN ADVANCE.

Brian 

0 Kudos
Message 10 of 20
(5,104 Views)