# Situational Awareness: Mapping Interference Sources in Real-Time Using a Smartphone App
## 2 Theoretical Background  
Any RF signal from an undesired source that affects a GNSS receiver is considered interference [18]. According to its source, RFI can be classified as unintentional or intentional. While the former, including out-of-band emissions and harmonic frequencies of commercial systems, is accidental, the latter is specifically generated to deny the GNSS service and, due to its malicious origin, it is certainly the most dangerous one. Among the intentional sources of interference, jamming and spoofing are the two main categories and much effort is being spent by the research community in tackling such kind of threats. Jamming consists in injecting a high power signal into the GNSS band with the final purpose of disturbing/blocking the reception of GNSS signal. Even more malicious than jamming, a spoofing attack deceives a target receiver with a counterfeit copy of the GNSS signal to take control of the receiver behavior. Several recent newspaper and magazine articles report jamming events [19; 20; 21] and spoofing attacks [22; 23]. In this context, the need of creating a'situational awareness' around the receiver is more than ever required [24; 25]. In this regard, the crowd-sourcing paradigm, i.e., aggregating and sharing information from multiple receivers, is an highly effective means for detecting and even locating interference sources, as shown in [26] for the detection of spoofing attacks in the aviation domain and in [25] for creating situational awareness for vessels sailing the Baltic Sea. Many are the approaches presented so far to deal with jamming and spoofing signals. Comprehensive surveys of the main state of art solutions can be found in [27; 28] and [29; 30; 31; 32; 33; 34], respectively. Among all of them, the detection algorithms are of primary interest: in order to trigger any procedure of classification, localization and mitigation, the interference has to be at first detected. In this context a quick crowdsourced detection is recommended to raise early warnings and take preventive actions. It has already been argued that an effective detection relies on a combination of techniques applied at different stages along the GNSS signal processing chain [2]. In the literature, most solutions propose a mixture of pre- and post-correlation techniques for a single antenna stand-alone GNSS receiver. While the former detects the presence of an unexpected distribution of power in GNSS bands, the latter are used to find an abnormal behavior of correlation peaks. The clear trend is to design algorithms able to detect and classify all kind of interference [34; 35; 36; 37; 38; 39]. For instance, in [34] a simple and low-complexity power-distortion detector, able to discriminate jamming from spoofing and multipath signals is presented: it is based on observations of both the received power and correlation function distortion, used into a Bayesian M-ary hypothesis testing framework. A combination of pre- and post-correlation metrics is proposed in [35], which employs both an input data variance plus PSD analysis and a C/N\({}_{0}\) plus symmetric ratio test. Pre-correlation time-frequency (TF) domain analysis, mainly focusing on jamming signals, is adopted in [37; 38; 39]. Targeting specifically spoofing detection, works in [40; 41] propose post-correlation approaches based respectively on a new particle filter for the positioning computation and detections' fusion based on correlators output monitoring and Doppler consistency check. A subspace projection-based spoofing mitigation algorithm, relying on code delay and Doppler information, is detailed in [42]. A combination of pre- and post-correlation techniques for the RFI detection is also the approach adopted in this work. As better detailed in Section 4, we propose a new simple PSD-based metric, namely the total energy of error, to be applied to the pre-correlation samples and a Signal Quality Monitoring (SQM) algorithm, namely the Chi-square Goodness of Fit (GoF) statistical test [43], to the post-correlation samples.