A Novel Approach for Cancellation of Non-Aligned Inter Spreading Factor Interference in LoRa Systems

Long Range (LoRa) has become a key enabler technology for low power wide area networks. However, due to its ALOHA-based medium access scheme, LoRa has to cope with collisions that limit the capacity and network scalability. Collisions between randomly overlapped signals modulated with different spreading factors (SFs) result in inter-SF interference, which increases the packet loss likelihood when signal-to-interference ratio (SIR) is low. This issue cannot be resolved by channel coding since the probability of error distance is not concentrated around the adjacent symbol. In this paper, we analytically model this interference, and propose an interference cancellation method based on the idea of segmentation of the received signal. This scheme has three steps. First, the SF of the interference signal is identified, then the equivalent data symbol and complex amplitude of the interference are estimated. Finally, the estimated interference signal is subtracted from the received signal before demodulation. Unlike conventional serial interference cancellation (SIC), this scheme can directly estimate and reconstruct the non-aligned inter-SF interference without synchronization. Simulation results show that the proposed method can significantly reduce the symbol error rate (SER) under low SIR compared with the conventional demodulation. Moreover, it also shows high robustness to fractional sample timing offset (STO) and carrier frequency offset (CFO) of interference. The presented results clearly show the effectiveness of the proposed method in terms of the SER performance.


I. INTRODUCTION
T HE internet of things (IoT) enables physical objects to interconnect and exchange data. Long distance and limited power consumption are important requirements for efficient data transmission in IoT. Low power wide area networks (LPWAN) provide a solution to help operators meet the specific coverage and power consumption requirement of IoT. Long-Range (LoRa) is a popular LPWAN physical layer technology which enables data communication over a long range while maintaining limited power usage [1].
LoRa employs chirp spread spectrum (CSS) which is a variant of frequency shift keying (FSK) modulation to encode data [2], [3]. LoRa's physical layer standard defines the spreading factor (SF) as the number of bits that one data symbol represents, which ranges from 7 to 12 bits. Signals modulated with different SFs are assumed to have a very low correlation, i.e., quasi-orthogonality, due to the chirp signal properties [4].
When two users with different SFs transmit simultaneously at the same time and frequency, and the source of the desired signal is farther away from the gateway while the source of the undesired signal is closer, the power of the desired signal will be much lower than the undesired signal at the receiving gateway. This problem is known as the near-far problem. In this case, the correlation between the desired and undesired signal is no longer negligible. The undesired signal can interfere with the demodulation, limiting the scalability of LoRa networks [5]. In other words, the orthogonality between signals from different SFs is imperfect. The undesired signal can be regarded as non-aligned inter-SF interference, since the signals modulated with different SFs are randomly overlapped. Although the most significant collision occurs when the SF of signal and interference are identical [6], the inter-SF collision cannot be ignored, especially in near-far conditions.
A. Literature on LoRa performance analysis In the current literature, a few works have investigated the issue of collision in same-SF scenario. The investigation in [7] derives an approximation for the bit error rate (BER) of the LoRa modulation under additive white Gaussian noise (AWGN) and considering interference from another transmitter with the same SF, whereas the work in [8] provides an approximation for the symbol error rate (SER) under a more general non-aligned model. In addition to the mathematical analysis, the authors in [9] propose a receiver structure using serial interference cancellation (SIC) technique, which is able to demodulate multiple users simultaneously transmitted over the same frequency channel with the same SF. The work in [10] proposes LoRaSyNc (LoRa receiver with synchronization and cancellation), which can demodulate the strongest signal in case of same-SF collisions, and thus enables signal cancellation and iterative decoding. The authors in [11] propose an enhanced receiver able to synchronize and decode simultaneously received LoRa signals modulated with the same SF, where commercialized LoRa chips are employed. In [12], mLoRa is proposed for decoding of collided frames modulated arXiv:2204.06803v1 [eess.SP] 14 Apr 2022 with the same SF. It first detects and partly decodes the collision-free samples of the collided frames. The collided samples are then reconstructed and used for SIC.
Although these publications present appealing results, they do not consider the inter-SF scenario. Furthermore, [9], [10], [11] and [12] use SIC technique to design LoRa receivers and the performance relies heavily on the synchronization of overlapped signals. The study presented in [5] investigates the influence of the imperfect orthogonality between different SFs and shows that inter-SF collision can degrade LoRa BER performance under low signal-to-interference ratio (SIR). Compared to same-SF interference under which LoRa presents a very high capture probability, inter-SF interference has a different impact on LoRa performance, which can be approximately treated as white noise [13].
Furthermore, LoRa PHY coding mechanisms can reduce synchronization error, but cannot mitigate the influence of inter-SF collisions [6]. LoRa employs a discrete Fourier transform (DFT) based mechanism for time and frequency synchronization [14], [15], which can also be affected by inter-SF collision. In [16] it is shown that high SFs are severely affected by inter-SF collision, and using power control and packet fragmentation produces very little effect on this problem. The authors in [17] further extend the study of inter-SF interference to investigate the influence of the chirp rate, which is dependent on both SF and bandwidth. Their results show agreement with the values of SIR threshold to those reported in [5].
Nevertheless, the issue of inter-SF collision has been seldom mathematically analyzed in the literature. Compared to same-SF interference, inter-SF collision is more difficult to model and estimate. First, the SF of the interference is unknown at the LoRa gateway and thus needs to be identified. Furthermore, the detection and synchronization of the interference signal can be prevented if the received signal does not contain the preamble, or the preamble structure is unknown.

