LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Peak detection (threshold detector) from spreadsheets.

Sounds good! Thank you)

0 Kudos
Message 11 of 30
(827 Views)

I am not sure just what you are tring to do.

 

The output from the Peak Detector is not the orginal wave form but an array of the location of the peaks.

So the code on the right half of your VI makes no sense to me

 

This is what your data looks like

waveform.png

So what is it that you are trying to measure?

Omar
0 Kudos
Message 12 of 30
(822 Views)

Right half of the the code counts number of samples between two initial peaks from two waveforms. Then this difference is transmitted to seconds depending on simulated sample rate. At least I think that the vi does it...

 

0 Kudos
Message 13 of 30
(817 Views)

Somehow the graph represents not time, but number of line corresponding to a peak. This is strange =\

0 Kudos
Message 14 of 30
(813 Views)

So you only wish to know one delta time

The delta between the orange and the blue?

Where along the rising edge do you wish the measure .2, 1.4 or somewhere inbetween

waveform.png

 

At the 0.2 V level delta Time is 1.37 nsec

At the 1.4 V level delta Time is  3.00 nsec

Omar
0 Kudos
Message 15 of 30
(807 Views)

Omar,

 

I think that threshold should be 0.2...

 

If I want to calculate time difference between these two initial peaks, I do it like this:

4056.2 - 4044.2 = 12. I know that each sample is 0.002E-7 s (according to the spreadsheets).

Then time difference is: 0.002E-7 seconds * 12 samples = 2.4 ns. 

 

I added this part to your VI.. Please have a look.

But here there is a problem, that these points (4056.2 and 4044.2) are not peaks.

 

I tried to run your VI with my spreadsheets and the picture below represents what I obtained. I tried to optimize the graph to make it look like yours, but I didn`t manage. However, the graph is not of most interest..  The most important is to calculate time difference..

123.jpg

0 Kudos
Message 16 of 30
(797 Views)

The addition you added returns the exact same answer. It is doing the exact same thing

It pulls the same 2E-10 dt out of your data.

 

I do not have the same data file that you show in your posted image.

Post the different data files and I'll have a look

Omar
0 Kudos
Message 17 of 30
(785 Views)

Okay, here are my two speadsheets.

According to them if a threshold is 0.2V, then peaks points are 4051 (channel 2) and 4044 (channel 4). However, the systems says they are 4056,2 and 4044,2 correspondingly. So there is kind of an inaccuracy or something. 

Moreover, if I put threshold 1.4V, then peaks points are 4062 (channel 2) and 4047 (channel 4), but the system shows as 5027 and 9999, so it does not really see those peaks. 

The picture below represent what type of graph I get. So it is less detailed comparing to yours.

 

123.jpg

Download All
0 Kudos
Message 18 of 30
(778 Views)

@Ivan899 wrote:

Okay, here are my two speadsheets.

According to them if a threshold is 0.2V, then peaks points are 4051 (channel 2) and 4044 (channel 4). However, the systems says they are 4056,2 and 4044,2 correspondingly. So there is kind of an inaccuracy or something. 

Moreover, if I put threshold 1.4V, then peaks points are 4062 (channel 2) and 4047 (channel 4), but the system shows as 5027 and 9999, so it does not really see those peaks. 

The picture below represent what type of graph I get. So it is less detailed comparing to yours.

 


"According to them", "the systems says" who are 'them' and what "systems"

I have only the data files that you posted

 

Looking into the raw data with Excel the first plot crosses 0.2 somewhere between 4042 and 4043 (at about 0.4 nsec)

The 2nd waveform crosses 0.2 between 4049 and 4050 (at about 1.8 nsec)

 

The LabVIEW code returns 4042.32 and 4049.17.

I can not see any problem with the values returned using the last data files you sent.

 

I do not see any  inaccuracy at all.

 

No problem looking at 1.4 V either.

 

But again the plots of the data files do not look like the plot you posted in your picture.

Omar
0 Kudos
Message 19 of 30
(762 Views)

Do you want peaks or thresholds? You seem to be using the terms somewhat interchangeably while they actually refer to different things.  From the way you seem to be using the results I think you want thresholds.

 

Have you read this white paper? 

 

When you find the point of interest in the waveforms do you need to interpolate between the points to find a close estimate of the time whne the signal crosses the theshold or will the closest point, or the closest point lower than the threshold, or the closest point higher than the threshold work?

 

Do you only need to measure rising edges or do you need falling edges?

 

What do you do when one channel has multiple edges and the other has few?

 

Lynn

Message 20 of 30
(756 Views)