Description
It’s often useful to apply a software trigger and gate on an acquired signal, where you have an acquired frame (array) of data and you need to extract a subset from the current acquired frame and potentially subsequent acquired frames. The segment that you wish to extract – the gated signal – may have a start sample location based on the location of a trigger event and an ending sample location based on a user-specified segment duration. A software trigger and gate can be useful when you are acquiring data continuously with an NI-USRP and would like to apply some inline processing to a subset of the data.
Working with the Example
Unzip the file attached to this document into a new folder and open USRP Example – Trigger & Gate.vi. USRP Example – Trigger & Gate.vi shows how a sub VI called subTrigger+Gate.vi can be called during a continuous Rx operation with the USRP. subTrigger+Gate.vi implements a software trigger and gate as a VI.
Example Notes
subTrigger+Gate.vi operates as follows:
- Input frame(s) of I/Q signal samples (on the Input Signal control) are monitored for a trigger event and a Trigger Armed? Boolean indicator is set to True on each call where the input signal was checked for a trigger, but no trigger was found. The example uses a simple amplitude threshold as a trigger, monitoring the signal for a level that exceeds a user-specified trigger level you set with the Trigger Level control
- When a trigger occurs, subTrigger+Gate.vi starts to populate a buffer with signal samples starting with the sample that caused the trigger. The total length of the buffer is a user-set parameter, Gated Signal Duration [sec]. If the desired Gated Signal Duration [sec] exceeds the number of remaining signal samples in the current acquired frame, the buffer will continue to append new samples subsequent acquired input frames become available.
- After the buffer is filled with user-specified length of samples, the Gated Signal Ready? Boolean indicator is set to true and the Gated Signal indicator will include the gated signal samples.
- If the Reset Trigger? control is set to True during a trigger or after the acquisition of a Gated Signal completes, the example resets and starts to monitor the input signal for another trigger event
Requirements: