# Interference Mitigation for GNSS Receivers Using FFT Excision Filtering Implemented on an FPGA
## 4 Hardware Implementation
### FFT Excision Algorithm  
The FFT excision proposed algorithm is responsible for mitigating the interference from the GNSS receiver signals. This algorithm contains three inputs and two outputs. The main three inputs are the input file name, output file name, and settings. The input file contains the input file with interference, the output file contains the output without interference, and the setting contains the main GNSS receiver settings such as the time of processing, frequency sample, time of turning on the interference, and number of channels. The output of this function contains the number of frequency pins removed from branch A and the number of frequency pins removed from branch B. Figure 13 shows the flowchart of the proposed interference excision algorithm. It illustrates how the software code works to mitigate interference in the following steps.  
Figure 12: Fixed-point design block diagram.  
Firstly, the size of the block was defined based on the FFT size. In our case, the size of FFT was \(2^{10}\) or 1024 points, which represents one block in the processing. Then, the number of blocks was specified based on the time of processing of the interference mitigation algorithm. For example, if the time of processing is 10,000 ms, this means the number of blocks will equal 253,906. The calculation of the number of blocks is based on Equation (4):  
\[Numberofblocks=\left(mstopross\times\frac{fs}{blocksize}\right)-1 \tag{4}\]  
where _mstoprocess_ is the time of processing of the algorithm in ms, _fs_ is 26 MHz, and _blocksize_ is the size of FFT, which is 1024. The subtraction by one is for the 50% overlap. Then, we multiplied the _blocksize_ by 1.5 to consider the 50% overlap that occurs in the second branch as shown in Figure 8. So, the full range size is from 1 to 1536 due to the addition of an extra 512 to 1024. As mentioned previously in Section 3.4, this overlap avoids data loss and reduces the effect of the signal attenuation from the window on the output SNR. After this, based on the algorithm in Figure 8, the input data was divided into two streams. The first stream is called stream A. This stream starts from 1 to 1024 of the blocks. The second stream is called stream B. This stream is a delayed version of stream A by 50%, which starts from 512 to the end of 1536.  
Next, we defined the window size, which should be the same size as FFT. As discussed previously, the Hamming window was chosen with a size of 1024. Next, the hamming windows were multiplied by stream A and stream B. After this, FFT was applied to stream A and stream B to obtain the frequency domain of both streams. After the application of FFT, the algorithm of the suppression of the interference was applied to mitigate the interference,  
Figure 13: Flowchart of the FFT excision algorithm.  
which is explained in Section 4.2. Then, the inverse fast Fourier transform (IFFT) was applied to the output of the suppression function of stream A and stream B to go back to the time domain. Finally, if interference was found in stream A or stream B, the first half of the output (0 to 512 points) was filled by the centre of stream A (256 to 768 points) and the second half of the output (512 to 1024 points) was filled by the centre of the stream (256 to 768 points). If no interference was found, then the middle of the input data (256 to 1280 points) passed to the output.