Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

sample positioning

Hi.

 

I'm working with sine wave samples.

 

I want to implement these formulas in my vi: y1=y(t0), y2=y(t0+1/(3*fc)), y3=y(t0+2/(3*fc)), etc.

Only problem is that I have samples saved in array.

So I don't have time in my x axis, just ordinal number of sample.

 

Is there a way to pick a correct sample, if a frequency of a sine wave is known?

 

Thanx,

Kristina.

0 Kudos
Message 1 of 2
(2,499 Views)

Greetings,

 

Assuming all of your data points are evenly spaced in time you can use your knowledge of the change in x between given data points and the number of points to determine time. I.e. if deltaX is 1 second, and t0 is 0 seconds, then using the equation of t=t0+n*deltaX we see that the fifth point would occur at the five second mark. This, however, operates under the idea that you're working in the time domain. A similar procedure can be followed if you are working in the frequency domain though. Unfortunately I'm not really sure what you're trying to accomplish based on the information you've provided. At the moment it looks to me like you're trying to perform a calculation using both the time and frequency domain at the same time which I suspect will not work. What kind of data do you have in your array? what does your fc variable represent? If fc is a frequency, why are you adding frequency to time? Perhaps a more thorough explanation of what you're trying to do with these formulas and how they relate to your equations would enable to me to assist you further. I hope this information helps.

 

Thanks,

James

 

Product Support Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,485 Views)