05-09-2013 05:12 AM - edited 05-09-2013 05:22 AM
Hello all.
I am studying human pulse waveforms and attempting to detect peaks in real time. I have a continuous stream of data coming in a serial port, this is converted from characters into integer values which are then plotted as a moving waveform. It is a good clean signal with little noise so I thought the easiest way was to keep a running array of values and, when the present value is less than the one before the previous value, (to allow for any single sample noise) that is the point where the peak has just happened. I then switch an LED.
The point then is that I don't want the LED to stay on all the way down the slope, just flash briefly. Then I guess I need to ignore the comparison until the signal has gone past the valley and then start looking for a downward slope again.
Can anyone tell me how, once the peak has been detected, to ignore looking for it until I'm on the upward slope again, maybe some sort of latching case structure, unlatched by a positive slope?
I know there are peak detection functions in LV but they don't seem to suit real time waveforms. And I can't have thresholds because the signal amplitude may vary considerably.
Thanks for any help.
Andrew
BTW, I'm using LabView 2012.
05-09-2013 05:29 AM
Hi,
You could use the edge detection SUBVI
refer URL
https://decibel.ni.com/content/docs/DOC-1047
hope this helps.
05-09-2013 05:33 AM
Hi,
This subVI is only for the action of LED being enabled for predefined time duration.
However, for peak detection, you may need to build the data inside the loop and wait for set of data point (depends on the acquisition rate of the application) to be collected and run the peak detection function.
05-09-2013 05:48 AM - edited 05-09-2013 05:52 AM
Hi ASH2020,
how about calculating the signal's discret first derivation; the derivation's sign should indicate a positive or negative slope.
Alex
05-09-2013 12:18 PM
Hey thanks for that. NaruF1 I doubt it would work here, it's an analogue waveform, more like a sine wave, but it could be useful for other stuff I'm doing.
05-09-2013 12:20 PM
Alex, thanks. This looks very interesting. Problem is I know nothing about calculus or derivatives, and I mean nothing. Must have been off school that day! However, that's never stopped me before so I will see if I can understand some of it. Cheers. Andrew
05-09-2013 02:27 PM - edited 05-09-2013 02:31 PM
@ASH2020 wrote:
Alex, thanks. This looks very interesting. Problem is I know nothing about calculus or derivatives, and I mean nothing. Must have been off school that day! However, that's never stopped me before so I will see if I can understand some of it. Cheers. Andrew
I appreciate this! Remember: I mentioned about DISCRETE calculus.By the way, I didn't have this in school either