Plot spectrum vs time

I want to create a plot which show spectrum vs. time. Instead of a waterfall plot, I would like to have two axis:
- x: time
- y: frequency
The frequency axis will have 100 points. Each point represents the strength of the frequency in color (or I may use grayscale). For example:
- red: large amplitude
- orange: medium amplitude
- white: low amplitude
The graph will automatically scroll to the left as new data is added as a vertical column on colors. In this way, I can see how the frequency content changes over time.
Can this be done? I am using MS Visual Studio 6.0 C++. I have used  ChartXY and PlotXY for plotting a single spectrum, and for other time based data.
Thanks! 

Hi Bbuternowsky,
One way you could accomplish this would be to use a 3d graph control with the view set to be directly down the z axis.  You can then assign a gradient to the z axis to obtain your z coloring.  There are a number of examples showing the 3d graphing functionality of Measurement Studio:
 C:\Documents and Settings\All Users\Documents\National Instruments\MStudioVS2008\VCNET\Examples\UI\3DGraph
The color map styles example in this folder demonstrates configuration of the z axis coloring, so that would be a good place to start!
Al B.
Staff Software Engineer - TestStand
CTA/CLD

Similar Messages

  • How to save data in a 4D array and make partial plots in real time?

    Hi, this is a little complex, so bear with me...
    I have a test system that tests a number of parts at the same time. The
    experiment I do consists of measuring a number of properties of the
    parts at various temperatures and voltages. I want to save all the
    measured data in a 4-dimensional array. The indices represent,
    respectively, temperature, voltage, part, property.
    The way the experiment is done, I first do a loop in temperature, then
    in voltage, then switch the part. At this point, I measure all the
    properties for that condition and part and want to add them as a 1D
    array to the 4D array.
    At the same time, I want to make a multiple plot (on an XY graph) of
    one selected property and part (using two pull-down selectors near the
    XY graph) vs. voltage. (The reason I need to use an XY graph and not a
    waveform graph, which would be easier, is that I do not have
    equidistant steps in voltage, although all the voltage values I step
    through are the same for all cases). The multiple plots are the data
    sets at different temperatures. I would like to draw connection lines
    between the points as a guide to the eye.
    I also want the plot to be updated in the innermost for loop in real
    time as the data are measured. I have a VI working using nested loops
    as described above and passing the 4D array through shift registers,
    starting with an array of the right dimensions initialized by zeroes. I
    know in advance how many times all the loops have to be executed, and I
    use the ReplaceArraySubset function to add the measured properties each
    time. I then use IndexArray with the part and property index terminals
    wired to extract the 2D array containing the data I want to plot. After
    some transformation to combine these data with an array of the voltage
    values in the form required to pass to the XYGraph control, I get my
    plot.
    The problem is: During program execution, when only partial data is
    available, all the zero elements in the array do not allow the graph to
    autoscale properly, and the lines between the points make little sense
    when they jump to zero.
    Here is how I think the problem could be solved:
    1. Start with an empty array and have the array grow gradually as the
    elements are measured. I tried to implement this using Insert Into
    Array. Unfortunately, this VI is not as flexible as the Replace Array
    Subset, and does not allow me to add a 1D array to a 4D array. One
    other option would be to use the Build Array, but I could not figure
    out if this is usable in this case.
    2. The second option would be to extract only the already measured data
    points from the 4D array and pass them to the graph
    3. Keep track of the min. and max. values (only when they are different
    from zero) and manually reset the graph Y axis scale each time.
    Option 3 is doable, but more work for me.....
    Option 2: I first tried to use Array Subset, but this always returns an
    array of the same dimensionality of the input array. It seems to be
    very difficult, but maybe not impossible, to make this work by using
    Index Array first followed by Array Subset. Option 3 seems easier.
    Ideally, I would like option 1, but I cannot figure out how to achieve
    this.
    Your help is appreciated, thanks in advance!
    germ Remove "nospam" to reply

    In article <[email protected]>,
    chutla wrote:
    > Greetings!
    >
    > You can use any of the 3D display vi's to show your "main" 3d
    > data, and then use color to represent your fourth dimension. This can
    > be accessed via the property node. You will have to set thresholds
    > for each color you use, which is quite simple using the comparison
    > functions. As far as the data is concerned, the fourth dimension will
    > be just another vector (column) in your data file.
    chutla, thanks for your post, but I don't want a 3D display of the
    data....
    > Also, check out
    > the BUFFER examples for how to separate out "running" data in real
    > time.
    Not clear to me what you mean, but will c
    heck the BUFFER examples.
    > As far as autoscaling is concerned, you might have to disable
    > it, or alternatively, you could force a couple of "dummy" points into
    > your data which represent the absolute min/max you should encounter.
    > Autoscaling should generally be regarded as a default mode, just to
    > get things rolling, it should not be relied on too heavily for serious
    > data acquisition. It's better to use well-conditioned data, or some
    > other means, such as a logarithmic scale, to allow access to all your
    > possible data points.
    I love autoscaling, that's the way it should be.
    germ Remove "nospam" to reply

  • How do I make an XY-Graph plot points over time?

    I am building a program to plot and take data of a relationship between two voltages.  One is voltage is uniquely dependent on the other.  So far I have successfully built an XY-Graph to plot the voltages against each other (Voltage1 along the x-axis and Voltage2 along the y-axis).  However, the XY-Graph only diplays the point (V1, V2) at the instantaneous time I am looking at it, and does not continuously plot different points as I vary the independent voltage.  I need the graph to display all the points that occur as I vary the independent voltage.  As of right now, all I see is one little cursor that moves all over the graph as I vary it.  My program consists of a While Loop that contains all of the following:  two seperate data anolog input functions that take both voltage separately from my board.  The the output samples from each 'AI Sample' function are then bundled into one cluster using the 'bundle' function.  The cluster output from the 'bundle' function is then wired to a 'build array' function.  The 1-D array output from the 'build array' function is then wired to my 'XY-Graph'.  How do I get the XY-Graph to plot a point every millisecond or so?

    Bundling and then using the Build Array is not correct. Yuo can see the correct method in the help for an XY Graph below. In order to use the normal XY Grpah, you would have two shif registers. One for the X array and one for the Y. Bundle the two arrays and then wire to the graph.
    The other way is to use the Express XY Graph. With that, you can just wire your scalars to the X and Y inputs and set the Reset input to false.
    Message Edited by Dennis Knutson on 11-12-2007 06:32 PM
    Attachments:
    XY Graph 1.PNG ‏21 KB
    XY Graph 2.PNG ‏6 KB

  • How to plot contour using time stamp

    Hello,
    I need help on the following:
    I acquire size distribution data each minute from a particle counter. I would like to plot the data as a contour plot using time stamp on the x-axis, the size bins on the y-axis and the 2D data on the z-axis. I cannot get the contour functionality in LV 2011 to accept the time stamp format. I did change the format of the x-axis to "absolute time" but it still doesn't work, see simplified diagram below.
    Any advice on reformatting a time stamp to something the contour plot understands??!?
    Thanks a lot,
    Claus
    Attachments:
    countour.png ‏20 KB

    Milan R wrote:
    Hi Mogensen!
    You could use the "To Double Precision Float" vi to convert the timestamp to a double prescion number as mentioned in this forum post "time stamp to number function". As mentioned in that forum, the number is based on the LabVIEW epoch date so you can use it to compare values taken at a specific time.
    I can't look right now but will that work?
    I thought the 3D stuff was single and the magnitude of the time stamp would swamp the difference in time stamps.
    Just thinking out loud.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Read from text file and plot in real time

    Hello to everybody,
    I recently started using labview and so I know very few features, I apologize for any crap I'm about to write.
    My problem is as follows:
    _ A wireless node is sampling, with a known frequency, the voltage and the current of an electronic device
    _ These data are sent to a coordinator connected to the PC
    _ Each packet sent includes a single column with: Letter V followed by voltage samples, Letter I followed by current samples (all in a single column as in the attached example)
    _ The coordinator saves it in a .txt file
    I want to do a labview application that:
    _ Reads that file (continuosly update by the coordinator)
    _ Plots on two different graphs the values (over the time) of current and voltage
    Thanks for your help
    Danilo
    Attachments:
    TextData.txt ‏1 KB

    There are File IO examples that ship with LV which show you how to write to red from a file . A more fundamental question though is why have the file at all? Is it serving strictly as a data communication channel, or will it be used for something else?
    The "coordinator" that you mention, can it be accessed directly? Serial IO? TCP/IP? Telnet? ActiveX? .NET? Anything?
    If so, that would be the preferred way to handle this situation.
    Mike...
    PS: Sorry for the next bit, but I used to be a magazine editor and my grandmother was a school teacher so I am just a tiny bit anal retentive about word usage: In English "data" is a funny word in that while it is a singular form, it is (depending upon context) often understood to referring to multiple things and so can be sort of plural. Consequently, it is proper to say: "This data is sent.. " or "The data indicates...", but not, "The data are showing..". Likewise it is always incorrect to try to make it plural by saying "datas".
    PPS: The same goes for the word "code" when used as a noun. It can also be a verb, but that's a whole different rant...
    PPPS: Also be aware that many of the people who know me well would object to the "tiny bit" part...
    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

  • Full spectrum Plot / Spectrum of Orbit

    Dear Friends,
    I would like to plot the Full Spectrum of Generator Shaft. I found some information about the  same which I am reproducing below :
    Full spectrum
    The full spectrum is an additional diagnostic tool and is also called the spectrum of an
    orbit. It shows the same information as an  orbit but in a different format. It helps to
    determine the degree of ellipticity (or flattening) associated with the various machinery
    conditions along with the precessional direction for all the frequency components present.
    To obtain the full spectrum, the orthogonal X and Y transducer signals are fed into the
    direct and quadrature parts of the FFT input. The positive and negative vibration
    components for each frequency are obtained. Positive is defined to be the forward
    precession and the negative component as the reverse precession. These components
    yield the following ellipticity and precessional information for a given orbit of any
    particular frequency (1× or 2× or …):
    •  The sum of two components, forward and  reverse, is the length of the orbit
    major axis.
    •  The difference between the two components is the length of the orbit minor
    axis.
    •  The larger of the two components, positive or negative, determines the
    direction of precession that is forward or reverse.
    One of the possible applications of full spectrum is analysis of the rotor runout caused by mechanical, electrical or magnetic irregularities. Depending on the periodicity of such irregularities observed by the X–Y proximity probes, different combinations of forward  and reverse components are observed. The method forms the basis for  many useful machinery diagnostics.
    The full spectrum (just like the normal FFT) can be obtained in a steady-state analysis (a single FFT or waterfall) and even in transient analysis, which would then be called the full spectrum cascade (Figure attached).
    I would like to know if anyone has the idea as to how to get this plot?
    I am familiar with Labview and normal analysis tools available like FFT etc., but I need help in performing this Advanced Analysis in Labview.
     Regards
    Shourya
    Solved!
    Go to Solution.
    Attachments:
    A steady-state single full spectrum.JPG ‏9 KB

    Dear Preston Johnson,
    Thanks for your prompt reply.
    Now I am able to open the VIs, however i am getting some errors in executing them, which I am attaching with this post. I hope you get some clues from the error lists and help me in sorting them out.I am sorry for bothering you so much :-)
    With regards
    Shourya
    Message Edited by ssingh1 on 09-06-2009 11:32 AM
    Attachments:
    Error List in test Full Spectrum VI.JPG ‏50 KB
    Error List in oa_Process Order Full Spectrum VI.JPG ‏38 KB

  • Plotting data against time points in a chart

    I am trying to plot some measurements at different time points in a chart. However the time time points are not regular. They are at 0, 0.5 hours, 24 hours, 24.5 hours, 48 hours etc.
    When I try to chart the data the chart always has the x-axis points at regular intervals so it doesn't represent change over time. Is there a way of charting the points at the relative point along the x-axis over time without having to use a table with a time point for every 30 mins?

    Jwaz,
    Read the chapter on Charts in the Numbers User Guide. You can download it from the Help Menu.
    There are two basic classes of Chart; Category and Scatter. In a Category Chart, which it appears you are using, the "X-Axis Values" are actually treated as Labels with no particular numeric value. In a Scatter Chart, which it appears you would like to be using, the X-Axis uses true values.
    If you study the available Chart types you will see that all but one are Category Charts. You can plot a line with a Scatter Chart by adding connecting lines. You can also simulate a bar chart in a Scatter Chart if that's the look you want, by charting series that have only two data points; X,0 and X,Y.
    Which type of chart you pick will affect your choice of table layout. Category Charts require Text Fields for the Category Labels and Value fields for Y-Values. Scatter Charts require Values for both axes.
    Jerry
    Message was edited by: Jerrold Green1

  • How i can fixup the cursor in the center of plot at any time?

    i need the cursor show the data of the points in plot,but i found after the plot zoomin,the cursor can not show .how i can fixeup the cursor at any time?
    thanks a lot.

    Hi Longsan,
    So I tried to reproduce the issue you were seeing and I believe I know what is going on. If you zoomin and the max and min of the axes are smaller than the cursor position, the cursor will no longer be in the viewing area of the graph. Therefore, you would want to reposition the cursor after you zoom in. For example, in Visual Basic you could use the command
    CWGraph1.Cursors(1).XPosition to change the position. I thiss out and it seems to work correctly. Let me know if try this and you are still having trouble.
    Thanks,
    Caroline
    National Intruments
    Thanks,
    Caroline Tipton
    Data Management Product Manager
    National Instruments

  • How to plot a olap time in graph in wad

    hi all
    i want to design technical content queries in wad but facing problem in ploting time in x or y axis.i tried all option but it is not working out..
    i am using time scatter graph..
    thanks
    shalini

    Hi DFGray.
    Thanks for your post.
    If you look at the attached file, how do I make the changes that you describes. Maybe you could make the changes in the vi and post it to me?
    I just think that I have be done all the things that you suggests but still I can't make it work. 
     - Clausny
    Attachments:
    starttimeVI.vi ‏27 KB

  • How to show 2 groups of data in 1 XY plot at different time?

    Hi, all:
    I have a question and hope someone can help me figure out the solution or whether or not no solution for the question. I need to collect 2 groups of data [x(n),y(n)] and [x(n),z(n)]. I will collect x-y first then x-z. I need to collect and show the x-y data first, when I am satisfied, then collect and show the x-z data. It should be in the same plot. I got an error message so far and cold not figure out the solution. I attached my code and hope someone can help me. The code is in version 8.0 and I am sure there is no virus. Thank you a lot in advance.
    Attachments:
    plots.vi ‏13 KB

    Hello ccyang
    When you look the context help of the xy-graph in the diagram, you see the supported data types. An array of xy-clusters is accepted. You may look in the attached code how you could built the array  of the two plots.
    Check the example VIs included in LabVIEW (in the help menu). There are several examples on charts and graphs.
    Greetings
    shb
    Attachments:
    plots executable.vi ‏15 KB

  • How to plot sale over time?

    I have a spreadsheet that lists various sales. One column (Column B) contains the time of day of the sale. I'm trying to create a chart that will show me the time of day that my sales are occurring. I'm not concerned about the date as I'm already tracking that somewhere else. I just want to see what time of day my sales are happening. I'm really stumped as to how to make this happen. I'm not even sure what kind of chart I need.
    The cells are formatted like so: 06/03/00002010 8:17:47 AM
    The beginning date needs to get ignored as that's the date that the report was run. It's not actually related to the sale at all. I just need to capture the time. Any thoughts on this?
    Message was edited by: stvelucky

    If I'm reading your question correctly, you need to start by separating your data into parts of day.
    Here's an example that separates the numbers into columns by half hour periods, then sums the results in a footer row (row 30).
    The active formula in E2 is shown at the top. The formula is filled down to row 29 and right to column G. Column B here is formatted to show both the date and time parts of the 'time' in the cells. Dates have been edited in rows 9 through 14 to demonstrate that the formula disregards the date portion of the entry.
    The summary data in the footer row may be used for the chart.
    Regards,
    Barry

  • Read Text row by row, plot them and find the max of its Power spectrum

    Hi, everyone,
    I have to read data from a text file, plot as a time serie and find the frequency to its max power spectrum. I found a previous post related to my issue so I revised his example a little bit. But once I decide to store the data into an array, the Labview reported:' Error 1 occurred at Scan From String (arg 1)'. Can anyone help me out?
    Thanks in Advance!
    Gab
    Attachments:
    ReadXYZmine.vi ‏18 KB

    Again my attachment got missed out.
    - Partha
    LabVIEW - Wires that catch bugs!
    Attachments:
    ReadXYZmine_Trim Whitespaces.vi ‏19 KB

  • I would like to programatically set the "Date Unused" on X Scale formatting for time plots.

    I can use the X Scale formatting on the front panel, but when I change from time to decimal using property nodes the "date" keeps showing up. How can I turn the date feature off so I just see Time in HH:MMS format?

    Disregard. I found the answer. Set the XScale.Format value to 6 (relative Time). feed in total seconds from start of day to the Xo, The reciprocal of data frequency to DeltaX, and set the decimal resolution to 3. This results in a time tagged plot showing just time (no Date).

  • Plotting boolean digital signals over postion (angle degrees) not over time

    Hello all,
    I would like to plot two boolean signals over position (angle degrees) and not over time. Any pointers on how to do this? The two digital signals are coming from a VI on my FPGA code (running cRIO - 9014), and the location in degrees is also generated by the same VI on my FPGA code. 
    I tried to use "Boolean Array to Digital.vi" and a "Digital Waveform Graph", but it will only plot my 2 digital signals over time and I need to plot it over position. I took that vi from example "Digital Waveform DT Graph Demo". 
    Another issue with plotting it against time is the sampling rate. I'm plotting cam and crank signals over engine position (crank angle degrees), how do I plot these signals in position intervals of 720 degrees. Could I tweak the sampling somehow that I would be able to see stills of these intervals? The position date is continously running from 0 to 720, when it reaches 720 it starts again in 0.
    Thanks!

    You'd have to use an XY graph so you can define your own x-axis, in your case it would be degrees.

  • Synchroniz​e two waveforms with different time

    Hi All,
         Thank you again in advance for you help on this. I am trying to create a setup where a spectrum is generated over time (millisecond time range, this function works properly), and a maximum for a peak that I select (this also works correctly) plots over time (minute time scale). However, when I try to run this, the fast plot is operating at about 40 Hz, and I have a calculation to allow a resolution feature for the minute time graph (the fast experiment is averaged a given number of times to produce a spectrum which is then analyzed for the maximum peak, so for example, at 40 Hz, and a resolution of 0.5 seconds, it should need to average 20 spectra for each point), but in operation, the time does not work correctly. At 20 spectra averaged per point, I only get about one point per second, not 2. So, in an attempt to correct this, I cut the averages in half, and was able to get it to work at very nearly 2 spectra per second. However, the time is not exact when compared to an external clock, and I need to know then exact time. Thus, is there any way to have the minute time frame graph count time on its own, and just plot a Y value whenever it recieves one? I need to have it plot in real time, as is currently achieved in the attached vi. In th attached VI, I am working with the "chromatography mode" tab, the other tabs already work correctly. However, I am somewhat new at this, and my code is a bit messy, so I apologize for that in advance. Thank you,
    <>< Eric
    Attachments:
    IMS Software v5.4.vi ‏158 KB

    Hello Eric,
    I see that you are creating a waveform using the Build Waveform VI and then wiring it to the outputs in the Chromatography Mode tab - namely 'Waveform Graph' and 'Waveform Graph 3'. Is the 'dt' value constant for every iteration of the while loop? If so, your output should have constant time spacing between plotted values in the waveform graph.
    So, again I am not completely sure what you mean by the IMS not operating at the frequency you input :-(. Are you seeing the problem in 'Waveform Graph' or 'Waveform Graph 3' or both? An simple example VI would be great to describe your issue.
    Vivek Nath
    National Instruments
    Applications Engineer
    Machine Vision

Maybe you are looking for