//Set the SC14 pulses from the Spin Rate

if (srate>500) then 
   $pwXsc14 = 4.0e6/(14.0*srate)           // pwXsc14 is 360 pulse, there are 14 per 4 rotor periods. 
   pwXsc14 = 0.1*trunc($pwXsc14/0.1 + 0.5) // round the pulse width to 100 ns resolution. 
   srate = 4.0e6/(14.0*pwXsc14)            // recalculate the exact spin rate.
   aXsc14 = aX90*(4.0*pwX90)/pwXsc14       // recalculate the exact amplitude.
   if (aXsc14 >= 4095) then 
      write('error','reset_sc14 Error: aXsc14 is >= to 4095')
   endif
endif

if (qXsc14 < 1) then qxsc14 = 1.0 endif    // minimum of 1 element - 14 are recommended. 

// Set a 2D Experiment

exists('ni','parameter'):$ni               // make this a 2D experiment       
if ($ni<0.5) then 
   par2d
   ni = 64
   phase=1,2
   refsource1 = 'sfrq'                     // homonuclear referencing
   axis = 'pp'
endif

// Set Decoupling during sc14

aHmix = aH90                               // decouple during sc14 based on aH90. 

setprotect('refsource1 axis','off',16384)













