09-21-2018 09:08 AM
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
09-21-2018 09:35 AM
09-21-2018 09:38 AM
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.
09-21-2018 09:41 AM - edited 09-21-2018 09:49 AM
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
09-21-2018 01:30 PM
@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!).
09-21-2018 02:05 PM
@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.