## 3 Smoothing Algorithm  
The most obvious way to detect the presence of interference in a radiometric signal is by detecting power peaks in the received signal that are larger than the variance of the measured thermal noise in the absence of RFI. This detection can be performed either in both the time and frequency domains.  
This technique can be straight-forwardly extended to the spectrogram. Considering that a power peak is produced by an RFI signal, the threshold value must be a function of the thermal noise variance  
Figure 2: Transformation of the zero-mean Gaussian noise distributions (in-phase and quadrature components) into an exponential distribution with same standard deviation and mean.  
(power), and must maximize the probability of RFI detection (\(P_{\text{det}}\)) and minimize the probability of false alarm (\(P_{\text{fa}}\)) detection. RFI probability of detection cannot be computed in advance since the presence of RFI is unknown, but the probability of false alarm is easy to obtain as the thermal noise follows a known Gaussian distribution.  
All simulations performed in this work have been performed assuming an antenna temperature (\(T_{\text{A}}\)) of 300 K and a radiometer receiver noise temperature of 100 K. In order to make a relationship between the noise power and the RF interfering signal power, the Interference-to-Noise Ratio (INR) is defined as:  
\[\text{INR}\triangleq\frac{\sigma_{RFI}^{2}}{\sigma_{Noise}^{2}} \tag{1}\]  
where \(\sigma_{\text{RFI}}^{2}\) is the power of the interfering signal and \(\sigma_{\text{Noise}}^{2}\) is the thermal noise power.  
The threshold value of this algorithm must be selected to limit the error in the estimated antenna temperature produced by false alarms.  
If an RFI-free spectrogram is observed (Figure 1, panel 4) it is obvious that the noise power peaks are scattered (and usually isolated) in both frequency and time, while in an RFI contaminated spectrogram (e.g., Figure 4a), the RFI is usually clustered in determined regions in the frequency-time plane. Considering the spectrogram as an image, noise power peaks present higher spatial frequency contents (rapid variations) than the RFI, which are usually clustered. Hence, applying a 2D smoothing filter (low-pass filter) will attenuate these exponential \"peaks\", while the RFI contaminated regions will be preserved. RFI is preserved so it can be detected with a more restrictive threshold.  
The algorithm proposed in this work can be summarized as follows with the aid of Figures 3 and 4:  
* Power spectrogram calculation of a data segment of \(2^{18}\) samples using data segments of \(2^{10}\) samples, with 75% overlap, and a Hann window (Figure 4a).
* Convolution of the power spectrogram with a 2D low pass filter of a determined size (in this work the Hann window has been chosen, although a Gaussian or a Hamming window would perform similarly (see Figure 4b)).
* Thresholding: a threshold is used in the smoothed power spectrogram, in order to detect clusters of RFI-contaminated pixels (Figure 4c). The optimum threshold will be discussed in Section 5.
* Antenna noise power is calculated by averaging all spectrogram pixels below the threshold.
* Finally, \(T_{A}\) is obtained from the antenna noise power.  
Figure 3: Smoothing algorithm diagram.