Measuring the resonant frequency

The actual time a line takes to scan depends on the resonant frequency of the mirror.  This is typically around 8kHz but it can vary from one device to another.  One easy way to measure it is to split the signal that goes from TRIG OUT to the TRIG IN of the Alazartech board and feed it to an oscilloscope.  The pulses you will see mark the beginning of each line, and you can have the oscilloscope measure the  frequency.  In my case, I end up with 7924Hz (see below).

If your frames have a total of nlines per frame, then the time at which the n-th frame and k-th line began scanning is T = (n*nlines+k)/res_freq (in unidirectional mode).