LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between sample rate and no. of samples

Hi all,

     I need to be get cleared of, what is the difference between sample rate and no. of samples?

     Here for example, i have a signal wave signal generation function and in that it has Frequency, amplitude and No.of samples and Sampling rate.

 how i can differentiate between frequency and sample rate and no.of samples?

pls explain it in very simple.

thank you in advance.

Dinesh

 

0 Kudos
Message 1 of 6
(7,596 Views)
  • Frequency  =  number of cycles per second of the sine wave you are generating.
  • Amplitude  = voltage above or below zero that the sine wave reaches.
  • sampling rate = number of times per second a voltage is being output.  You need it to be higher than the frequency.  sampling rate/frequency will be the number of samples that make up a given cycle.  The higher the sampling rate, the closer to a true sine wave the resulting signal will be
  • no. of samples.  how many samples will it put out.  Will determine how long the signal will last .   no. of samples/sample rate will give the duration of the signal.   If you output a sine wave at 10,000 samples per second, but only generate 1000 samples,  you'll have  only 0.1 seconds of a sine wave generated.
0 Kudos
Message 2 of 6
(7,583 Views)

Which function are you specifically looking at?  Did you read the help?

 

But a quick run down:

Frequency - The frequency of the sine wave you want to output

Amplitude - How big the peaks of your sine wave should be

Number of Samples - This should quite obvious

Sample Rate - Also known at delta t, the amount of time between samples.  This is typically in seconds/sample.

 

Of course, now you have to take into account Nyquist and a lot of sampling theory.


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 3 of 6
(7,580 Views)

In the waveform-based signal generation functions, the sample rate and # samples are bundled together.  So let's address them as a pair and consider a sine waveform as an example.

 

The combination of sample rate and # samples will define the *total time interval* over which you will generate specific sampled values of your sine waveform.  Specifically:

(# samples) / (sample rate) = (total time interval) 

 

 

The frequency input refers to the frequency of the sine waveform itself.   To relate it to the sampling parameters, consider instead the period where (period) = (1 / frequency).  The *period* of the sine waveform is the time interval needed to complete exactly 1 full sinusoidal cycle.

 

In many real life applications where you use a DAQ board to send such a waveform out into the real world, it's important to fit an exact integer # of *periods* of the waveform into the *total time interval* defined by the sampling parameters.  That way when the task wraps around from generating the last defined sample back to generating the first one, the real world signal looks more like the continuous function.

 

A very long time ago I was in a discussion about this kind of thing and posted a little utility to help manage it.  Sorry to say, the discussion is kinda dense and the terminology I used isn't really intuitive.  But the basic idea there is sound.   If interested, check it out here.

 

[Edit:  hmmmm, it seems the examples at that link aren't accessible any more.  I notice I had a comma in the filenames, I wonder if that's causing problems.  Substituting a %2C for the comma character in the URL didn't help either.]

 

-Kevin P

 

 

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 4 of 6
(7,578 Views)

@crossrulz wrote:

 

 

Sample Rate - Also known at delta t, the amount of time between samples.  This is typically in seconds/sample.

 


Rate is the reciprocal of delta-t (it is a rate, or how many per second).  Sample rate is often specified in Hz (unless it is very fast, in which case it is in kHz or MHz, or many even GHz!).

 

0 Kudos
Message 5 of 6
(7,555 Views)

@Bob_Schor wrote: Rate is the reciprocal of delta-t

I am remembering using a VI that asked for the sample rate in seconds/Sample.  I am not finding it now.  So just be sure to check to make sure you are using the right setting for a VI.


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 6 of 6
(7,548 Views)