#!/usr/bin/perl # confirming phase cycling as reported in papers; below confirms # path C 0 -> 3 -> -1 # delP 3 -4 #echo pathway delta Ps $da= 3; $db= -4; use POSIX; $m=8; #total number of steps in phase cycle #put in phase cycle below explicitly # @aa=(0,2,0,2, 1,3,1,3); #ph1 @bb=(1,1,3,3, 0,0,2,2); #ph2 # # calculate path and phase of receiver now: for($i = 0; $i < $m; $i = $i+1){ $a = floor($i)%($#aa+1) ; $b = floor($i)%($#bb+1) ; $path = $aa[$a]*$da + $bb[$b]*$db ; $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"ph1 "; 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"ph2 "; 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"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";