Spectral Measurements (FFT Module)

Hi ...
I cam currently developing an application which uses the FFT Module to display frequency domain data in a waveform graph. This works as expected.
When I try to output the data with the Write Labview Measurement File Express VI, I get strange data. Here is some sample data from that file:
--begin
0.000000 7.966055 6.080002 6.564292
10.000000 5.660673 4.325652 4.671261
20.000001 0.044826 0.039543 0.041005
30.000001 0.026767 0.042807 0.045995
40.000001 0.172722 0.211967 0.209600
50.000001 0.208757 0.242115 0.287101
60.000002 0.092932 0.107328 0.131984
70.000002 0.080228 0.110453 0.125919
80.000002 0.158232 0.205056 0.238829
90.000002 0.105286 0.138517 0.164002
100.000003 0.050657 0.064442 0.076628
110.000003 0.153490 0.201062 0.232917
120.000003 0.122864 0.162590 0.189690
130.000003 0.129717 0.166817 0.193355
140.000004 0.244372 0.313255 0.369355
150.000004 0.386495 0.499145 0.583249
160.000004 0.117290 0.141132 0.159929
170.000004 0.486006 0.611568 0.715969
180.000005 2.581692 3.307030 3.914445
190.000005 12.927723 16.543368 19.553471
200.000005 13.444462 17.209441 20.336366
399950.010104 0.003843 0.002252 0.003452
399960.010104 0.005256 0.006628 0.005573
399970.010104 0.007145 0.008510 0.007706
399980.010104 0.006274 0.007517 0.007002
399990.010105 0.026896 0.026177 0.025601
--end
I am using exactely 80 000 samples for 0.1 samples.
Does anyone know where the part after the . at the frequency come from ? Shouldn't it be 400000.0000000 or 399990.000 for the last point ?

