#!/usr/bin/perl # confirming phase cycling as reported in papers; below confirms emsley RCS 2010 zfrinad # ae path H 0-> -1 # ae path C 0-> -1 -> 1 -> 2 -> 1 -> -1 -> 0 -> -1 # ae delP -1 2 1 -1 -2 1 -1 #echo pathway delta Ps $dh= -1; $da= -1; $db= 2; $dc= 1; $dd= -1; $de= -2; $df= 1; $dg= -1; use POSIX; $m=128; #total number of steps in phase cycle #put in phase cycle below explicitly # @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, 2,2,3,3, 0,0,1,1); #ph4 @cc=(0,0,1,1, 2,2,3,3); #ph5 @dd=(0 ); #ph6 @ee=( (1)x16, (3)x16 ); #ph7 ; @ff=(0); #ph10 @gg=( (0)x32, (1)x32, (2)x32, (3)x32 ); #ph11 # # 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) ; $f = floor($i)%($#ff+1) ; $g = floor($i)%($#gg+1) ; $path = $hh[$h]*$dh + $aa[$a]*$da + $bb[$b]*$db + $cc[$c]*$dc + $dd[$d]*$dd + $ff[$f]*$df + $ee[$e]*$de + $gg[$g]*$dg ; $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"ph10 "; for($i = 0; $i < $m; $i = $i+1){ if(floor($i)%4 == 0){print " "}; if(floor($i)%32 == 0){print "\n"}; $f = floor($i)%($#ff+1) ; printf"%1d", $ff[$f]; } printf"\n"; printf"ph11 "; for($i = 0; $i < $m; $i = $i+1){ if(floor($i)%4 == 0){print " "}; if(floor($i)%32 == 0){print "\n"}; $g = floor($i)%($#gg+1) ; printf"%1d", $gg[$g]; } 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";