# Research on High-Performance Fourier Transform Algorithms Based on the NPU
## 4 Methods
### Energy Consumption Measurement Results and Discussion  
5.3.1 Energy Consumption Measurement Results  
In this section, we measured the energy consumption of our algorithms and implementations in two usage scenarios. Continuous test results  
In the continuous test, we measured energy consumption by continuously processing input images with varying data sizes using edge filters based on MM-2 DFT, MV-2 FFT, MV-2 FFTm, MV-2 FFTv, and FFT_CPU. The measurement results of energy consumption of the hardware platform during 1-h operation are shown in Table 2, and their change trend is shown in Figure 5. Like the processing in Table 1, we have bolded the notable outcomes for each set of inputs in Table 2.  
Figure 5 illustrates the trend of the total energy consumption of different algorithms as a function of the input matrix size when executed consecutively. According to the test results, those algorithms can be ranked by total power consumption in the following order from low to high: FFT_CPU, MV-2 FFTv, MM-2 DFT, and MV-2 FFTm. In detail, the FFT_CPU algorithm incurred a mild increase in the board's total power consumption as the input matrix size grew. In contrast, the board's total power consumption of other tested algorithms, especially MV-2 FFTm and MV-2 FFTv, increased significantly with the input data size. We defined the calculation method for the energy consumption of a single algorithm computation as Formula (6); the average energy consumption per execution (\(E\)) is calculated from hardware power consumption (\(E\)) and execution count (\(n\)) as follows:  
\[Ea=E/n \tag{6}\]  
Using Formula (6), we were able to calculate the energy consumption of each algorithm for a single execution based on the continuous running test results, as shown in Figure 6. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Input Matrix’s**} & \multicolumn{2}{c}{**MM-2 DFT**} & \multicolumn{2}{c}{**MV-2 FFTm**} & \multicolumn{2}{c}{**MV-2 FFTv**} & \multicolumn{2}{c}{**FFT\_CPU**} \\ \cline{2-9}  & \(E\) & \(n\) & \(E\) & \(n\) & \(E\) & \(n\) & \(E\) & \(n\) \\ \hline
64 & 13.1 wh & 1,785,504 & **13.2 wh** & 511,567 & 12.8 wh & 577,538 & **12.2 wh** & 1,556,041 \\
128 & 13.2 wh & 2,010,560 & **13.3 wh** & 478,662 & 12.8 wh & 544,520 & **12.3 wh** & 358,985 \\
256 & 13.4 wh & 1,171,872 & **13.4 wh** & 301,800 & 13.0 wh & 330,720 & **12.4 wh** & 81,002 \\
512 & 13.5 wh & 228,840 & **13.7 wh** & 123,473 & 13.3 wh & 147,448 & **12.4 wh** & 18,000 \\
1024 & 13.7 wh & 51,864 & **14.4 wh** & 38,041 & 14.0 wh & 42,144 & **12.4 wh** & 4206 \\
2048 & 14.0 wh & 7920 & **14.8 wh** & 7217 & 14.6 wh & 9336 & **12.5 wh** & 870 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Entire-board energy consumption during continuous test. Figure 5: Entire board of energy consumption. Different from Figure 5, Figure 6 shows the single execution energy consumption of those algorithms during the continuous execution test. The trend depicted by the broken lines in the chart indicates a substantial increase in energy consumption per execution of various algorithms as the input matrix size increased, but the growth rates varied significantly. The FFT_CPU algorithm had the highest growth rate in energy consumption with increasing input data size, which significantly exceeded that of other algorithms. Regarding the other algorithms, the MM-2 DFT algorithm had the highest energy efficiency for input sizes equal to or lower than 1024 \(\times\) 1024, followed closely by MV-2 FFv and MV-2 FFm algorithms. Once the input size reached 2048 \(\times\) 2048, the energy efficiency of the MM-2 DFT algorithm was surpassed by that of the MV-2 FFTv algorithm. 2. Fixed frame rate test results  
For the periodic running test, we invoked the image edge filter using input images of varying sizes. In this test, the processing period was set to 50 ms to simulate an input image stream with a frame rate of 20 fps.