B. Contributions
In this work, we model the inter-SF interference in LoRa, and propose a method that enables the receiver to estimate and reconstruct the non-aligned inter-SF interference from another unknown user. Therefore, allowing interference cancellation at the gateway. Our main contributions are: • An algorithm to estimate the equivalent non-aligned inter-SF interference signal, including the SF identification, equivalent data symbol, and complex amplitude estimation, which therefore enables the cancellation of interference.
• We evaluate the SER, BER of perfectly synchronized signals in the presence of interference under AWGN channels, and show that this method can significantly improve the demodulation performance.

C. Organization
This paper is organized as follows. Section II provides an overview of the system model of LoRa, where the mechanism of CSS modulation is also introduced. In Section III, the Interference signal with data symbol l and sampling offset τ w[n] Additive white Gaussian noise lq q-th interference symbol collided with the desired symbol r[n] Despread received signal Reconstructed interference signal Received signal after interference cancellation Peak-to-average ratio of the absolute value of Despread signal using a down-chirp modulated with SF = log 2 N P DFT

Number of DFT blocks
Operation of absolute value max(·) Operation of maximum value min(·) Operation of minimum value · Operation of floor modeling of inter-SF interference is presented. The proposed interference cancellation scheme is illustrated step by step. Section IV shows the simulation results of the proposed algorithm. In the end, conclusions are drawn in Section V. The notations and symbols used in this work are defined in Table I.

