LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Separating two datasets at different amplitudes

I expect this might be quite easy but I cannot think of a solution at the moment. I am trying to separate the two signals as shown in the plot attached. I need these two signals separated such that they are on different plots so I can estimate AC and DC values (for pulsed oximiter R value). I have separated them by decimating the signal since they alternate however, this is not a real dataset. If the points do not alternate exactly this method will fail to separate the two signals. This thresholding method should be much more robust. 

 

Any help is greatly appreciated.

0 Kudos
Message 1 of 6
(158 Views)

@tobygraham wrote:

This thresholding method should be much more robust. 


You said it: "thresholding".

Compare your points to a fixed threshold. This threshold could be for example the average of all points.

Then sort them according to the comparison result.

 

However this won't work in case your 2 curves overlap. Maybe you should rather concentrate on why your input data is all mixed up and not correctly structured to begin with.

 

Regards,

Raphaël.

0 Kudos
Message 2 of 6
(130 Views)

Once the values are no longer alternating, splitting the data in two signals will also mess up the timebase, because the time values for each point are no longer equally spaced and the two traces are no longer correctly aligned. Does each point pair correspond to the same time value at the moment? Is time important? (I am sure it is, at least for AC)

 

Can you attach some typical data? What can cause the values to no longer alternate (missing values? communication errors?)

 

Also estimating parameters for each trace does not depend on any "plots", that's just a way to present the data in the wire the the user.

0 Kudos
Message 3 of 6
(119 Views)

Thanks for your reply. I honestly am not entirely sure how significant preserving the time base is. I have attached my vi with the virtual data set. I have managed to successfully separate the two signals by using peak detect vi with a threshold. When building these waveforms, changing the dt value does appear to change the R-value quite drastically. However, I'm not sure what dt value is the correct choice. I am told an appropriate R-value should range between 0.5 to 0.7 with lower values being more desirable. My understanding of this topic with regard to pulsed oximeters is limited. Perhaps you could take a look at the vi and let me know what you think? 

0 Kudos
Message 4 of 6
(83 Views)

OK, your data is 100% regular, with 40 point forming a repeat, each repeat containing four segments of 10 points.

You never said you had dynamic data! Dynamic data already has timing information, so dt is known.

 

You have to decide how to treat dt of the resampled data. Do you know how long the current dataset is supposed to be? (I adjusted dt so the total duration (20s) is the same, but that might be wrong. Maybe it is only 5s after decimation?)

 

In any case, here's how you would split the data. Seems to work just fine. You simply need to ensure that the data starts at a repeat boundary and you could do that automatically by analyzing the first 40 points or so....

 

altenbach_0-1713711937711.png

 

Could it be that the two traces at ~0.02 are the true zero for DC estimation?

 

0 Kudos
Message 5 of 6
(59 Views)

Here's one possibility to detect the start of a repeat. We simply look for the first time the data drops by >0.15, but that could be smarter.

(this time I assume that dt is correct.)

 

altenbach_0-1713714322424.png

 

0 Kudos
Message 6 of 6
(51 Views)