;c13hsqcse.fa
;2D (13C,1H) HSQC-SE with optional 15N and 13C' decoupling
;This version makes use of the gp gradient syntax.
;Bruker Avance/Xwin-nmr version
;Written up by F. Abildgaard, NMRFAM (abild@nmrfam.wisc.edu)
;
;  $Id: c13hsqcse.fa,v 1.1 2001/06/07 16:59:46 abild Exp abild $
;
;  Disclaimer: This pulse program is provided "as is" for your
;  information. Support for the use of this pulse program is only
;  provided to users of the National Magnetic Resonance Facility
;  at Madison (NMRFAM). Users of this pulse program employ it at
;  their own risk. Neither NMRFAM nor University of Wisconsin-Madison
;  are liable for any physical or other damage incurred during the
;  use of this pulse program.
;
;f1: 1H, f2: 15N, f3: 13C (channel assignments may be changed below)
;o1p: 4.7ppm
;o2p: 118ppm
;o3p: 43ppm
;
;d1: relaxation delay=d1+0.1s
;p1 90 H at pl1
;p3 90 C at pl3
;p11 90 H1 2ms selective water pulse at power pl11. 
; Check for phase difference between hard H1 and soft H1 
; pulses and set phcor21 accordingly.
;d2: 1/(4Jch), aliph: 1.87ms, arom: 1.5ms
;d4: 1/(4Jch) for CH, 1/(8Jch) for CH, CH2 and CH3
;  i.e. 1.87ms or 0.93ms, resp.
;  for arom: 1.5ms
;pl0 120dB
;
;N15 Waltz-16 PCPD2 at pl12, cpdprg2 (optional)
;C13 GARP decoupling using cpdprg3 and pcpd3 at pl13
;C'  Compensated SEDUCE1 decoupling of C', using p31 at sp3, 
;    shape seduce1c5/6, offset 0, cpdprg4 waltz16sp3p31 (optional).
;C evolution:
;  in0, SW(C)=1/(2*in0), typically 60 ppm
;  l4 complex points
;  Define C_90180 below for DW/2 initial delay in t1 (0/90,-180 phase).
;  Processing: Echo-Antiecho.
;
;ns=2, 4,..., ds=2, 4,...
;
;Recommendations for gradients:
;gpz1:  20%
;gpz2:  25%
;gpz3:  55%
;gpz4:  25%
;gpz5:  15%
;gpz6:  55%
;gpz7: -22%
;gpz8:   2%
;gpnam1: sine.50
;gpnam2: sine.50
;gpnam3: sine.100
;gpnam4: sine.32
;gpnam5: sine.32
;gpnam6: sine.10
;gpnam7: sine.100
;
;#define ONE_D		; uncomment for 1D experiment
;#define FLIP_BACK	; uncomment for (hopefully) selective H2O flip-back
#define N15_DEC		; uncomment for N15 decoupling
;#define SEDUCE		; uncomment for compensated SEDUCE-1 decoupling of C'
;#define C_90180	; uncomment for DW/2 initial delay in t1 (90,-180) 
#define MESSERLE	; this may improve solvent suppression (don't use with flip-back)
;#define OPTIM_P19	; uncomment if you want to optimize p19 (GRAD6)
#define EXPTCORR	; uncomment if you want "expt" to report
;			; the correct expt time (works with XWIN-NMR 2.x)
;
;Define channel assignments:
#define H f1
#define N f2
#define C f3
#define D f5
;
;You shouldn't have to worry about anything beyond this point :-)
;
;sanity checks
;
#ifdef ONE_D
#undef C_90180
#endif
#ifdef FLIP_BACK
#undef MESSERLE
#endif
;
define delay TAUA2
define delay TAUA4
define delay TAUA5
define delay TAUB
define delay DELTA
define delay CEN_HC1
define pulse H1_90
define pulse H1_180
define pulse H1_S90
define pulse C13_90
define pulse C13_180
define pulse GRAD1
define pulse GRAD2
define pulse GRAD3
define pulse GRAD4
define pulse GRAD5
define pulse GRAD6
define pulse GRAD7
;
"d11=100m"                      ;disk i/o
"d12=10u"                       ;power switching etc.
"d13=5u"                        ;a short delay
"d14=60u"			;ip,id etc.
"d16=300u"			;gradient recovery
"H1_90=p1"
"H1_180=H1_90*2"
#ifdef FLIP_BACK
"H1_S90=p11"
#endif
"C13_90=p3"
"C13_180=C13_90*2"
"CEN_HC1=C13_90-H1_90"
"d6=H1_90"
"d7=C13_90"

"GRAD1=400u"
"GRAD2=400u"
"GRAD3=720u"
"GRAD4=250u"
"GRAD5=250u"
#ifndef OPTIM_P19
"p19=91.65u"		; configurable: set to the optimum value on your instrument
#endif
"GRAD6=p19"
"GRAD7=4.0m"