II. SYSTEM MODEL
The CSS modulation employed in LoRa is implemented by using linear frequency modulated chirp pulses to encode information, which enables the energy to spread in frequency [18]. We consider a LoRa receiver sampling signals at the Nyquist frequency. Then, the equivalent equation of a discrete LoRa signal in the physical layer (PHY) is given by [19]: Gateway Fig. 1: Block diagram of the proposed interference cancellation scheme. The desired signal is added to a signal with a different SF. At the receiver side, the interference cancellation is performed on the signal. The conventional demodulation is employed after interference cancellation.
where N u = 2 SFu is the total number of samples within one LoRa signal, SF u ranges from 7 to 12 and represents number of bits contained in one data symbol, A u = E s /N u represents the signal amplitude, where E s is the symbol energy, and n is the sample index. The complex exponential contains the data symbol k and its energy is spread by the discretetime raw up-chirp c[n] = exp jπn 2 /N u . The data symbols are integer values from the set K = 0, . . . , 2 SFu − 1 . The bit-words containing SF bits are mapped onto one symbol k, which feeds the CSS modulator.
We specify the case in which only one interferer using a different SF exists. In addition, we also consider that the user and the interferer operate using the same bandwidth. Assuming a receiver perfectly synchronized in time and frequency, a data symbol interfered with data symbols from another user modulated with a different SF at the gateway can be described by (2), where i l [n + τ ] represent interference signals. A i is the amplitude and l ∈ L = 0, . . . , 2 SFi − 1 are the interference data symbols. N i = 2 SFi represents the total number of samples within one interference data symbol, where SF i is the SF of the interferer, n + τ is the sample index of the interference and τ is the sample timing offset (STO) between the desired signal and interference, e j2πχn/Ni is the phase shift induced by χ which is the carrier frequency offset (CFO) of the interference signal, h u and h i are the complexvalued channel gains experienced by the desired user and interferer, respectively. w[n] ∼ CN (0, σ 2 ) is AWGN. To be more precise, since N u = N i , one desired data symbol can overlap multiple interference data symbols in serial, or vice versa. The complete expression of i l [n + τ ] is shown in (3), where l q , q ∈ Z, is the q-th interference symbol collided with the desired symbol.
In the conventional LoRa demodulation scheme, the received signal y k [n] is first multiplied by the down chirp c * [n] to obtain Then, the non-coherent detection in LoRa is performed by selecting the frequency index with the maximum magnitude, which enables the demodulation without compensation of channel phase rotation. This operation can be described aŝ where R[f ] = F {r[n]}, and F {·} represents the DFT operator, which can be easily performed via the fast Fourier transform (FFT) algorithm.

III. INTERFERENCE MODELING
This section presents a method to estimate and cancel the interference signal modulated with a different SF without any prior knowledge of the interference. We consider an interference signal from a single interferer modulated with another unknown SF, which overlaps the desired signal randomly. Let i l [n] be the reconstructed interference signal, where N i = 2 SFi is the estimated N i of the interference, l and A i are the estimated equivalent interference data symbol and amplitude, respectively. Note that is a phasor. Therefore, both the magnitude A i |h i | and the phase φ of it should be estimated. The signal after interference cancellation is given bỹ In this section, the algorithm for estimating SF i is firstly presented. Then, the estimators of l and h i A i are respectively introduced. The interference cancellation is presented in the end. The entire block diagram of the interference cancellation scheme is shown in Figure 1.

A. Interference signal SF identification
The LoRa signals modulated with different SFs have the quasi-orthogonality property. Suppose a LoRa signal modulated with SF 1 . If this signal is despread and demodulated using SF 2 , where SF 1 = SF 2 , there will not be a prominent peak of the DFT output. In other words, the magnitude of an N -point DFT of a despread signal modulated with SF i will show a single prominent peak only when N = 2 SFi . Although the non-alignment of the interference signals results in two attenuated peaks within the frequency spectrum, as shown in Figure 2b, the signal energy is not spread. Therefore, this characteristic can be employed for SF i identification. However, under a noisy environment, the DFT with unmatched SFs can show multiple peaks and the highest one can be higher than that with the matched SF. Hence, instead of using the peak of DFT output, we employ the peak-to-average ratio (PAR) of the DFT magnitude as a metric to estimate SF i . The PAR is given by where if N i < N u : b) N > N s : The DFT block size exceeds the number of the provided samples, and the DFT cannot be performed. The zero-padding method can be applied to solve this, where we pad N −N s zeros at the end of the signal. Then, a single-block N -point DFT can be performed. The PAR can be calculated using (7).

