REV Method
How it works:
Loop for all elements 2:numElements
Attenuate all element except element i and element 1 (which is why its 2:numelements)
With element 1 and i enabled, loop for all 32 phase shifts of element i (11.25 deg steps (5 bit phase shifter))
Record the sum of the signal emitted from the array (this is a complex signal)
Convert the collected complex signal into a power measurement and record the angle related to that power measurement
Update the maxPower variable every shift if the power recorded is greater than the previous maxPower and log the angle in phaseShiftsMaxPow
maxPower is needed because this will indicate when element i and element 1 are in phase
Update the minPower variable every shift if the power recorded is less than the previous minPower and log the angle in phaseShiftsMinPow
minPower is needed because this will indicate when element i and element 1 are out of phase
Return these two matrices: phaseShiftsMaxPow, phaseShiftsMinPow
Add 180 deg to minPower, then mod 360 to limit the shift to [0,360) domain
Average phaseShiftsMaxPow and phaseShiftsMinPow (even though they should be the same values, with noise sometimes they will be a bit off and averaging accounts for that)
Shift the tapers of the test array accordingly using phaseShift function. This only calibrates phase. The accuracy will be half the phase shift step value