07-05-2012 03:58 PM
Hi everyone,
I am new to LabVIEW and I am a little bit confused with the definition and relationship of these terms. I have a DAQ device and I am trying to output a sine wave of 1004 Hz through one of the analog ports. I am using the basic function generator in labview to generate this signal for me but I dont know exactly what to put for the # of samples and the samples rate. If I just set the sampling rate to be a lil bit more than twice the frequency, I dont get a clean sine wave in the oscilloscope.
thanks for your help,
JkUco
07-05-2012 04:25 PM
Sample Rate means "points per second". Suppose you want to make a 1 Hz sine wave (goes up and down once per second). If you set your sample rate at 1000 Hz (1000 samples per second, or 1 KHz), you will generate 1000 points every second, 250 "going up from 0", 250 "going back to 0", 250 going negative, and the final 250 returning you to zero. If you were to plot this using the LabVIEW Chart, you'd see a nice smooth 1 Hz sine wave.
There's something called the "Sampling Theorem" that says you need to sample at a speed at least twice the highest frequency of your signal. Consider sampling at 1000 Hz, but using a 500 Hz sine wave. You'd get one point at the peak, one at the bottom, then the third point would be at the peak of the second cycle, the fifth at the peak of the third, etc. To see a "nice picture" of your signal, you may want to sample 10 times faster than the signal (that means you're drawing the sinusoid with 10 points).
07-05-2012 05:13 PM
Thanks for the quick reply Mr. Schor.
That answered most of my questions, but I still have one left.
The basic function generator also needs the number of samples (this is different from the samples per second). Does this needs to be the same as the samples per second or different? If its something different, what is it?
Thanks again,
JkUco
07-05-2012 06:10 PM
Since you are dealing with sine waves, a single periond would have (Fsample/Fsignal) samples.
07-06-2012 03:42 PM
Suppose you have a function generator outputting samples at 1KHz (1000 samples per second). Let's say you have it making a 10 Hz sine wave, which has a period of 0.1 second. It takes 100 samples to make this sine wave, right? [1000 samples/sec * 0.1 sec = 100 samples].
Now suppose you generate a finite number of samples, say 500. What would you expect to happen? Well, at 1 KHz, this many samples will "play" in 0.5 sec, and if they are playing a 10 Hz sinusoid, you'll get 5 sine waves out.
But what if you want, like a "real" function generator, to have a 10 Hz sine wave repeating "until I tell you to stop"? For this, you don't want a finite set of samples (because you'll get to the end, and it will stop), but to run in "continuous" mode. In this mode, you put the signal generator inside a loop, let it run at its own rate (in our case, 1KHz), take the numbers as they come out and send them to something like a LabVIEW Chart that can take essentially an infinite number of points and show you the last, say, 1000, as a scrolling display. You'll want to put a "Stop" button inside the loop, of course, so you can stop things when you're ready.
02-21-2015 08:29 PM
hello everyone can somebody tellll what is the maximum frequency NI MYDAQ can produce
its given the maximum sampling rate is 200 kS/s
02-22-2015 10:40 AM
As your question isn't related to this very old thread, you should create a new thread to ask your question. It would also make sense to post it in the academic forums.
If you're too impatient, you could also opt to open the spec manual and receive the answer that way.
Either way, bumping old threads with irrelevant questions is a bad habit to get into.
02-22-2015 12:13 PM
actually I m new to this forum and I could not find out how to create anew forum
but still i would appreciate an answer for my question
thank you
02-22-2015 12:18 PM
At the top of the LabVIEW message board, there is a blue button that says "New Message". Click that.
02-22-2015 12:30 PM