C[N ]
is then calculated for the range of possible N . SF i is obtained from N i , which can be expressed as Algorithm 1 illustrates the proposed interference signal SF estimation. It is noted that using an N s as large as possible reduces the estimation error by evaluating the results of several blocks of DFT.
B. Estimation of the data symbol from the interference signal As the interference signal is not synchronized, direct estimation of the data symbol is not possible due to symbol shift. However, it is sufficient to estimate the equivalent interference signal under unsynchronized condition for performing interference cancellation. In this case, an N i -point DFT block likely contains samples from two consecutive interference symbols.
An intractable problem appears when the boundary between two LoRa signals is at the middle of the DFT block, as shown  in Figure 2, where the DFT result shows two comparable peaks, but only the index of the largest will be selected. This results in the loss of the data symbol represented by the smaller peak. Segmentation of the received signal can mitigate the data loss caused by non-alignment, since the information is spread into each sample of the LoRa signal due to the energy spreading. Any segment of the LoRa signal contains the information to identify the data symbol. In other words, non-aligned interference signals can be equivalently estimated via its segments at the expense of reduced processing gain, but with robustness against non-alignment. Each interval of the received signal with the length N i can be divided into d ∈ D = {1, 2, 4, 8, . . . , N i } segments. In order to perform DFT on the segments extracted from the signal with the length N i /d, zero-padding is employed to fill the vacant sample positions to obtain again a signal with N i samples, as shown in Figure 3. It is worth noting that after segmentation and zero-padding only one segment of the signal involves the information of different data symbols, while the rest of the segments only contain the information of a single data symbol that can be accurately estimated. The latter scenario is chosen for the following analysis. We denote θ = τ + χ. The m-th segment of an interference signal padded with zeros can be expressed as A i |h i |exp j π N i n 2 + 2n (l + θ) + τ 2 + 2lτ + jφ , for n = N i m/d, . . . , N i (m + 1) /d − 1, 0, for n = N i (m + 1) /d, . . . , N i − 1,  (10) This expression indicates that each despread segment contains the equivalent data symbol value l +θ mod N i and a phase offset e jΦ , where Φ = π(τ 2 + 2lτ )/N i + φ. An example is shown in Figure 4. As one can see, the peak of DFT magnitude is inversely proportional to d. But the frequency bin of DFT using segmentation remains the same. Although the segmented demodulation induces symbol shift due to θ, the correct data symbol of the interference is not of interest. After zero padding, each segment contains the information for extracting the equivalent data symbol of interference, which can be expressed as where Q m l [f ] = F {s m l [n]} and l m is the estimation of l + θ mod N i . Then, the interference signal can be reconstructed by extracting the desired data from d estimated segment signals, which can be expressed as Comparing (2) with (12) yields tõ where i l,τ,χ [n] = h i i l [n + τ ]e j2πχn/Ni is the received interference signal. It can be recognized that it is necessary to still estimate A i |h i | and Φ to reconstruct the interference signal.

C. Estimation of the complex amplitude of the interference signal
The goal is to estimate the complex amplitude of the interference signal without knowledge of SIR. For a perfectly synchronized receiver under noise-free condition, assuming a desired LoRa signal modulated with SF u carries a data symbol k. Its DFT magnitude yields a peak when f = k, which can be described as Thus, Similarly, from (10) and (11) we can obtain where N i /d is the segment length of the interference signal. Note that the exponential term is the phase of the interfering signal. Therefore, the complex value of (16) is chosen for estimation of the complex amplitude of the interference signal. Thus, which is the estimation of A i |h i |e jΦ for the m-th segment. Similarly to (12), A i can be expressed as a piecewise function of n (18) Then, we have the interference signal reconstructed as We note that this estimation is valid only for the segment that contains the information of one LoRa data symbol, i.e., same-symbol segments. The inaccurate interference estimation will happen when the segment contain the boundary of two consecutive signals, i.e., inter-symbol segment. However, this issue can be mitigated using smaller segments.

D. Interference Cancellation
After reconstructing the interference using l m and A m i , the interference cancellation is performed using subtraction. Finally, the conventional demodulation method can be used for recovering the transmitted symbol from the desired user. A comparison between the proposed method and the conventional demodulation in terms of the DFT spectrum of the desired signal is presented. First, Figure 5a shows the DFT spectrum of a LoRa signal with inter-SF interference, where the interference includes only integer CFO and STO. It can be recognized that without interference cancellation the peak from the desired symbol cannot be observed due to the interference, whereas after interference cancellation the  interfered with non-aligned interference with SF i =7 under SIR=-20dB is demodulated using conventional demodulation method (blue curve). The same signal is demodulated after interference cancellation with d=8 (red curve).
desired peak becomes prominent. Furthermore, Figure 5b, 5c and 5d illustrate the DFT spectrum for the same signal, but also with fractional CFO and STO in the interference. It can be noticed that the interference can still be accurately suppressed in spite of the fractional frequency component and the subsample offset.

