Creating an Intensity Graph from a Single Waveform

Updated May 22, 2024

Environment

Software

  • LabVIEW

How can I split one sine waveform into multiple rows of waveform data and create an intensity graph from it?

  1. Assuming you have already generated a waveform, first, you need to extract the Y component from the waveform data. You can do this by using the get waveform components function and selecting Y when clicking the center of the output terminal.
  2. Place a while loop on the block diagram (Functions » Programming » Structures » While Loop) after the get waveform components function.
  3. Wire the output of the get waveform components function to the left edge of the while loop to create a tunnel.
  4. Right-click on the tunnel and select Replace with Shift Register.
  5. Place a delete from array function in the while loop (Functions » Programming » Numeric » Delete From Array).
  6. Wire the left shift register to the array input of the delete from array function, and wire the array w/ subset deleted output of the function to the right shift register.
  7. Place two numeric constants in the while loop (Functions » Programming » Numeric » Numeric Constant). Assign one of them to a value of 0 and connect it to the index input terminal of the delete from array function. Assign the other numeric constant to the value of the wanted column length and connect it to the length input terminal of the delete from array function.
  8. Wire the deleted portion output terminal of the delete from array function to the right edge of the while loop to create a tunnel. 
  9. Right-click on the tunnel that you just created and select Tunnel mode >> Indexing.
  10. Place an intensity graph on the front panel (Controls » Modern » Graph » Intensity Graph) and in the block diagram, wire the output of the indexing tunnel to the Intensity Graph.
  11. To get the while loop to stop when there is no more waveform data, place an array size function in the while loop (Functions » Programming » Numeric » Array Size) and equal? function (Functions » Programming » Comparison » Equal?) to check the remaining length of the array.
  12. Wire the input of the array size function to the wire the array w/ subset deleted output of the function and the output of the array size function to the x input of the equal? function.
  13. Place a new numeric constant in the while loop and assign it to a value of 0 and connect it to the y input of the equal? function.
  14. Connect the output of the equal? function to the conditional terminal.

Creating an Intensity Graph from a single waveform.png
Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.