# Reducing the Cost of Implementing Filters in LoRa Devices
## 2 Sample Reduction Methods  
Figure 1 illustrates a block diagram of a LoRa system that implements a pulse shaping filter at the transmitter and a matched filter at the receiver. While the performance benefits brought by implementing these filters are demonstrated in detail in [6; 8], this paper focuses on reducing the complexity of implementing the pulse shaping filter in a LoRa end device's transmitter.  
Basic LoRa chirp waveforms are used as the basis for the LoRa modulation technique. They are used in both the preamble and payload of transmitted LoRa packets. The expression for a continuous-time basic LoRa chirp waveform is shown in (1), where \(T_{\text{sym}}\) is the symbol duration in seconds and \(\mu\) is the chirp rate in Hz/second. The continuous-time chirp waveform is then sampled at a rate of \(F_{s}=\frac{1}{T_{s}}=BW\) for digital implementation [6]. The expression for a discrete-time basic LoRa chirp is given below in (2), where \(t=nT_{s}=n/BW\). As an example, Figure 2 plots the real and imaginary components of both \(x_{0}[n]\) and \(x_{0}(t)\) with \(SF=6\) and \(BW=125\) kHz.  
\[x_{0}(t) =\exp\left[j2\pi\left(\frac{\mu t}{2}-\frac{BW}{2}\right)t\right], \quad 0\leq t\leq T_{\text{sym}} \tag{1}\] \[x_{0}[n] =\exp\left[j2\pi\left(\frac{n^{2}}{2M}-\frac{n}{2}\right)\right], \quad n=0,1,\ldots,M-1. \tag{2}\]  
Figure 1: Block diagram of a LoRa (Low-Power Long-Range) system implementing pulse shaping and matched filters.  
LoRa symbols are modulated by cyclically shifting the basic chirp waveform by the symbol value, \(m\), as shown in (3).  
\[x_{m}[n] = x_{0}[n+m]=\exp\left[j2\pi\left(\frac{(n+m)^{2}}{2M}-\frac{(n+m)}{ 2}\right)\right] \tag{3}\] \[= \exp\left[j2\pi\left(\frac{n^{2}}{2M}-\frac{n}{2}+\frac{m^{2}}{2 M}-\frac{m}{2}+\frac{nm}{M}\right)\right]=x_{0}[n]x_{0}[m]\exp\left[j2\pi \left(\frac{nm}{M}\right)\right].\]  
Furthermore, in order to maintain the phase continuity between subsequent chirps, each modulated chirp waveform obtained from (3) is multiplied by the complex conjugate of its first sample, \(x_{m}^{*}[0]\). This causes the instantaneous phase of the chirp to be zero at both the beginning and end of the symbol duration, rather than causing sharp phase discontinuities between consecutive modulated chirps [3,6]. Performing phase correction changes the modulated chirp waveform expression given by (3) to that of (4).  
\[\hat{x}_{m}[n]=x_{m}[n]x_{m}^{*}[0]=\exp\left[j2\pi\left(\frac{n^{2}}{2M}- \frac{n}{2}+\frac{nm}{M}\right)\right]=x_{0}[n]\exp\left[j2\pi\left(\frac{nm}{ M}\right)\right]. \tag{4}\]  
While performing the complex multiplication will not affect the number of samples required for chirp generation, it will drastically affect the number of unique filter inputs. However, as in the case of basic chirp samples, it turns out that many phase-corrected sample values are shared among multiple \(SF\) settings, as well as modulated chirp waveforms associated with other symbols.  
In terms of implementation, the real and imaginary components are considered separately as they correspond to the I and Q channels in a practical system. However, since the magnitude of \(x_{0}[n]\) at each sample index is always equal to 1, the sequence of sample values for the I and Q channels are subject to the same patterns. Therefore, the properties discussed in this paper that are used to simplify the chirp generation shall apply to both the real and imaginary samples of \(x_{0}[n]\). Both components also contain the same sample values, albeit the signs and sample indices may differ.  
With that in mind, the following subsections detail the proposed methods and the resulting sample reduction compared to a standard LoRa device. It is also important to note that while basic  
Figure 2: Example of discrete-time and continuous-time basic chirp waveforms with \(SF=6\) and \(BW=125\,\mathrm{kHz}\).  
chirp samples obtained from (2) are used for chirp generation, the LUT must account for each possible phase-corrected modulated chirp sample obtained from (4).