"TAUA2=d2-GRAD2-d16-d13"
"TAUA4=d4-GRAD4-d16-d13"
"TAUA5=d2-GRAD5-d16-d13"

#ifdef C_90180
"d0=d13+in0/2"
#else
"d0=d13"
#endif

#ifdef SEDUCE
"TAUB=d16+GRAD3+H1_180+d13*7+d12*2"
#define SED_ON d13 \n d12 pl0:C \n d13 cpds4:C
#define SED_OFF d13 do:C \n d12 pl3:C \n d13
#else
"TAUB=d16+GRAD3+H1_180+d13*5"
#define SED_ON d13
#define SED_OFF d13
#endif

#ifdef N15_DEC
#define N15_DEC_ON d12 pl12:N \n d13 cpd2:N
#define N15_DEC_OFF d13 do:N
#else
#define N15_DEC_ON d13
#define N15_DEC_OFF d13
#endif

#ifdef H2_DEC
#define H2_DEC_ON d12 pl15:D \n p25:D ph1 \n d13 cpds5:D
#define H2_DEC_OFF d13 do:D \n p25:D ph3
#else
#define H2_DEC_ON d13
#define H2_DEC_OFF d13
#endif

#ifdef EXPTCORR
  "d31=2*(TAUA2+TAUA4+TAUA5+GRAD2+GRAD4+GRAD5+GRAD6)+GRAD1+GRAD3+GRAD7+TAUB"
#endif



#include <Avance.incl>
#include <Grad.incl>

1 ze
  d12
  d14 LOCKDEC_ON
2 d13 do:C
  d14 H2_LOCK
  d14
  d11 LOCKH_OFF
  3m
3 d14
  d14
  d14
  d14
  d14
4 d13
#ifdef EXPTCORR
#include <faexptcorr.incl>
#endif
  d1 pl1:H pl3:C
  d13 LOCKH_ON
  d13 UNBLKGRAMP
  d13 H2_PULSE
  (C13_90 ph0):C
  d13
  GRAD1:gp1			;400u, 15G/cm, sine.50
  d16
#ifdef FLIP_BACK
  (d13 d12 pl11 H1_S90 ph21:r d13 d12 pl1):H	;Selective 90 H1 pulse phase y
#endif
  (H1_90 ph0):H
  d13
  GRAD2:gp2			;400u, 16G/cm, sine.50
  d16
  TAUA2
  (CEN_HC1 H1_180 ph0):H (C13_180 ph0):C
  d13
  TAUA2
  GRAD2:gp2			;400u, 16G/cm, sine.50
  d16
#ifdef MESSERLE
  (H1_90*55 ph0):H
  d13
#endif
  (H1_90 ph1):H
  d13
  GRAD7:gp7			;1m, -15G/cm, sine.100
  d16
  N15_DEC_ON
; Begin Carbon evolution
  (C13_90 ph11):C
  SED_ON
  d0 
  (H1_180 ph0):H
  d0
  SED_OFF
  N15_DEC_OFF
  GRAD3:gp3*EA			;720u, +/-40G/cm, sine.100
  d16
  (C13_180 ph0):C
  TAUB
; End Carbon evolution
  (C13_90 ph12):C
  d6
  (H1_90 ph0):H
  d13
  GRAD4:gp4			;250u, 16G/cm, sine.32
  d16
  TAUA4
  (C13_180 ph0):C
  (H1_180 ph0):H 
  d13
  TAUA4
  GRAD4:gp4			;250u, 16G/cm, sine.32
  d16
  d7
  (C13_90 ph1):C
  (H1_90 ph1):H 
  d13
  GRAD5:gp5			;250u, 10G/cm, sine.32
  d16
  TAUA5
  (CEN_HC1 H1_180 ph0):H (C13_180 ph0):C
  d13
  TAUA5
  GRAD5:gp5			;250u, 10G/cm
  d16
  (H1_90 ph0):H
  d13
  GRAD6:gp6*-1			;91u, 40G/cm, sine.10
  d13
  d16 pl13:C
  (H1_180 ph0):H
  d13
  GRAD6:gp6			;91u, 40G/cm, sine.10
  d13
  d16 BLKGRAMP
  go=2 ph31 cpds3:C

#ifdef ONE_D
  d11 do:C wr #0 H2_LOCK
  d13 LOCKH_OFF
#else
  d11 do:C wr #0 if #0 zd H2_LOCK
  d13 LOCKH_OFF
  3m igrad EA
  d14 ip12
  d14 ip12
  lo to 3 times 2
  d14 id0
  d14 ip11
  d14 ip11
  d14 ip31
  d14 ip31
  lo to 4 times l4
#endif
  d14 LOCKDEC_OFF

exit
  
ph0=0
ph1=1
ph2=2
ph3=3
ph11=0 2
ph12=0
ph21=1
ph31=0 2