Languages

CommunityCategory: XMODELPerforming measurements over consecutive time intervals of a single trigger
SA Support Team Staff asked 6 years ago

I want to perform periodic measurements on a signal using the 'meas_max', 'meas_min', 'meas_integ', 'meas_avg', 'meas_pp', or 'meas_rms’ primitive. That is, when a trigger signal triggers a new event, I want the measurement primitive to update its output with the measurement value taken over the time interval between the last two trigger events. However, I realize that the primitives take two trigger inputs 'from' and 'to' to indicate the time interval. How can I do the measurements over consecutive time intervals between a series of events of a single trigger?

1 Answers
Best Answer
SA Support Team Staff answered 6 years ago

Yes, you can make measurements over consecutive time intervals of a single trigger by connecting the trigger signal to both the 'from' and 'to' input ports of the measurement primitive. In other words, when the measurement primitives such as 'meas_max', 'meas_min', 'meas_integ', 'meas_avg', 'meas_pp', and 'meas_rms' have their 'from' and 'to' input ports connected to the same trigger signal, they update their outputs with the measurement value taken over the time interval between the last two trigger events, whenever the trigger has a new event.

For instance, the example shown below demonstrates the periodic measurement of the peak-to-peak amplitude of an oscillatory signal named 'in'. It is a sinusoidal signal generated by a 'sin_gen' primitive with the 'damp' parameter set to 0.05G so its amplitude is gradually decreasing. The 'trig_rise' primitive produces a trigger signal named 'trig', which triggers an event whenever the 'in' signal crosses the threshold of 0.5 in the positive direction. When this 'trig' signal drives both the 'from' and 'to' input ports of the 'meas_pp' primitive, the primitive makes a periodic measurement of the peak-to-peak value of the 'in' signal, resulting the output 'out' as shown below.