LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

counting periods from function genertor / sine waveform and approximting real periods

 

with the function generator.vi and sine wave form.vi embedded in a while loop, a single point of a sine function can be output for each program cycle. After a specific amount of iterations have occured (ie the sample number equals the amount of samples taken each loop), a single period is complete.

 

backpanel.jpg

 

Questions..

 

1.How can these waveforms be best used to approximate real time waveforms. Ie. In the above example, the 1htz sine wave appears to be running at more like 1000htz.  I guess I would have to increase the sampling period?  What is the best method?

 

2.  Is there a way to do peak detection or count the amount of periods which have occured? This is somewhat tricky as only one point is coming out at a time so im guessing an array would have to be built. There has to be a simplier way to verify the rate at which it is running.   I guess mathematically it could be done but checking it is good too.

 

 

 

0 Kudos
Message 1 of 8
(3,339 Views)

what is your sampling info set to for it to have 1 hertz to make it 1k hertz ?

 

if it's the default settings, 1000 rate and 1000 samples then I don't see what is wrong.

 

0 Kudos
Message 2 of 8
(3,335 Views)

WOW!

 

Another post that wants the (Windows?) mSec timer to be tracable to the NI Second.   Basically, it can't happen! TIME (as a measurement) cannot be related to the system mSec timer.  Use an external time referance.


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 8
(3,318 Views)
Setting the function generator to output a single sample and then expecting some correlation to the frequency setting is just silly. The frequency of the output is solely based on how fast the loop iterates. I don't know what you are trying to simulate but I think you are going about it the wrong way. At least put in some delay to simulate acquisition timing if that is the purpose.
0 Kudos
Message 4 of 8
(3,312 Views)

sdpark

 what you are doing is sampling a sin wave 1000 times and then during each while loop iteration, creating a thousand points..

  so it looks stable as you are recreating the same 1000 points each loop.

  for more practical apps, you need to do just one point at a time of the sine wave

  thanks for trying though.

 

 

0 Kudos
Message 5 of 8
(3,307 Views)

jeff,

Ill give the external clock a shot tomorrow.

this sounds like helpful advice

thanks

Message Edited by jimmyinCT on 10-18-2009 07:59 PM
Message 6 of 8
(3,306 Views)

 dennis,

yup, its pretty obvious what is happening,..

but, you didnt actually say how to fix it.

  i think the external clock that was previoiusly mentioned is the best answer, if it works.

  Ill post back

 

0 Kudos
Message 7 of 8
(3,304 Views)

PUT IN SOME DELAY TO SIMULATE ACQUISITION TIMING.

 

If you want to acquire every one second, then the delay is 1 second.

0 Kudos
Message 8 of 8
(3,299 Views)