LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency, Samples per second, and number of samples.

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

 

 

 

0 Kudos
Message 1 of 14
(60,185 Views)

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).

Message 2 of 14
(60,174 Views)

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

0 Kudos
Message 3 of 14
(60,169 Views)

Since you are dealing with sine waves, a single periond would have (Fsample/Fsignal) samples.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 14
(60,162 Views)

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. 

Message 5 of 14
(60,135 Views)

hello everyone can somebody tellll what is the maximum frequency NI MYDAQ can produce

its given the maximum sampling rate is 200 kS/s 

0 Kudos
Message 6 of 14
(58,413 Views)

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.

0 Kudos
Message 7 of 14
(58,372 Views)

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

0 Kudos
Message 8 of 14
(58,352 Views)

At the top of the LabVIEW message board, there is a blue button that says "New Message".  Click that.

0 Kudos
Message 9 of 14
(58,347 Views)
What is confusing about the answer already given? Did you read this thread before posting? Do you know anything at all about the sampling theorem mentioned?
0 Kudos
Message 10 of 14
(58,339 Views)