Segmenting Periodic Signal using Trigger and Gate Express VI in LabVIEW

Updated Jun 28, 2024

Environment

Software

  • LabVIEW

This article outlines the steps to cut a periodic signal into equal segments using Trigger and Gate Express VI in LabVIEW.
 

For demonstration purposes, this article uses a 3 Hz sine wave with 10kHz sampling rate and 10k number of samples as input signal.

1. Launch LabVIEW and create a New VI.
2. Create the block diagram of the VI, as shown in the diagram below.
gate and trigger.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.

3. Double click the Trigger and Gate Express VI. A window will pop up.
4. Configure the settings as below:
a) Start Trigger:
  • Threshold
  • Start Sense: Rising
  • Start level: 0.01
b) Stop Trigger:
  • Threshold
  • Start sense: Rising
  • Stop level: -0.01
c) Note:
  • The settings above are only suitable for the input signal used in this example.
  • Please configure your own settings for the Trigger and Gate Express VI depending on type of input signal and requirement of the application.
  • When using Threshold for Start Trigger or Stop Trigger, you will lose a small portion of data.
  • If you know the exact number of samples for each segment, you can configure the Stop Trigger to use Number of samples.

5. Run the VI and observe the signal on the front panel.
 

For the example shown above, three equal segments will be created from the original signal. After running the VI, the signal appears as follows.