LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calculating input data for signal generation

Hi,

 

I'm developing an application in Labview and have a few questions on signal generation. I'm not very familiar with sampling theory, apart from the sampling theorem. My qusetion is how do I calculate the input data (sampling frequency, numbre of samples, frequency, etc.) for the signal generation VI? If, for instance I want an output of 84KHz? Here's the information I found on the NI page:

 

*****************************************************************************************************************************

Problem: What equations should I use to programmatically set my output frequency in LabVIEW? Is the update rate the output frequency?

Solution: In general, the rule of thumb to calculate the output frequency is as follows:


Output Frequency = Update Rate / Samples per Period

Therefore, if you have a desired output frequency and know the number of samples in one period of the waveform you are outputting, you can calculate the
target update rate to specify. When you use one of the custom waveform generation VIs in LabVIEW, the calculation gets more involved. The waveform
generation VIs have inputs for Frequency and Sampling Information. The Sampling Information contains a setting for the Sampling Frequency and the Number
of Samples. To calculate the number of samples per period that the waveform generation VIs generate, use the following equation:


Samples per Period = Sampling Frequency / Frequency

Therefore, if you are using the waveform generation VIs to generate the waveform you are outputting, calculate the output frequency with the
following equation:


Output Frequency = [Update Rate × Frequency] / Sampling Frequency

 

*****************************************************************************************************************************

 

So that's how I am making my calculations. Nevertheless, I suspect I'm doing something wrong. The output frequency is the one I want to get right? If I specifiy as "samples per period" 8000, the update rate is 672E6. For sample frequency I'm using 168KHz and then I calculate the frequency with the last formula. As I understand it, the variable "frequency" is the one I've got to specfy as input for the signal generation VI, is this correct? So far, I get F=21 Hz, which seems to be far too small. Could anyone please explain what I'm doing wrong?

 

 

 

Also, do these formulas apply for the IIR filtrer VIs? That is, should I specify the cutoff frequency as the actual frequency of my signal or make the same calculations as above?

 

Thanks,

Ali

0 Kudos
Message 1 of 2
(2,911 Views)

Hi!

 

Thanks for using National Instruments forums. You should use only the first equation, second and third equations are used only for simulated signals using waveform generation VIs.  Check this links for more information about generation frequencies and valid values for your DAQ card:

 

http://digital.ni.com/public.nsf/websearch/4BBE1409700F6CE686256E9200652F6B?OpenDocument

 

http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/dbe7ac32661bcf9b86256ac000682154?O...

 

Regards

Carlos Pazos

Senior Product Marketing Manager

National Instruments
Message 2 of 2
(2,782 Views)