LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT, How do I control the frequency domain?

Hello!

There are 3 items in my zip file, an XML, a VI, and a picture. Drop the XML onto your C:\  drive. The XML contains sinusoidal sample data. The operating frequency of the device under test is 5 MHz.  The samples were collected using a sample rate of 100MHz. I want to run an FFT on the sample data to examine its composition from 0-10 MHz. The picture shows an existing FFT with a frequency domain of 0-10 MHz. The y-axis is in decibels. 

 

How do I control the input values of the frequency domain which are used to produce FFT output values? How do I modify my existing VI to output in the same format as the picture?

 

I am a novice LabVIEW developer with just a month of experience. I am so very thankful for your assistance!   - John

0 Kudos
Message 1 of 14
(2,694 Views)

Hi JDu4,

 

do you mind to attach your ZIP file?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 14
(2,651 Views)

Zip attached. -  John

0 Kudos
Message 3 of 14
(2,641 Views)

Hi John,

 

the FFT result in your VI essentially looks the same - as soon as you set the same X and Y scales:

check.png

(As you should know the exact sampling frequency you don't need to guess like me using that frequency control…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 14
(2,635 Views)

In my "Introduction to LabVIEW" talk, I have a slide titled "Concept of Time", which points out that Time is an important data feature of LabVIEW (think of digital samplings at evenly-spaced time intervals, or sampling at a particular frequency (1/time)).  LabVIEW has a data-type, the Waveform, that bundles time-of-acquisition (t0), time-interval-of-sampling (dt), and the sampled data array (Y) in a cluster -- it is the optimal data structure to save sampled data from a DAQ device.  If you pass a Waveform (which includes dt) to an FFT routine, it will give you a Cluster that has an array of frequencies and also the frequency spacing, df.

 

Look at the Waveform Functions on the Block Diagram.  There's one called "Build Waveform".  Expand it to show t0 and Y.  Y you wire in from the 2D Dbl that you currently have going into your Spectral Measurements Express VI.  dt you compute from 1/Sampling Frequency.  In fact, if you do this a step earlier when you are parsing your XML string and get an Array of Waveforms, your Waveform Graph will have the correct Time axis (because you gave it dt).

 

Bob Schor

Message 5 of 14
(2,634 Views)

Bob, 

Thank you! This is very exciting! I will work through your directions and re-post my altered VI. I must say, it's a little mentally taxing. I'm sure at day's end it will be worth it as I need to be able to defend my work. I'm looking forward to mastering this topic. Your comments and guidance are invaluable to me! Many Thanks!-  John

0 Kudos
Message 6 of 14
(2,631 Views)

Thank you Gerd! The pic will help me rebuild my VI! I'm glad to see that with a little more learning I"ll be close to producing the results I need. As a new LabVIEW programmer, your assistance and guidance is invaluable! Thanks! -  John

0 Kudos
Message 7 of 14
(2,621 Views)

Bob,

Is your "Introduction to LabVIEW" available for download? - John

0 Kudos
Message 8 of 14
(2,620 Views)

Nathan@home wrote:

Bob,

Is your "Introduction to LabVIEW" available for download? - John


No.

0 Kudos
Message 9 of 14
(2,597 Views)

I was able to get the waveform graph desired. Thanks! 

0 Kudos
Message 10 of 14
(2,580 Views)