# Constrained Optimization of FPGA Design for Spaceborne InSAR Processing
## 2 Theoretical Background  
### Coarse Registration and Interferogram Generation of InSAR  
The InSAR processing flow includes 6 steps [51]: image registration, interferogram generation, interferogram flattening, interferogram phase filtering, interferogram phase unwrapping, phase to height conversion and geocoding. Existing research shows that the interferogram generation process is the most time-consuming step, occupying about 32% of the time in the process of InSAR (without fine registration) [34]. Therefore, this paper focused on the first two steps of InSAR processing: image registration and interferogram generation, to shorten the processing time of InSAR.  
Before calculating the interference phase and coherence coefficient, the two images need to be registered to obtain accurate phase information. Image registration can be divided into coarse and fine registration, according to accuracy. Pixel-level registration is called coarse registration, while sub-pixel registration (i.e., less than one pixel) is fine registration.  
The specific case used in this paper was the observation of the variation of ocean depth in the vast ocean scene through satellite altimetry. Since this paper did not focus on any particular area, fine registration resampling applied in GPU [52; 53] did not fit our needs. Thus, a coarse registration algorithm, based on the correlation function, was adopted, as shown in Formula (1). \(M_{1}\)(_i,j_) and \(M_{2}\)(_i,j_) are the amplitude of the two complex images, and \(R\)(_u,v_) is the correlation function of the two images. The correlation process could be transformed from the time domain into the frequency domain and quickly calculated by Fast Fourier Transform (FFT), as Formula (2) shows, which also suits pipeline operation in FPGA. \(M_{1}\)(_i,j_) and \(M_{2}\)(_i,j_) in the time domain correspond to \(S_{1}\)(_m,n_) and \(S_{2}\)(_m,n_) in the frequency domain, and \(R_{FFT}\) is the frequency domain result of the correlation function \(R\)(_u,v_). The symbol * denotes the conjugate operation:  
\[R(u,v)=\frac{\sum\limits_{i}\sum\limits_{j}M_{1}(i,j)M_{2}(i+u,j+v)}{\sqrt{ \sum\limits_{i}\sum\limits_{j}M_{1}^{2}(i,j)\cdot\sqrt{\sum\limits_{i}\sum \limits_{j}M_{2}^{2}(i+u,j+v)}}} \tag{1}\]  
\[R_{FFT}=S_{1}(m,n)\cdot S_{2}^{*}(m,n) \tag{2}\]  
Cross-correlation results of the two images could be obtained by performing Inverse Fast Fourier Transform (IFFT) on the \(R_{FFT}\). The offset coordinate (\(x\)-axis, \(y\)-axis) of registration could be calculated using the position of the maximum value in cross-correlation results.  
What followed was interferogram generation. After the two images were aligned, according to the offset coordinates, the phase and coherence coefficient could be calculated using Formula (3):  
\[\gamma=\frac{E\{M_{1}\cdot M_{2}^{*}\}}{\sqrt{E\Big{\{}\big{|}M_{1}\big{|}^{2 }\Big{\}}\cdot E\Big{\{}\big{|}M_{2}\big{|}^{2}\Big{\}}}}=|\gamma|e^{i\theta} \tag{3}\]  
In this formula, \(M_{1}\) and \(M_{2}\) represent two complex images; \(E\) {\(\cdot\)} means the mathematical expectation; * is the conjugate; \(\gamma\) is the complex coherence, and \(|\gamma|\) is the amplitude of the complex coherence; \(\theta\) is the phase.  
The FPGA calculation flow of coarse registration and interferogram generation is shown in Figure 1. Firstly, the sub-image (i.e., 512 \(\times\) 512) was from the center of the original image (i.e., 16,384 \(\times\) 4096). Secondly, the two sub-images were sent to the two-dimensional FFT, including range FFT, matrix transposition, and azimuth FFT. Thirdly, after the two-dimensional FFT and IFFT, the offset was obtained from the maximum value. Finally, the two images' coherence coefficient and interference phase could be calculated, according to the offset coordinate (\(x\)-axis, \(y\)-axis).  
The operation of matrix transposition is essential in the process of two-dimensional FFT. The step of matrix transposition is highlighted in grey to illustrate that a specialized FPGA structure was required.