#!/usr/bin/perl # confirming phase cycling as reported in papers; below confirms emsley 2007 rinad # ae path H 0-> -1 # ae path C 0-> -1 -> 1 -> 2 -> 1 -> -1 # ae delP -1 2 1 -1 -2 #echo pathway delta Ps $dh= -1; $da= -1; $db= 2; $dc= 1; $dd= -1; $de= -2; use POSIX; $m=32; #total number of steps in phase cycle #put in phase cycle below explicitly #note need 45 degrees steps for phase for pulses upto and including t1 selection #in pulse seq later ph2,4,5 # @hh=(1,3); #these multipliers work @aa=(1,1,2,2, 3,3,0,0); #ph2 @bb=(0,0,1,1, 2,2,3,3, 1,1,2,2, 3,3,0,0, 2,2,3,3,0,0,1,1, 3,3,0,0, 1,1,2,2); #ph4 @cc=(0,0,1,1, 2,2,3,3); #ph5 @dd=(0); #ph6 @ee=(1); #ph7 ; # # calculate path and phase of receiver now: for($i = 0; $i < $m; $i = $i+1){ $h = floor($i)%($#hh+1) ;# correct for partial phase def above $a = floor($i)%($#aa+1) ; $b = floor($i)%($#bb+1) ; $c = floor($i)%($#cc+1) ; $d = floor($i)%($#dd+1) ; $e = floor($i)%($#ee+1) ; $path = $hh[$h]*$dh + $aa[$a]*$da + $bb[$b]*$db + $cc[$c]*$dc + $dd[$d]*$dd + $ee[$e]*$de ; $ph_dig= -1*$path%4; $rx[$i]=$ph_dig; #printf"%3d\t %3d\t %3d\t %3d\t %3d\t %3d\t %3d\n",$i, $a, $b, $c, $d, $rx, $ph_dig; } ##PRINT OUT phase cycles printf"ph2 "; for($i = 0; $i < $m; $i = $i+1){ if(floor($i)%4 == 0){print " "}; if(floor($i)%32 == 0){print "\n"}; $a = floor($i)%($#aa+1) ; printf"%1d", $aa[$a]; } printf"\n"; printf"ph4 "; for($i = 0; $i < $m; $i = $i+1){ if(floor($i)%4 == 0){print " "}; if(floor($i)%32 == 0){print "\n"}; $b = floor($i)%($#bb+1) ; printf"%1d", $bb[$b]; } printf"\n"; printf"ph5 "; for($i = 0; $i < $m; $i = $i+1){ if(floor($i)%4 == 0){print " "}; if(floor($i)%32 == 0){print "\n"}; $c = floor($i)%($#cc+1) ; printf"%1d", $cc[$c]; } printf"\n"; printf"ph6 "; for($i = 0; $i < $m; $i = $i+1){ if(floor($i)%4 == 0){print " "}; if(floor($i)%32 == 0){print "\n"}; $d = floor($i)%($#dd+1) ; printf"%1d", $dd[$d]; } printf"\n"; printf"ph7 "; for($i = 0; $i < $m; $i = $i+1){ if(floor($i)%4 == 0){print " "}; if(floor($i)%32 == 0){print "\n"}; $e = floor($i)%($#ee+1) ; printf"%1d", $ee[$e]; } printf"\n"; printf"ph31 "; for($i = 0; $i < $m; $i = $i+1){ if(floor($i)%4 == 0){print " "}; if(floor($i)%32 == 0){print "\n"}; printf"%1d", $rx[$i]; } printf"\n";