IV. SIMULATION RESULTS
In order to evaluate the validity of the proposed approach, we resort to numerical simulations. The LoRa performance is evaluated under two different channel conditions, namely noiseless and AWGN. A LoRa transceiver chain is simulated following the system model presented in Section II. For each simulation run, we create an overlapped signal by adding the desired signal modulated with SF u to a number of random interfering symbols with SF i . Firstly, the performance of SF i identification is evaluated. Then, the selection of the number of segments d is also investigated to obtain the best performance of interference estimation. Afterwards, the LoRa performance using the proposed scheme is shown. Similarly to [5], we assume that the desired signal is perfectly synchronized, while the interference is randomly shifted in time. The LoRa demodulation performance in terms of both SER and BER is presented. In the end, the proposed demodulation under interference-free condition is also investigated. Simulation results show that the influence caused by interference can be neglected under SIR > −10 dB, which is in accordance with [5] and [17]. Therefore, we only consider SIR −10dB. Unless specified otherwise, the settings for the simulations are listed in Table II.

A. Performance of interference SF identification
It can be concluded from Section III-A that the accuracy of interference SF identification depends on the noise and interference level. Since the proposed SF identification scheme is based on the demodulation of the interference, a low SIR increases the accuracy of estimation. Therefore, the interference SF estimation is performed under harsh conditions with high SIR and low SNR. Table III shows the confusion matrices of interference SF identification with SF u = 9 under SIR=-10dB and SNR=-20dB. The transmitter is assumed to be synchronized with the receiver, while the interference signals are randomly shifted in time for non-alignment. Moreover, for each simulation run the interference signal includes random τ and χ with the range in Table II. Each confusion matrix includes the results of all possible interference SFs with a fixed N s . It can be easily recognized that the larger the N s , the higher the identification accuracy since more signal data are processed. Furthermore, a smaller interference SF is more difficult to identify, since it is more sensitive to noise due to the associated smaller processing gain. As shown in Table IIIa, the identification accuracy of SF i ≥ 11 is 1 while the accuracy is only 0.684 of SF i = 7. As N s goes from 512 to 8192, the identification accuracy of SF i = 7 increases to 0.962. As N s further increases, the accuracy will be closer to 1.

