Showing results for 
Search instead for 
Did you mean: 

Traveling through sine waveform in time



I'm writting algorithm which will select time intervals on sine waveform.

My question is how can I use timing with sine waveform?

I want to pick samples starting with t0=0 and during time tINT, and in next iteration starting with t1=T+deltat and during time tINT.

Do I need too use timed loop or is it posible to do it in for loop?


Please, underneath is .vi.

0 Kudos
Message 1 of 2



I am not sure I understand how you are determining the times.


Extract the array of samples from the waveform (Get Waveform Components.Y). The calculate the start index and the length of the interval in terms of the array index.  For example the length is [duration/dt]. Convert the result to I32 datatype because that is what the array functions need for index and length.  Use Array Subset to get the portion of the array you want.  If you want to go back the the waveform datatype, use the Build Waveform function with the original waveform and Ysubset as inputs.


Repeat in a loop as needed.  Probably a while loop rather than the for loop you have.  The for loop will attempt to repeat the process for each element in the array, which is not what I think you want.



0 Kudos
Message 2 of 2