## 3 Comparison among Different AC Signal Analysis Methods
### Memory Usage  
This paragraph discusses the memory allocation required by each algorithm. The results reflect the expected approximate memory allocation within a generic floating-point-enabled processor, including stack memory usage. Table 3 shows an overview of the memory required by each algorithm without the input signal. Here \(N\) defines the number of samples and \(N_{f}\) the number of frequency components. The uncertainty comes from the values from the practical Visual C++ and STM32 CubeIDE application. \begin{table}
\begin{tabular}{c c c} \hline \hline \multirow{2}{*}{**Method**} & \multicolumn{2}{c}{**Possible Parallelism Method**} \\ \cline{2-3}  & **Data-Level** & **Instruction-Level** \\ \hline FFT (Radix-2/4/8) & x & x \\ Goertzel & x & x \\ Cross-Correlation & x & x \\ Sine-fit & x & \\ DTFT & x & x \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Efficient Hardware Acceleration Methods for AC signal analysis Methods Treated in this paper. FFT can be performed in-place or out-of-place. In the case of in-place FFT, a complex format of the signal on which the FFT is performed is required and therefore additional \(N\) cases is required, as signals mostly real. For the out-of-place FFT algorithms, \(2N\) cases are necessary to compute the values of the single-sided spectrum analysis. During the calculation in the in-place or out-of-place implementation, several cases are required for storing intermediate results, DFT twiddles/coefficients, and for bit reversing. Those cases may be around 14 to 50 cases depending on the chosen radix and the implementation method. The Goertzel filter requires 3 cases per frequency component to store the results, in addition to 2 more cases per frequency component for the coefficients, which could be replaced by 2 local memory cases. At the end of the processing, 2 more cases are needed to calculate the DFT values per frequency component. The memory requirement of cross-correlation is dependent on the reference signal and the output size. If half of the output is desired and the reference signal is the same length as the input signal, the total required memory to store the results is \(NN_{f}\). To store the position of the absolute value as well as its index, at least 2 additional cases per frequency component are necessary. For each frequency component, an additional memory case or a lookup table of \(N\) is needed. For the loop iterators, 3 more cases are needed. Typically, Standard and SIMD Cross-correlation require \(2N\) to store the data, in addition to optional \(2N\) cases to calculate absolute values. The largest absolute value and its index require \(2N_{f}\) cases. \(3N\) buffer cases may be required to store intermediate results needed to construct the reference signal per each frequency component and to square the signal to prepare for energy calculation. The latter also requires one more case for the sum. Iterators require two further cases. Sine fitting requires the assignment of many matrices during the calculation. For linear least-squares sine fitting, 2 matrices \(2N_{f}\times N\), 1 matrix \(N\times 2N_{f}\) and 2 matrices \(2N_{f}\times 2N_{f}\) are required, in addition of the variable vector \(2N_{f}\). For the matrix inversion, \(4N_{f}^{2}+8\) more cases are required. The non-linear sine-fit adds to the requirements needed in sine-fitting a vector containing the currently estimated signal with \(N\) elements, and the residual vector \(2N_{f}\). \(2N\) intermediate memory cases may be required to store signal after each iteration. At least 2 more cases for loop iterators are needed in addition. DTFT requires 2 memory cases per frequency component to store the result. A \(2 NN_{f}\) lookup table is required for the DTFT coefficients, which could be replaced by 2 local memory cases. Eventually, 2 more cases are required to calculate the final single-sided spectrum amplitude values.