Without see the code generating data this is only a guess, but here goes.
The fact that the error starts so many decimal places out says to me that its probibly related to rounding error when dealing with floats. The basic issue is that floating point numbers aren't represented exactly in computers. There is always some rounding error involved.
The fact that the error grows at a fairly constant rate tells me that the error is being compounded over time as a value is added back to itself.
Given that you are incrementing the frequency value by an integer amount, carry the frequency internally in the code (and operate on it) as an integer. Only convert it to a float as it is about to be used. This will still give a little error -- that's unavoidable -- but at least the error won't be compounding.
Of course that "solution" is dependent upon the assumptions I'm make about your code being correct. It would be helpful to see the code.
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Similar Messages

  • How to install Spectral Measurements and Modulation Toolkits for multiple versions of Labview

    I installed NI-RFSG, NI-RFSA, the Spectral Measurements Toolkit, and the Modulation Toolkit.  I have both LabVIEW 7.1 and 8.0 installed on my system.  I developed an application in LV 8.0 and now I need to revert it to LV 7.1.  The problem I am having is that add-on toolkits seem to only have been installed for LV 8.0 because there are several missing VIs and controls when I try to open the LV 7.1 version.  I tried re-installing the toolkits, but this is not fixing the problem.  How can I get the installer to install the toolkits for both versions of LabVIEW?
    Thanks for your help,
    Cherie
    Solved!
    Go to Solution.

    Hello Cherie,
    it's a know issue. You can read it in the modulation toolkit readme :
    Two Versions of LabVIEW Installed
    The installer supports installation of the Modulation Toolkit into a single
    version of LabVIEW; installation of the Toolkit into multiple separate
    installations of LabVIEW (for instance LabVIEW 7.0 and LabVIEW 7.1 installed
    on the same PC and in separate directories) is not supported or recommended.
    An unsupported means of doing so though involves manually copying files from
    one LabVIEW installation to another. To do so, you can install the
    Modulation Toolkit to the home directory of one LabVIEW installation, and
    then manually copy the installed files to the other LabVIEW installation.
    The following list includes pertinent directories and files. Copy all files
    from these directories, including any subdirectories, using the equivalent
    relative paths to the LabVIEW home directory for the target.
    <LabVIEW Home>\vi.lib\AddOns\Modulation\*.*
    <LabVIEW Home>\vi.lib\AddOns\NISML\*.*
    <LabVIEW Home>\examples\Modulation\*.*
    <LabVIEW Home>\resource\objmgr\NIMTAttribs.rc
    <LabVIEW Home>\resource\objmgr\NIMTAttribs.rch
    <LabVIEW Home>\help\lvmod.txt
    <LabVIEW Home>\help\lvmod.chm
    <LabVIEW Home>\help\lvdmt.txt
    <LabVIEW Home>\help\lvdmt.chm
    Note that this listing does not include all installed files. Also, copying
    files in this manner is not equivalent to a full installation into the
    alternative version of LabVIEW. Most notably error text unique to the
    Modulation Toolkit will not be updated and the Example Finder listings will
    not show the Modulation Toolkit examples.
    jerome
    "CherieC" <[email protected]> a écrit dans le message de news:
    [email protected]...
    >I installed NI-RFSG, NI-RFSA, the Spectral Measurements Toolkit, and the
    >Modulation Toolkit.&nbsp; I have both LabVIEW 7.1 and 8.0 installed on my
    >system.&nbsp; I developed an application in LV 8.0 and now I need to revert
    >it to LV 7.1.&nbsp; The problem I am having is that add-on toolkits seem to
    >only have been installed for LV 8.0 because there are several missing VIs
    >and controls when I try to open the LV 7.1 version.&nbsp; I tried
    >re-installing the toolkits, but this is not fixing the problem.&nbsp; How
    >can I get the installer to install the toolkits for both versions of
    >LabVIEW?
    > &nbsp;
    > Thanks for your help,
    > Cherie

  • Does the Spectral Measurement Toolkit Support the 5644 VST?

    I'm currently in process of migrating from a PXI-5660 to PXIe-5644 in .NET.  The current measurement process is as follows:
    ConfigureSpectrumForRFSA
    CalculateCorrectionForRFSA
    NiScope.Read
    niSMT.ZoomFFT
    niSMT.AveragedPowerSpectrum
    niSMT.ApplyCorrection
    niSMT.SpectrumUnitConversion
    niSMT.SpectrumPeakSearch
    I've been mainly able to reproduce this flow with the following:
    niSMT.ConfigZoomFFT
    niRFSA.ReadPowerSpectrum
    niSMT.ZoomFFT
    niSMT.AveragedPowerSpectrum
    niSMT.SpectrumUnitConversion
    niSMT.SpectrumPeakSearch
    Of course, when I say reproduce, I really only mean I can call the above methods without getting an exception or error.  It does not mean I return any usable measurement.  I've studied the SMT programming flow, routed the data as best as I can muster, and have gone back to the working 5660 SMT usage for verification, and nothing.
    I then look to LabVIEW examples for the SMT, and here I notice that none of the SMT examples say they support any VST.  I look at SMT documentation for supported hardware and again, I don't find a reference to the 5644.  I find a forum response about when to use niSMT/niModT or RFmx and for the VST, the SMT isn't mentioned for any application.
    So, am I mistaken to think that I can use the SMT for the VST?  I've already concluded that I can't use niScope as was used in the 5660 application.  I've only begun to start looking at RFmx, but I figured before I spend a lot of time switching gears for something else, I should post my question to the community.  Is RFmx the direction I should be taking or does my problem with SMT have nothing to with adequate hardware support?
    Please advise.
    Michael Kral

    Hi Michael,
    There are several factors at play here, the first being the SMT itself, then the second being the transition from the 5660 to the VST.  You may have figured out a large part of I'll detail below, but having it spelled out might help bring organization to those thoughts.
    The Spectral Measurements Toolkit is a set of software that can help generate waveforms and analyze them.  The SMT is independent of any hardware, I've seen users with SMT/LabVIEW and a 3rd party RF instrument.  With the VST, you should still be able to use all of the SMT functions once you've gathered the data from the VST.  The Zoom FFT, AveragedPowerSpectrum, etc. will all function with the VST.  I have seen a good portion of customers using the VST with the SMT.
    On the other hand, the transition from the 5660 to the VST is an interesting and less common issue (5660 is older, VST is much newer).  The 5660 is built on top of an older scope that ran a version of NI-SCOPE based on Traditional DAQ, while our newer scopes run on a version of NI-SCOPE based on DAQmx.  To add more to the complexity of your situation, the VST's internal digitization process does not use NI-SCOPE at all.  Because of this, the functions used with the 5660 (NiScope.Read) don't make sense with the VST and will not be usable.  Instead, you will need to use the RFSA functions as it seems you've already determined.
    With these factors at play, it makes sense that you were searching for a different example that showed how to use the VST with RFSA/SMT.  The SMT examples in LabVIEW don't explicitly call out the VST as being compatible, but all of the examples will work correctly since they use RFSA and SMT only.  For LabVIEW, I usually start with SMT IQ Spectrum for niRFSA if I just want a spectrum/FFT.  Your programming flow looks pretty similar to what is in the Spectrum example, I think you're on the right track.  As a last note, RFmx is great option if you're interested in making the complete switch.  I'm assuming that this is the link you found about MT/SMT vs. RFmx; if not, it's worth a read.  You should be able to use either one, it's whatever you feel more comfortable with.
    To summarize the above and to directly answer your question: the VST should be usable with both MT/SMT and RFmx.  You mention that you aren't able to return any usable measurement, can you give us more info about the data that you are receiving?
    Thanks,
    David B.
    National Instruments
    Applications Engineer

  • Spectral Measurements Toolset

    I have just upgraded my PC to Labview and Teststand 2009. I also updated the Modulation Toolkit and the Spectral Measurement Toolkit. But alas, I have found that when updating from Labview 8.2, the files I expect to appear in the folder ...\vi.lib\addons\Spectral Measurements Toolset are not there, or the folder for that matter.
    We have installed this on a clean machine and everything is fine, but on a machine with Labview 8.2 already installed everything is not.
    I am a bit loth to uninstall everything and start again, but the worry I have is, if this is not installed properly, what else got missed.
    Any feedback on how to clean this up would be greatly appreciated.

    Hi Mike,
    I've been through the same steps as yourself, i.e. installed the Spectral Measurement Toolkit without LV 2009, installed 2009 and the toolkit didn't appear in 2009 as I expected. I then reinstalled the Spectral Measurement Toolkit and it appeared in 2009. Are you sure you are selecting the correct option when installing? By this I mean when installing you are given the option to install for different versions, are you telling it to install the "NI-LabVIEW (latest verison) Support"? I've included a screenshot to show the screen where this option is available.
    This should allow you to use the toolkit in LV2009. This option is a more reliable one than your current method and I recommend trying this to ensure it has installed properly. 
    The Modulation toolkit should have the same option screen so chose the same option as mentioned above.  
    If you try this out let me know how you get on, if you have any problems with it then I'll be more than happy to help.
    Kind Regards,
    Jas.W 
    Jason W.
    Applications Engineer
    National Instruments UK & Ireland

  • Setting video bandwidth spectral measurement

    Hello, I am a german intern (please do not look on my grammar!) in a US company and my last weeks consisted of playing with arrays, clusters and tab controls to set up a new design for a control panel in LabVIEW. So, I am a real beginner in using LabVIEW.
    My next task is to build an individual spectrum analyzer with different functions. Our Hardware: NI 5600 Downconverter, 5620 Digitizer, 5610 Upconverter, 5421 AWG. Software: LabVIEW Full 7.1, Spectral Measurement Toolkit....
    I was really impressed to find this great amount of examples for perfoming spectral measurements. And I think I will try to mix a few examples and make later a few changings to get my own analyzer.
    My question concerns the following: is it possible to set the sweep time and video bandwidth like with an ordinary spectrum analyzer.
    Do I have to create a special vi or is there an earsier way for such individual settings.
    Thank you very much for all answers.
    Norbert

    I'm not sure that what you are looking for is valid. In the standard "traditional" spectrum analyzer a narrow bandwidth variable frequency filter is swept across the band of interest, but when you are doing it digitally you basically are getting everything and then using an FFT to resolve, from the complex waveform received, the components that make up that waveform. Usually the only filtering is to limit the maximum frequency to below 1/2 of your sampling frequency to prevent aliasing (Nyquist theorem) Similarly, I'm not sure what in the FFT realm cooresponds to "video bandwidth" on your Agilent or Rhode & Schwarz Spectrum Analyzer. The width of your FFT's bins, which might be coorespondent, is related to the sample rate/sec and the total number of samples (which needs to be a power of 2), i.e. sampling at 11025 samples/sec, analyzing a sample set containing 8196 produces 11025/8196 = 1.35Hz wide bins. Now cooresponding with the sweep time on a SpecA the time needed to collect those samples would be #S* period, or #S*(1/fS) = 8196*(1/11025)= 0.743Sec. The more samples (higher resolution, narrow bin widths) the longer "the sweep".
    P.M.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Configuring the reference power (dB) in the Spectral Measurement express VI

    What is the reference power (dB) or pressure in obtaining the dB FFT response from the Spectral Measurement express VI? We need to obtain the SPL of a cellphone speaker and SPL is measured when the reference pressure/power is 20uPa or 1pW.... The data result is in negative dB but we need to have a positive result. Im thinking that maybe the reference is at 1mW.. 

    You can convert Express VIs to regular subVIs. Then open the block diagram and look at what they have done.
    In this case when you get six levels down into subVIs you find one called ma_Convert to dB.vi. It has inputs for dB reference for ch X and ch Y. The default values are 1.00. These inputs are not wired in the SubVIs of the Express VI.
    To change the reference FIRST Make a Copy if the converted Express VI with a new name. Put it into your project, not in vi.lib. Similarly, make copies with new names of any subVIs you need to change. Then make the changes you need on these copies. Document those changes so anyone looking at the code knows why the standard Express VI was not used and what the differences are. Put the changed VI in your main VI and get the SPL values.
    Lynn

  • Measuring power using NI-USRP and Spectral measurements tool kit

    Hello every one 
    I'm just inquiring how to calculate the power in a channel using NI USRP and SMT tool kit because I have failed calculating it using direct method so I purchased SMT so could any one help me by providing me with an example that describes how to calculate the power using spectral measurements tool kit , our he could tell me the steps that I could follow .
    Thanks a lot 

    Hi MHantera,
    I don't think I'm fully understanding your most recent message. The FFT Spectrum (Mag-Phase) VI in the USRP example as well as the FFT Power Spectrum and PSD VI both output a full spectrum that already includes the f0 and df so you don't need to set those. If you're using the later you should select Power Spectrum (the default for "export mode") for the In Band measurement. Using that VI are you seeing a size limitation? What settings and sample size are you trying to use? Is it returning an error about being unable to perform the FFT or are you just not seeing the results you should? Any more information you can provide about this would be helpful.
    Best Regards,
    Peter W.

  • What's the unit label of y-axis of PSD when using Spectral Measurement Express VI?

    Hi:
     What's the unit label of y-axis of PSD when using Spectral Measurement Express VI?
    Selected Measurement : Power spectral density
    Result : dB
    No Averaging..
    Is dB/Hz the magnitude label of PSD output? Thx!

    There could be an issue the the Express VI converting your waveform data into the dreaded Dynamic Data Type, which is just causing more and more memory to be used.
    So what I would recommend is use the DAQmx Configure Logging  VI to configure DAQmx to stream the data as you read straight to a TDMS file.  There are various other properties you can set to make the logging go across files.  You just set up the logging before running your task.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to create a controller for "configure spectral measurements" window

    Hello Everyone,
    Problem: We know that to change "Window" for spectral measurements. We need to double click on it , configure spectral measurement window pops up and select whichever window (eg., None, Hanning, Hamming, Blackman Harris etc) we like to view. Instead of double clicking in block diagram, I want to provide users a window controller in front panel in the form of list, so that they can select the appropriate window type as needed.
    I am figuring out how to solve it. Can someone share their knowledge ont his issue? 
    Solved!
    Go to Solution.
    Attachments:
    monitored channel autospectral density.png ‏11 KB

    On the front panel of the subVI, add the newly-created ENUM control to the connector pane by left clicking on an open rectangle on the connector pane icon in the upper right corner and then on the ENUM control.  Save the subVI.  If you show context help and mouse over the subVI icon in the main VI you should see the ENUM's name as a connection to the subVI, if you've done it correctly.   Right click on the node on the subVI icon in the main vi and say "create control". 

  • How does the window selected on the spectral measurements express vi affect the output?

    I'm using the spectral measurements express vi to find the power spectral density of a fairly broadband signal. I've already discovered a bug in the express vi; it doesn't divide the power spectrum by the equivalent noise bandwith for the window as it should. However, even after taking this into account by using the scaled time window vi to divide this factor out, the PSD is still changing with the window. How can I get the PSD to be constant with varying windows??

    I would like you to prove the "bug" that you're describing by creating an example that shows the calculated and the expected results. By opening the code of the "Spectral Measurements" Express VI you can dig into the heart of the calculation, and there (in the "ma_FFT Power Spectrum and PS Density no State.vi") you will see that the Power Spectral Density indeed IS calculated by using the formula PSD = (Power Spectrum/(df*Noise Power BW of Window)). See the attached PSD.jpg that shows where the calculation happens.
    The Power Spectral Density is supposed to be dependant of the chosen Window. Please read chapter 5 "Smoothing Windows" in the "La
    bVIEW Analysis Consepts" manual.
    Best regards,
    Philip C.
    National Instruments
    - Philip Courtois, Thinkbot Solutions
    Attachments:
    PSD.JPG ‏139 KB

  • Spectral measurement

    Good morning
    I am working on an application with labview interface for arduino that uses Spectral measurements to plot a graph Frequency x Amplitude of a vibration system.  However, the graph is not showing the data it should. The input of the Spectral Measurement block is headed by a trigonometric function "20*tan((asin((X1-2.7)/-1.5))/2)". i 've realized that when I connect the block directly to the tension values, before the function, the plot works normally. Could someone help to demonstrate what is going wrong? The program is going togheter with the question.
    Thanks,
    Gabriel Machado
    Attachments:
    Vibrations_software.vi ‏59 KB

    Ok.
    See if you can open now.
    Thanks,
    Gabriel Machado.
    Attachments:
    Versão final bancada.vi ‏61 KB
    Control 1.ctl ‏11 KB
    Control 2.ctl ‏11 KB

  • Need GPIB driver for SD380 Spectral Dynamics FFT analyzer

    >Hello,
    >
    >I'm looking for instrument driver (or design info) eg IEEE488 or GPIB for a
    >SD380 Spectral Dynamics FFT analyzer I own - this will be used on a school
    >project, so I hope to find source at no cost or someone who has worked with
    >such an analyzer and who can give me ideas about how to go about writing
    one
    >for Linux or Windows.
    >
    >The SD380Z I have is a single-channel unit.
    >
    >Please copy me at:
    >
    >rXoYnZaXnAMPERSANDsXuYrZeXwYeZsXt.net
    >
    >( remove upper-case XYZs above, and replace AMPERSAND with the character)
    >
    >Thank you,
    >Ron

    Hey Ron,
    I am sorry that National Instruments doesn't have an instrument driver for the SD380. What I would recommend is finding a copy of the user manual for this device and then try to create your own instrument driver for this device. If you are using one of NI's GPIB controllers and LabVIEW it is really easy. You will need to create VIs (functions) for specific tasks and these functions will be made up of commands or strings that are sent across the GPIB bus.
    Here is a tutorial on instrument drivers that is very helpful.
    http://zone.ni.com/devzone/conceptd.nsf/webmain/119b3b705b84b041862567d90074f425?OpenDocument
    http://zone.ni.com/devzone/devzoneweb.nsf/Opendoc?openagent&64325190560C97CE86256E4A006F27F1
    I hope this helps out.
    JoshuaP
    Nati
    onal Instruments

  • How to Measure Function Module Performance?

    Please can you tell me how I can measure the performance and trace the actions of a Function Module in R/3?
    The function module in R/3 is run when a user calls a WebDynpro action from a WebDynpro screen within the SAP Portal.
    I have tried running a trace on a user (ST05) but that only shows table actions (e.g. reads/fetch etc.). Also it does not appear in ST04 or ST03N. I would like to know how long the program actually takes to run.
    Thanks.
    Paul

    Hi,
    if I want to measure the runtime required to run some Abap, I use SE30. However i used it only for normal Dynpro application, not WebDynpro.
    The detail level of the created trace can be configured. The aggregation level should be set to "Full" or "By call" at the beginning. Disabling aggregation leads to huge trace files.
    You can select which statements should be traced. If you disable an option it's runtime is not lost but add to the traced action in the next level. If for example "Open SQL" is disabled, the time used by it is added into the net time of the method, function module of subroutine. Otherwise if "Open SQL" is enabled the net time of a function module does not include SQL time. SQL time is then listed separately.
    Greetings

  • Conversion of unit of measure function module.

    Hi All,
    Can you let me know the function module that convert the unit of measure from EACH(EA)to cases(CS). I have the material that unit of measure is in EACH(EA). And i have to dispaly in cases(CS).
    Regards,
    Rakesh Singh

    Hi Rakesh,
    Try this Function Module:
    MD_CONVERT_MATERIAL_UNIT
    Im sending you a sample code also.
    *& Form  f2121_convert_price
    Convert price to Base UoM
         -->P_LV_MEINS  Conversion UoM
         -->P_LV_KBETR  Converted Rate
         -->P_LV_KMEIN  Condition unit
         -->P_LV_MATNR  Material Number
         -->P_LV_KSCHL  Condition Type
    FORM f2121_convert_price USING    p_lv_meins
                                      p_lv_kbetr
                                      p_lv_kmein
                                      p_lv_matnr
                                      p_lv_kschl.
      DATA: lv_imenge LIKE ekpo-menge,
            lv_emenge LIKE ekpo-menge.
      lv_imenge = p_lv_kbetr.
      CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
           EXPORTING
                i_matnr              = p_lv_matnr
                i_in_me              = p_lv_kmein
                i_out_me             = p_lv_meins
                i_menge              = lv_imenge
           IMPORTING
                e_menge              = lv_emenge
           EXCEPTIONS
                error_in_application = 1
                error                = 2
                OTHERS               = 3.
      IF sy-subrc = 0.
        p_lv_kbetr = lv_emenge.
      ELSE.
        CONCATENATE text-009 p_lv_kschl INTO v_err_msg.
      ENDIF.
    ENDFORM.                    " f2121_convert_price
    Hope this helps you.
    Regards,
    Anjali.

  • Spectral Measurements VI - problem with scales

    Hi.
    I am generating a chirp signal using MathScript node and plotting it's PSD. Then I am passing the signal to DAQ (X Series) acquiring it on an analog input and plotting its PSD again. Both times I am using the same "Spectral Mesurements" VI to calculate the PSD. I am not using any windows or averaging and both results are in dB. I am also plotting the time domain signals. As expected, the time domain signals look exactly the same, and the PSD looks the same except for the Y scale. So, I am trying to understand where the difference in the Y scale is comming from.
    I am attaching the screenshot and the VI
    Thanks a lot for any help.
    Attachments:
    Generate Chirp and Display 2c.vi ‏340 KB

    I took a look at your attached VI, one suggestion I have for you is to wire the "Stimulus" to a Convert From Dynamic Data VI before wiring it to the Signals input of the Spectral Measurments 3 express VI. Just to see if data type has any effect on the PSD of the signals.
    -Jake B.

Maybe you are looking for

  • Video is not displaying in the latest shockwave

    After updating to the latest version of Shockwave, .flv videos are not displaying. The audio is there but no video. What is going on Adobe?

  • I'm trying to understand the difference between Photoshop Elements and Lightroom software.

    Does one have things the other does not?

  • Need help with rman bkp testing

    Hello, I am using oracle 8.0.6.0 on windows 2000 server and in nocatalog mode.As i cannot use duplicate command in this version, I took image copies of all the datafiles,controlfile and archives. I restore whole database on test machine on daily basi

  • ALL PROJECTS - CHANGE ORDER

    when viewing at the library with the "All Projects" function, the sort order is by date, showing the oldest first. is there any hidden function that changes this order? also, the "Home" and "End" buttons work in projects, folders and albums, however

  • Problem With Widescreen Export

    Hey everyone. I know that there's been a lot of topics posted about this and I have read every single one and still can't seem to get it right. So here's the deal... I recorded 16:9 footage on my Canon ZR800. I captured with Anamorphic 16:9 settings.