# A Study on the Amplitude Comparison Monopulse Algorithm
## 3 Least-Squares-Based Amplitude Comparison Monopulse Algorithm  
### Full Measurement-Based Algorithm  
We can solve the estimation problems of azimuth and elevation angle deviations by first linearizing the pseudorange Equation (4), then using the familiar least-squares method. Let the vector of measured signals be \(S=\left[s_{1}\;s_{2}\;s_{3}\;s_{4}\right]^{T}\); then, Equation (4) can be written in matrix form compactly as follows:  
\[S=Ah_{full}(\theta_{az},\theta_{d})+n \tag{17}\]  
where \(h_{full}=\left[g_{1}\;g_{2}\;g_{3}\;g_{4}\right]^{T}\), and \(n=\left[n_{1}\;n_{2}\;n_{3}\;n_{4}\right]^{T}\). If we expand the pseudorange Equation (17) in Taylor series about some nominal values \((\theta_{az0},\theta_{el0})\), and ignore the second and higher order terms, then this equation becomes  
\[S\approx Ah_{full}(\theta_{az0},\theta_{el0})+A\frac{\partial h_{full}}{ \partial\theta_{az}}(\theta_{az}-\theta_{az0})+A\frac{\partial h_{full}}{ \partial\theta_{el}}(\theta_{el}-\theta_{el0})+n \tag{18}\]  
Note that the partial derivatives in the above expression are computed using nominal values \((\theta_{az0},\theta_{el0})\). The residual signal \(\delta S\) is defined as the difference between the actual signal and the signal computed using nominal values:  
\[\delta S=S-Ah_{full}(\theta_{az0},\theta_{el0})\approx A\frac{\partial h_{full }}{\partial\theta_{az}}\delta\theta_{az}+A\frac{\partial h_{full}}{\partial \theta_{el}}\delta\theta_{d}+n \tag{19}\]  
where \(\delta\theta_{az}=\theta_{az}-\theta_{az0}\) and \(\delta\theta_{el}=\theta_{el}-\theta_{el0}\). This equation can be written in four scalar equations in matrix form:  
\[\left[ \begin{array}{c}\delta s_{1}\\ \delta s_{2}\\ \delta s_{3}\\ \delta s_{4}\end{array} \right]\approx\frac{4\;\log 2}{\theta_{3 dB}^{2}}A \left[ \begin{array}{cc}\left(\frac{\theta_{az}}{\sqrt{2}}-\theta_{az}\right) g_{1}&\left(\frac{\theta_{z}}{\sqrt{2}}-\theta_{el}\right)g_{1}\\ -\left(\frac{\theta_{z}}{\sqrt{2}}+\theta_{az}\right)g_{2}&\left(\frac{\theta _{z}}{\sqrt{2}}-\theta_{el}\right)g_{2}\\ -\left(\frac{\theta_{z}}{\sqrt{2}}+\theta_{az}\right)g_{3}&-\left(\frac{ \theta_{z}}{\sqrt{2}}+\theta_{el}\right)g_{3}\\ \left(\frac{\theta_{z}}{\sqrt{2}}-\theta_{az}\right)g_{4}&-\left(\frac{ \theta_{z}}{\sqrt{2}}+\theta_{el}\right)g_{4}\end{array} \right]\left[ \begin{array}{c}n_{1}\\ n_{2}\\ n_{3}\\ n_{4}\end{array} \right] \tag{20}\]  
which can be written in symbolic form as  
\[\delta S\approx H_{full}\;\delta\theta+n \tag{21}\]  
This equation expresses a linear relationship between the residual signals \(\delta S\) and the unknown correction to angle deviations \(\delta\theta\). Note that each row of \(H_{full}\) is shown to be purely a gain-weighted direction vector to each of the beam peaks, as observed from the unknown target location in Figure 3.  
Let us consider a solution for the linearized pseudorange equation, denoted as \(\delta\dot{\theta}^{full}\). The estimated residual \(e\) is defined as the difference between the measured signal and its estimate. Using the linearized form of the pseudorange equations and ignoring measurement noise, the estimated residual is  
\[e=\delta S-H_{full}\delta\dot{\theta}^{full} \tag{22}\]  
Figure 3: Gain-weighted direction vectors and the target. The least-squares solution can be found by minimizing the following functional:  
\[J\Big{(}\delta\delta^{full}\Big{)}=\frac{1}{2}e^{T}e \tag{23}\]  
Then, the solution is  
\[\delta\delta^{full}=\Big{(}H_{full}^{T}H_{full}\Big{)}^{-1}H_{full}^{T}\delta S \tag{24}\]  
This equation assumes that the inverse to \(H_{full}^{T}H_{full}\) exists, which is always true unless voltage gains are zero because of the beam peak and unknown target location geometries. Iterated least-squares estimation starts with setting the initial gradient of Equation (24) with respect to \(\theta_{az0}=0\) and \(\theta_{ed0}=0\) and repeatedly performs the following update until convergence or up to a certain number of iterations:  
\[