
Walsh Function Modulation
All observations which involve position switching or focus modulation (which is usually only done with frequency switching measurements) at the 12 Meter Telescope use a Walsh function for each SIG–REF measurement. For a given measurement of duration P composed of n SIG–REF measurement pairs (a SIG–REF pair is referred to a “repeat” in the 12m telescope lingo), a switching sequence determined by the Walsh function of PALey order 2n – 1 is built up. Building up a PALey order of 2n – 1 Walsh functions, where n is the number of ON–OFF pairs, perfectly rejects polynomial drift terms of order up to and including n – 1. This statement implies that…
This sequence of SIG–REF switching can be truncated at any even point. Ideally, it would be truncated after exactly 2n phases, at which point it gives the maximum rejection of an tn – 1 and lower order polynomial drift. Although we recommend that observers try to truncate this way, we don’t insist on it. The order of polynomial drift completely rejected is then a function of the biggest 2m sequence (or the inverse of this sequence) that has been repeated without truncation. Since the PALey order is calculated in real time, we don’t need to know in advance how many terms there will be. The algorithm is simply the following… After ever complete set of m (2 or more, but always a power of 2) phases, the next m phases will be a repeat of the first m, without 0 and 1 reversed. This is equivalent to adding another order of Rademacher function to the R products generating a Walsh function of order 2n – 1
This assures we build up a PALey order of (2n – 1,t), with n being increased by 1 after every complete set, and which means that polynomial drift terms up to order (n – 1) are perfectly rejected. In practice each phase usually lasts 30 seconds, although phases as short as 10 seconds and as long as a minute are occasionally used. How long a sequence we have really depends on how long the observer wants to integrate. The “0 1 1 0” is normally the shortest sequence, with the 2 pairs of phases. We probably rarely use more than 8 pairs, which would be an 8 minute (in total time) integration at 30 seconds per SIG and REF integration phase. In other words, typical functions are usually PAL(3,T), PAL(7,T) or PAL(15,T). Figure E.1 shows the Walsh functions of order 2n – 1 for n = 1 – 5. The following C code fragment (written by Jeff Hagen) is used in the 12 Meter Telescope control program to calculate the Walsh function.
Walsh(i) int i; { int bool = 0; int mask = 0x8000; while(mask) { if( mask & i ) bool += 1; mask = mask>>1; } return( bool % 2 ); }

Copyright Arizona Radio Observatory. 