B. Investigation on the required number of segments
From Section III-B, we know that as the number of segments increases, the accuracy of the estimation of the interference signal improves. However, the DFT magnitude is inversely proportional to d, and a low peak will be more likely disturbed by noise, thus degrading the estimation performance. For investigating the influence of d on the estimation of the interference signal, the mean square error (MSE) The minimum of M d can only approximately achieve the best estimation performance [20], since the proposed estimation is valid for same-symbol segments but inter-symbol segments are present. Nevertheless, this intersymbol segments have negligible influence on the interference signal reconstruction. Figure 6 presents M d versus d under both noise-free and AWGN, where fractional τ and χ are not included. It can be seen that for both cases M d first reaches its lowest point as d increases to a certain value d best , which represents the best performance of interference signal estimation, and then rebounds. Since segments with shorter length result in lower processing gain, we observe the performance degradation of interference estimation. It can be also recognized that, d best under AWGN is smaller than the one obtained under noise-free condition, which verifies the previous consideration that smaller segments are more sensitive to noise. Analysis on all SF combinations also shows that the d values minimizing M d are identical for the same SF i . In other words, the SF of the desired signal has little impact on the estimation of the interference. Although M d can indicate d best , it cannot be calculated in real wireless condition. Therefore, V d = Var | A m i | d is also illustrated in Figure 6, which is the variance of | A m i | d . It is clear that V d and M d are very close and coincide after d = 4, which indicates a small bias of the proposed estimation for d < 4. Moreover, from both curves the same d best is obtained. Thus, the required number of segments can be determined from V d before interference cancellation. First, we loop through all possible d based on SF i to calculate V d for each d. Then, d best is selected from the smallest V d which can be expressed as C. Demodulation performance Figure 7 shows the SER versus SIR under noise-free condition for the perfectly synchronized desired signal, with a smaller and a larger SF i compared to SF u , respectively. N s is set to 8192 for SF i estimation. It can be recognized that the proposed method significantly reduces the SER compared with the conventional demodulation. Above all, we can see that the results with d = 1, which is interference cancellation without segmentation, already improve SER performance. Then, the SER further decreases as d increases. When d is close to d best , the SER is already close to zero. Figure 8 shows the SER of the synchronized frame under AWGN with SF u =9, SF i =7, where the curves of the proposed method are obtained with d best . N s is set to 8192 for SF i identification. The red solid line describes the SER result under interference-free condition using conventional demodulation. We can also recognize from other unmarked curves that the interference degrades the SER     performance of the conventional demodulation significantly. When SIR= −20dB, the SER is above 0.5 for each SNR. It can be observed from the marked curves that the proposed method still works in AWGN and outperforms the conventional method. Furthermore, the demodulation performance of the proposed method only shows negligible degradation when the interference includes random fractional CFO and STO with the range in Table II. Most importantly, it is able to avoid decoding failure under low SIR condition. In addition, we notice that d best becomes smaller as the SIR increases, since a large d will degrade the interference estimation performance when the noise is more dominant than the interference, leading  to inaccurate interference cancellation. Furthermore, Figure 9 shows the BER of the synchronized frame under AWGN with SF u =9, SF i =7 and SIR=-20 dB. The LoRa PHY coding is performed following the steps in [21]. First, the payload bits are encoded by (7,4) Hamming code that can correct single-bit errors. Second, the codewords are interleaved using diagonal interleaver for more robustness to burst errors. Then, Gray indexing is employed for mitigating bit errors induced by off-by-one data symbol errors. In order to show the impact of coding on the BER, both coded and undecoded BER are presented. It can be first noticed from the two solid lines that the coding cannot reduce the BER using conventional LoRa demodulation under low SIR. While after interference cancellation, both undecoded and coded BER are reduced. Notably, combining interference cancellation and LoRa PHY coding can further improve the demodulation performance.

D. Interference-free condition
It can be seen from Algorithm 1 that the scheme will always generate an identified SF i whether interference exists or not. When no interference exists, the proposed scheme will cause false alarms and still perform interference cancellation using the wrongly identified SF i . Figure 10 illustrates the SER of the interference-free scenario using SF u =9 under AWGN. The interference cancellation is performed for all possible SF i with    It can be seen that the false interference cancellation slightly degrades the LoRa demodulation performance and the smaller the wrongly identified SF i , the higher the SER. Moreover, this impact can be ignored at high SNR since the SER of all the wrongly identified SF i is closer to zero under SNR > -12dB. Therefore, even under interferencefree condition, where the interference cancellation is wrongly performed, the proposed scheme still can be applied at the gateway, with a little loss of demodulation accuracy.

V. CONCLUSION
In this work, the non-aligned inter-SF interference from one interferer is modeled and analyzed. A receiver is structured to reconstruct the interference signal and cancel it from the received signal. The demodulation of the desired signal after interference cancellation is performed under noiseless condition and AWGN, respectively. Simulation results show that the demodulation performance is significantly improved compared to the commonly used method for both conditions. Furthermore, the proposed scheme is also robust against STO and CFO in the interference signal. With the proposed method, the near-far problem caused by inter-SF interference is mitigated, which can offer more options for SF allocation in LoRa networks. Consequently, the scalability of LoRa can be enhanced.
As LoRa synchronization relies on DFT-based demodulation of the preambles, the detection and synchronization of the desired signal can be also influenced by the inter-SF interference. The probability of detection can be efficiently improved by using raw up-chirps as many as possible to equivalently increase the SIR. While the synchronization symbols and the down-chirps are more sensitive to low SIR due to their small number, degrading the synchronization performance. Performing interference cancellation before synchronization can be a choice to solve this problem.
Indeed, this scheme is also applicable to the case in which interference does not exist, at the expense of more computation consumption at the gateway. Future works should explore the false alarms caused by the algorithm of interference SF identification, where a threshold is required to indicate the existence of the interferer, and even the coexistence of multiple interferers to perform iterative interference cancellation.