LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding time interval between two consecutive valley points of a signal

Hello,

I serched in the forum to get realted posts of finding time interval between two consecuitve valleys of an analog signal and was understood that converting analog signal into digital will give the reuired.But I don’t want to convert them into digital signal by giving out some threshold value.

Can someone explain of how to find the time interval between two consecutive valley points of an incoming analog signal(as shown in the attached image) and store them in an array. 

Thanks.

0 Kudos
Message 1 of 10
(4,007 Views)

Hi GoviRe,

 

What do you mean by "consecutive valley points" ?

Doesn't it match your frequency acquisiton ?

 

BR,

Vincent

0 Kudos
Message 2 of 10
(4,003 Views)

Hi Vincent,

Yes,you are right teh simplest way to do it is to find the frequency.

But is there any way to find the time intervals between the two consecutive valley points(as illustrated in the attached image) as I want to calculate,collect them over a period of time and to calculate the standard deviation for time intervals obtained for a particualr duration of time.

thanks.

0 Kudos
Message 3 of 10
(3,991 Views)

Hi,

 

Try to use threshold detector.vi

You are going to get your signal derivative. Each time it reaches 0, save the time.

Hope it helps

 

BR,
Vincent

0 Kudos
Message 4 of 10
(3,979 Views)

In recent versions of LV the Peak Detector VI has an option to detect peaks or valleys. In earlier versions you need to negate the signal  and then find peaks.

 

Lynn

0 Kudos
Message 5 of 10
(3,967 Views)

signal is what ? anyways. here is example, signal is a sine wave withouth time information.  Very rough code, but it seems to work,

Capture-derivative.PNG

0 Kudos
Message 6 of 10
(3,958 Views)

Hello,

I used the Peak detection.VI for finding the peaks but I don’t understand of1) how to get the time intervals between two consecutive peaks for every 5mins duration and 2)how does the peak detector works if a signal peak has its first half part in the first sample interval and next half part in the next sample interval.

Can anyone help me with these.

Thanks.

Download All
0 Kudos
Message 7 of 10
(3,861 Views)

1. The values in the Peak Locations array are the interpolated indexes in the input array where the peaks occur. So the time between peaks is the difference between the locations multiplied by the sampling period dt.

 

2. The peak detector cannot accurately detect "partial" peaks. You need extract the portion of the array following the last valid peak in the data set and then prepend that to the next dataset acquired. You may also need to keep track of the locations in some time frame referred to the beginning of the acquisition.

 

Lynn

0 Kudos
Message 8 of 10
(3,848 Views)

Hi Lynn,

Thanks for the explanation.But I dont understand of how to implement them in Labview.Could please post some related example programmes or help me to make this vi implementation.

thanks.

 

0 Kudos
Message 9 of 10
(3,818 Views)

I do not have time now to put together an example.

 

Take some time to think it through and design what you need before you start writing code.

 

If you need to keep all the raw data, make one big array to hold it. Then analyze that by segments.

 

If you do not need to keep the entire array, then keep a shorter array which contains all the data after the last identified peak. You may also need to keep track of the index in the array relative to what it would have been if you kept the entire data set in one array. Each time a complete peak is found, remove that portion of the data and all baseline data older than the peak from the shorter array. Every time new data is acquired append it to the shorter array.

 

In either case the array (large or small) will be in a shift register. The index for the shorter array would be in a separate shift register.

 

Lynn

0 Kudos
Message 10 of 10
(3,811 Views)