Data Acquisition (DAQ) and Control from Microstar Laboratories

Knowledge Base: Processing

  • See the list of other topics for category Processing

Q10059 Aligning to time reference pulses with software triggering

Tags: Help, DAP, resampling, data selection, external timing, software triggering

Applies to: All DAP and xDAP products

My system has a reference signal used for synchronizing long-term timing. Pulses on the reference signal indicate when a sample is desired. Unfortunately, these pulses are not clean TTL level signals, hence not suitable for hardware timing purposes. My signal channels are noisy as well, so I want to collect and average several samples, resulting in one net measurement result per timing pulse. Are these things possible?

Yes. First, you have to capture data for your reference pulses and your measured signals on a consistent timing basis. The timing does not have to be synchronized to the time reference signal, and the on-board DAP timer is fine for this. Then, it is a matter of detecting the timing pulses and selecting the corresponding data to align with them. These things can be done using software triggering.

Sample both the reference timing signal and the signals that you want to measure. Use a relatively high sampling rate, fast enough to collect the samples for averaging between reference timing pulses.

Now analyze your timing pulse signal, looking for each place where a leading pulse edge rises above a threshold, using a LIMIT command. Configure a WAIT command to capture a fixed-length data block each time the triggering level is reached, retaining data for each signal you want to measure. Route the retained data blocks to AVERAGE processing commands, which will yield one averaged result per reference timing pulse.

Here is an example for timing pulses arriving approximately once per millisecond, and averaging blocks of 100 on one data channel. To capture enough data for averaging, the sampling will need to be somewhat faster than 100000 samples per second on the timing signal and data channels. Your sampling configuration can look something like the following.

  PIPES    rawsignal  WORD, avgsignal  WORD
  IDEFINE  sample2 
    CHANNELS   2
    SET  IPIPE0  S0    // The reference timing signal
    SET  IPIPE1  S1    // The signal you want to measure
    TIME  4.50         // Nominal 111000 samp/sec each channel

Now your processing configuration can look something like the following.

  PDEFINE  process
    // Trigger each time reference signal goes high
    LIMIT(IPIPE0,  INSIDE,16000,32767,  timing,  \
                INSIDE,10000,32767 ) 
    // Retain blocks of 100 sample values from measured signal
    WAIT(IPIPE1,  timing,0,100,  rawsignal)
    // Reduce noise by averaging samples
    AVERAGE(rawsignal, 100, avgsignal)
    // Transfer 1 result per reference pulse to host PC

Because of rate and jitter uncertainties in the timing pulse, you can't be sure of precisely which 100 samples will be selected and averaged, but you can be sure that the results correspond 1-for-1 with the locations of the timing reference pulses.


There is an online tutorial about software triggering with several application examples.