# Reducing the Cost of Implementing Filters in LoRa Devices
## 2 Sample Reduction Methods
### Chirp Waveform Segmentation
\[x_{0,1}\left[\frac{M}{4}-n\right]=x_{0,1}[n]\exp\left(j\pi\frac{3n}{2}\right)=x _{0,1}[n]\exp\left(j\pi\frac{n}{2}\right)\exp\left(j\pi n\right)=x_{0,2}[n]\exp \left(j\pi n\right).\]  
In summary, \(x_{0,2}[n]\), \(x_{0,3}[n]\), and \(x_{0,4}[n]\) can be found from \(x_{0,1}[n]\) using (9)-(11), respectively. These relationships can be used to generate the \(M\) basic chirp waveform samples from only the first  
\begin{table}
\begin{tabular}{c c c|c c c|c c|c c|c c} \hline \hline  & \(x_{0,1}[n]=x_{0}[n]\) & & \multicolumn{3}{c|}{\(x_{0,2}[n]=x_{0}[n+16]\)} & \multicolumn{3}{c|}{\(x_{0,3}[n]=x_{0}[n+32]\)} & \multicolumn{3}{c}{\(x_{0,4}[n]=x_{0}[n+48]\)} \\ \hline \(n\) & **Real** & **Imag. ** & \(n\) & **Real** & **Imag. ** & \(n\) & **Real** & **Imag. ** & \(n\) & **Real** & **Imag. ** \\ \hline
0 & 1 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 1 & 0 \\
1 & \(-0.9988\) & \(-0.0491\) & 1 & 0.0491 & \(-0.9988\) & 1 & 0.9988 & 0.0491 & 1 & \(-0.0491\) & 0.9988 \\
2 & 0.9808 & 0.1951 & 2 & \(-0.98  
samples in \(x_{0,1}[n]\). As a result, the number of samples stored in the ROM can be reduced from a total of \(2M\) to \(\frac{M}{2}\) real and imaginary samples without introducing any error. \[x_{0,2}[n] = \begin{cases}-x_{0,1}\left[\frac{M}{4}-n\right],\text{ for $n$ odd}\\ \quad\quad x_{0,1}\left[\frac{M}{4}-n\right],\text{ otherwise}\end{cases}  \tag{9}\] \[x_{0,3}[n] = \begin{cases}-x_{0,1}[n],&\text{ for $n$ odd}\\ \quad\quad x_{0,1}[n],&\text{ otherwise}\end{cases} \] (10) \[x_{0,4}[n] =x_{0,1}\left[\frac{M}{4}-n\right]. \tag{11}\]  
In order to quantify the impact of chirp segmentation on the complexity of a practical system, the actual number of real and imaginary samples contained in the ROM and LUT must be considered. Let \(N_{\text{gen}}\) represent the number of samples required for chirp generation, while \(N_{\text{in}}\) represents the number of unique samples at the input of the pulse shaping filter. The calculated values of \(N_{\text{gen}}\) and \(N_{\text{in}}\) are shown in Table 2 for a LoRa system using the chirp segmentation method. It should be pointed out that \"all\" means the support of spreading factors ranging from 6 to 12 in the scope of the study. Here, \(N_{\text{gen}}\) is calculated as \(\frac{M}{2}\), while \(N_{\text{in}}\) is found by counting the number of unique sample values given by (4) for each possible symbol value. Furthermore, \(N_{\text{in}}\) is counted based on the absolute (unsigned) value of each sample value. This is because the sign of the input samples to the filter can be easily detected and the sign of the corresponding LUT output can be corrected accordingly (by taking the two's complement), if necessary. The number of samples required in the filter LUT depends on both the number of filter coefficients (\(N_{\text{fit}}\)) and \(N_{\text{in}}\). The output values of the LUT are found by multiplying each filter coefficient by each unsigned filter input value. Since the filter coefficients are symmetric about the midpoint of the filter, the number of stored multiplications can be reduced to just over half the number of filter coefficients instead. As a result, the total number of samples that must be stored in the transmitter for each spreading factor can be found using (12). It should be noted that the filter input value of zero included in \(N_{\text{in}}\) can be disregarded since the output of the coefficient multiplication(s) will simply be zero as well. \[N_{\text{TX}}=\frac{N_{\text{fit}}+1}{2}(N_{\text{in}}-1)+N_{\text{gen}}. \tag{12}\]  
As an example, Table 3 displays the total numbers of samples required for three different systems calculated with (12). This example considers a standard LoRa device that does not use chirp segmentation or a multiplier-less filter (\(N_{\text{fit}}=0\)), and two devices using chirp segmentation with length-17 and 81 multiplier-less SRRC filters, respectively. The filter lengths were selected based on their ability to reduce the occupied bandwidth of LoRa signals for different \(BW\) settings [8].