# Reducing the Cost of Implementing Filters in LoRa Devices
## 2 Sample Reduction Methods
### Chirp Waveform Segmentation  
It is perhaps more intuitive to begin by examining the inherent symmetry in the sequence of \(M=2^{SF}\) basic chirp samples that make up the waveform. For instance, consider the basic chirp waveform shown in Figure 2 once again. Both components appear to exhibit a symmetry about the midpoint located at \(n=\frac{M}{2}\), which is \(n=32\) in this case. While it may not be obvious from Figure 2, there are several other patterns present in the sequence of chirp sample values as well. A close inspection reveals that a basic chirp waveform can be divided into four segments, each containing \(\frac{M}{4}\) samples according to (5) and (6), where \(k\) is an integer representing the segment number. More importantly, each of these segments contains identical sample values, but they differ with predictable patterns of opposing signs and/or sample order. \[x_{0,k}[n]=x_{0}\left[n+\frac{(k-1)M}{4}\right], n=0,1,\ldots,\frac{M}{4}-1;\;k=\{1,2,3,4\} \tag{5}\] \[x_{0}[n]=\left\{ \begin{array}{ll}x_{0,1}[n],&0\leq n\leq\frac{ M}{4}-1\\ x_{0,2}[n],&\frac{M}{4}\leq n\leq\frac{M}{2}-1\\ x_{0,3}[n],&\frac{M}{2}\leq n\leq\frac{3M}{4}-1\\ x_{0,4}[n],&\frac{3M}{4}\leq n\leq M-1\end{array} \right. \tag{6}\]  
Using (5) with (2) gives the exponential form of \(x_{0,k}[n]\) shown in (7). Substituting each value of \(k\) into (7) gives the individual waveform segment expressions shown in (8). \[x_{0,k}[n]=\exp\left[j2\pi\left(\frac{n^{2}}{2M}-\frac{n}{2}+ \frac{(k-1)n}{4}\right)\right]=x_{0}[n]\exp\left[j\pi\left(\frac{(k-1)n}{2} \right)\right] \tag{7}\] \[x_{0,k}[n]=\left\{ \begin{array}{ll}\exp\left[j2\pi\left(\frac{ n^{2}}{2M}-\frac{n}{2}\right)\right],&k=1\\ \exp\left[j2\pi\left(\frac{n^{2}}{2M}-\frac{n}{2}\right)\right]\exp\left(j\pi \frac{n}{2}\right),&k=2\\ \exp\left[j2\pi\left(\frac{n^{2}}{2M}-\frac{n}{2}\right)\right]\exp(j\pi n),&k =3\\ \exp\left[j2\pi\left(\frac{n^{2}}{2M}-\frac{n}{2}\right)\right]\exp\left(j\pi \frac{3n}{2}\right),&k=4\end{array} \right.. \tag{8}\]  
As an example, consider the basic chirp sample values of \(x_{0,k}[n]\) by segments for \(SF=6\) shown in Table 1. It is important to note that while the analysis below refers to this specific set of data, the following relationships between segments hold for all \(SF\) settings. The first segment, \(x_{0,1}[n]\), can be manipulated in order to obtain the remaining three segments with relatively simple operations. First, consider segments 1 and 3. It is obvious from Table 1 that every odd sample of \(x_{0,3}[n]\) has the opposite sign of \(x_{0,1}[n]\) at the same sample index value, \(n\). This relationship can be obtained mathematically by comparing the expressions for \(k=1\) and \(k=3\) in (8) as shown below. \[x_{0,3}[n]=\exp\left[j2\pi\left(\frac{n^{2}}{2M}-\frac{n}{2}\right)\right] \exp\left(j\pi n\right)=x_{0,1}[n]\exp\left(j\pi n\right).\]  
Next, consider the relationship between segments 1 and 4. It is simple to see that \(x_{0,4}[n]\) is a reverse indexed copy of \(x_{0,1}[n]\). This can be proven by first finding \(x_{0,1}\left[\frac{M}{4}-n\right]\) as shown below, and then comparing the resulting expression to that of \(x_{0,4}[n]\). \[x_{0,1}\left[\frac{M}{4}-n\right] =\exp\left[j2\pi\left(\frac{\left(\frac{M}{4}-n\right)^{2}}{2M}- \frac{\frac{M}{4}-n}{2}\right)\right]=\exp\left[j2\pi\left(\frac{n^{2}}{2M}- \frac{n}{4}+\frac{n}{2}-\frac{3M}{16}\right)\right]\] \[=\exp\left[j2\pi\left(\frac{n^{2}}{2M}-\frac{n}{2}\right)\right] \exp\left(j\pi\frac{3n}{2}\right)\underbrace{\exp\left(-j\pi\frac{3M}{8} \right)}_{=1\text{ for all }M}\] \[=x_{0,1}[n]\exp\left(j\pi\frac{3n}{2}\right)=x_{0,4}[n].\]  
Lastly, \(x_{0,2}[n]\) is a reverse indexed copy of \(x_{0,1}[n]\) with opposing signs at every odd value of \(n\). This is confirmed by the following comparison between the expressions for \(x_{0,1}\left[\frac{M}{4}-n\right]\) and \(x_{0,2}[n]\).