LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting a whole-number multiple of one period of a periodic waveform, without knowing the frequency of the signal

Hallo everybody,

 

I´m rather new in LABVIEW and by now, I wasn't able to find a suitable vi for the mentioned task.

 

I´d like to extract exactly for example three or four periods of a periodic waveform signal. To avoid an error because of not being aware of the absolute frequency of the signal, I do not want to detect a single trigger signal at let´s say the first positive zero crossing and count the samples or dt from this point of first trigger detection.

 

Instead I want to detect this first trigger location at a certain level, remembering the index the trigger was detected and detect a second trigger for example exactly four periods later at the same level, also remembering the index. All the trigger vis I found rather detect one single trigger location or support a start and stop trigger within one period, not more.

 

I principle what I need is a vi, that counts zero or certain level crossings and additionally remembers the corresponding locations.

 

Thanks for your efforts and have a good weekend.

 

Best regards

0 Kudos
Message 1 of 3
(2,986 Views)

Exactly what you want does not exist, so you will have to write some code, but the basics are there.  For example in the Mathematics»Zeroes palette, there are several VIs which will find the zeroes of functions and/or datasets.  You can also use the trigger VIs to find the first zero, use the Tone Extraction VI to find the frequency, then calculate the period and number of points you need and tune it with a line fit to that region.  Finally, you could do all the zero crossing finds yourself (see the online Numerical Recipes books for a good explanation of zero finding).

 

If you are still having problems, post your code and the community would be happy to help you out.

0 Kudos
Message 2 of 3
(2,955 Views)
Actually, the clfn inside the trigger detection function returns an array of all trigger locations so the function can be modified for your use.
0 Kudos
Message 3 of 3
(2,949 Views)