# LabVIEW

cancel
Showing results 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.

Message 1 of 10
(3,320 Views)

## Re : Finding time interval between two consecutive valley points of a signal

Hi GoviRe,

What do you mean by "consecutive valley points" ?

Doesn't it match your frequency acquisiton ?

BR,

Vincent

Message 2 of 10
(3,316 Views)

## Re : Finding time interval between two consecutive valley points of a signal

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.

Message 3 of 10
(3,304 Views)

## Re : Finding time interval between two consecutive valley points of a signal

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

Message 4 of 10
(3,292 Views)

## Re : Finding time interval between two consecutive valley points of a signal

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

Message 5 of 10
(3,280 Views)

## Re: Finding time interval between two consecutive valley points of a signal

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

Message 6 of 10
(3,271 Views)

## Re: Finding time interval between two consecutive valley points of a signal

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.

Message 7 of 10
(3,174 Views)

## Re: Finding time interval between two consecutive valley points of a signal

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

Message 8 of 10
(3,161 Views)

## Re: Finding time interval between two consecutive valley points of a signal

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.

Message 9 of 10
(3,131 Views)

## Re: Finding time interval between two consecutive valley points of a signal

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

Message 10 of 10
(3,124 Views)