//Set the fpRFDR pulses from the Spin Rate

if (srate>500) then
   $pwXfprfdr = 1.0e6/(3.0*srate)              // pwXfprfdr is 180 pulse equal to TauR/3.0.
   pwXfprfdr = 0.1*trunc($pwXfprfdr/0.1 + 0.5) // round the pulse width to 100 ns resolution.
   srate = 1.0e6/(3.0*pwXfprfdr)               // recalculate the exact spin rate.
   aXfprfdr = aX90*(2.0*pwX90)/pwXfprfdr       // recalculate the exact amplitude.
   if (aXfprfdr >= 4095) then
      write('error','reset_fprfdr Error: aXfprfdr is >= to 4095')
   endif
endif

if (qXfprfdr < 1) then qxfprfdr = 1.0 endif    // minimum of 1 element

// Syncrhonize tXmix with 4 rotor cycles. 

if (srate>500) then
   tXmix = 12.0*pwXfprfdr*trunc(tXmix/(12.0*pwXfprfdr)+ 0.5)
endif



