LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

relation between frequency and sample rate

Hi
I am trying to generate voltage and also measure some voltage in the same program. I am confused about the frequency and sample rate. I have tried to generate a 1000Hz frequency with amplitude of 1 volt. With a sample rate of 5000 when i tried to check in an oscilloscope, the frequency is different, i mean it shows 2000Hz frequency and with a sample rate of 10000 only it shows the correct frequency. I also want to know what shud be the input sample rate. I notice that the signal generated is more or less correct but not stable. What shout be my input and output sample rate for 1KHz frequency?
0 Kudos
Message 1 of 3
(3,160 Views)

Not sure exactly what is your problem.  If you are able to post some code, i might be able to help.

Craig

LabVIEW 2012
0 Kudos
Message 2 of 3
(3,154 Views)
Hi Amber,

The theoretical limit to reproduce a frequency is given by the Nyquist theorem.  There are many articles about this on the web.  Here are a few brief sections from our high speed digitizer manuals:

Nyquist Theorem
http://zone.ni.com/reference/en-XX/help/370592E-01/digitizers/nyquist_theorem/

Aliasing
http://zone.ni.com/reference/en-XX/help/370592E-01/digitizers/aliasing/

Although the theorem says you can reproduce the frequency of a 1000 Hz sine wave at 2000 Hz, the shape will not be maintained. It will look like a triangle wave at best.  When trying to generate an output frequency of 1kHz, a 10kHz generation rate gives you 10 samples to represent each cycle of your sine wave, which starts to look ok.  In general, try to generate at at least 8-10 times the maximum frequency in your signal and higher if you aren't limited by your hardware.  I hope this helps.
Regards,
John Bongaarts
Message 3 of 3
(3,116 Views)