ATSFFT: A Novel Sparse Fast Fourier Transform Enabled With Sparsity Detection
Sheng Shi, Runkai Yang, Haihang You

TL;DR
This paper introduces ATSFFT, an adaptive sparse Fourier transform algorithm that detects signal sparsity dynamically, outperforming existing methods and FFT libraries in efficiency and error control.
Contribution
The paper presents ATSFFT, a novel sparse FFT algorithm with sparsity detection and adaptive tuning, enhancing reliability and performance over previous SFFT implementations.
Findings
ATSFFT outperforms traditional SFFT in efficiency and error control.
ATSFFT achieves an order of magnitude faster performance than FFTW.
The method reliably detects sparsity without prior knowledge.
Abstract
The Fast Fourier Transform(FFT) is a classic signal processing algorithm that is utilized in a wide range of applications. For image processing, FFT computes on every pixel's value of an image, regardless of their properties in frequency domain. The Sparse Fast Fourier Transform (SFFT) is an innovative algorithm for discrete Fourier transforms on signals that possess characteristics of the sparsity in frequency domain. A reference implementation of the algorithm has been proven to be efficient than modern FFT library in cases of sufficient sparsity. However, the SFFT implementation has a critical drawback that it only works reliably for very specific input parameters, especially signal sparsity , which hinders the extensive application of SFFT. In this paper, we propose an Adaptive Tuning Sparse Fast Fourier Transform (ATSFFT), which is a novel sparse fast fourier transform enabled…
| speedup \bigstrut | ||||||
|---|---|---|---|---|---|---|
| N | \bigstrut | |||||
| ATSFFT/SFFT | \bigstrut | |||||
| SFFT/FFTW | \bigstrut | |||||
| speedup \bigstrut | ||||||
| N | \bigstrut | |||||
| ATSFFT/SFFT | \bigstrut | |||||
| SFFT/FFTW | \bigstrut | |||||
| Speedup \bigstrut | |||||||
|---|---|---|---|---|---|---|---|
| \bigstrut | |||||||
| ATSFFT/SFFT | \bigstrut | ||||||
| SFFT/FFTW | \bigstrut | ||||||
| Speedup \bigstrut | |||||||
| \bigstrut | |||||||
| ATSFFT/SFFT | \bigstrut | ||||||
| SFFT/FFTW | \bigstrut | ||||||
| Error \bigstrut | ||||||
|---|---|---|---|---|---|---|
| N | \bigstrut | |||||
| ATSFFT | \bigstrut | |||||
| SFFT | \bigstrut | |||||
| Error \bigstrut | ||||||
| N | \bigstrut | |||||
| ATSFFT | \bigstrut | |||||
| SFFT | \bigstrut | |||||
| Error \bigstrut | |||||||
|---|---|---|---|---|---|---|---|
| N | \bigstrut | ||||||
| ATSFFT | \bigstrut | ||||||
| SFFT | \bigstrut | ||||||
| Error \bigstrut | |||||||
| N | \bigstrut | ||||||
| ATSFFT | \bigstrut | ||||||
| SFFT | \bigstrut | ||||||
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsImage and Signal Denoising Methods · Optical Coherence Tomography Applications · Advanced Fiber Optic Sensors
ATSFFT: A Novel Sparse Fast Fourier Transform Enabled With Sparsity Detection
Sheng Shi, Runkai Yang, Xinfeng Zhang and Haihang You S. Shi, R. Yang and H. You are with Institute of Computing Technology, Chinese Academy of Sciences, Beijing, 100190, e-mail:(shisheng, yangrunkai, youhaihang)@ict.ac.cnX. Zhang is with University of Chinese Academy of Sciences, Beijing, 100049, e-mail: [email protected]
Abstract
The Fast Fourier Transform(FFT) is a classic signal processing algorithm that is utilized in a wide range of applications. For image processing, FFT computes on every pixel’s value of an image, regardless of their properties in frequency domain. The Sparse Fast Fourier Transform (SFFT) is an innovative algorithm for discrete Fourier transforms on signals that possess characteristics of the sparsity in frequency domain. A reference implementation of the algorithm has been proven to be efficient than modern FFT library in cases of sufficient sparsity. However, the SFFT implementation has a critical drawback that it only works reliably for very specific input parameters, especially signal sparsity , which hinders the extensive application of SFFT. In this paper, we propose an Adaptive Tuning Sparse Fast Fourier Transform (ATSFFT), which is a novel sparse fast fourier transform enabled with sparsity detection. In the case of unknown sparsity , ATSFFT is capable of probing the sparsity via adaptive dynamic tuning and completing the sparse Fourier transform. Experimental results show that ATSFFT outperforms SFFT while it is able to control the computation error better than SFFT. Furthermore, ATSFFT achieves an order of magnitude of performance improvement than the state-of-the-art FFT library, FFTW.
Index Terms:
Sparse Fast Fourier Transform (SFFT), Sparsity, Adaptive tuning, FFTW.
I Introduction
Nowadays, the development of information technology has reached unprecedent level. The fast growing computing power stimulate emerging technologies that promote the development of human society. Magnetic Resonance Imaging (MRI)[1], Light Field Photography [2], Radio Astronomy [3] and etc. are the applications of image processing that have wide impact on health care, technology and science. There is tremendous demand of high efficient signal processing techniques for drasticlly increasing amount of images to process. The discrete Fourier transform (DFT) is one of the most fundamental and important numerical algorithms which plays the central role in signal processing[4][5], communications, and audio/image/video compression [6]. The Fast Fourier Transform (FFT) [7] that computes the DFT of an -size signal in time greatly simplifies the complexity of the DFT and boosts the performance substantially, thus is utilized by a broad range of applications.
The general algorithms for computing the exact DFT necessitate the time that is at least proportional to its size . However, it is well known that most image signals posses sparsity in frequency domain. That is, the image signals have naturally sparse representations with respect to fixed Fourier basis. This property has been widely used in various applications including High Efficiency Video Coding (HEVC)[8][9][10][11], compressed sensing [12][13][14] and radio astronomy[reference]. Therefore, for sparse image signals, the lower bound of the DFT complexity no longer applies. It is crucial to study the new strategy of the Fourier transform based on image sparsity. In 2012, Hassanieh et al proposed one-dimensional sparse fast Fourier transform [15] [16] which is faster than traditional FFT, needless to say, the algorithm demonstrates a promising approach.
However, the SFFT implementation has the drawback that it only works reliably for very specific input parameters, especially signal sparsity . This drawback hinders the extensive applications of SFFT. In addition, two-dimensional sparse Fourier transform can not simply be implemented by utilizing two separate one-dimensional Sparse Fourier transform. Since two-dimensional transform for image signals are more widely used in practival applications, we propose a new two-dimensional Fourier transform that takes advantage of images sparsity(2D-SFFT) [17][18]. Furthermore, we propose an Adaptive Tuning Sparse Fast Fourier Transform (ATSFFT) to improve the accuracy and robustness of SFFT. With adaptive tuning, ATSFFT is able to probe the sparsity automatically and obtain the Fourier coefficients of signals. Experimental results show that ATSFFT not only can control the error better than SFFT, it could outperform SFFT with an order of magnitude of speedup in some cases.
The remainder of this paper is organized as follows. Section II presents details of the proposed algorithm of two-dimensional Sparse Fourier Transform (SFFT). Section III describes the Adaptive Tuning Sparse Fast Fourier Transform (ATSFFT) algorithm. Experimental results are shown in Section IV, and at last we conclude the paper in Section II-B.
II Two-dimensional Sparse Fast Fourier Transform
First, we lay out several conventions and notations that are used in this paper. A space-domain image is represented as a tow-dimensional matrix , the Fourier spectrum of the image is represented as . We assume that is a power of 2, the notation is defined as the set , and denotes the grid . The image support is denoted by . All matrix indices are the calculated modulo of the matrix size, e.g. of image is actually . A set of matrix elements can be written as a matrix subscripted with a set of indices, for example . In addition, we assume that is a power of 2, and can be divisible by .
We define to be a primitive -th root of unity. In the following sections, we will use the following definition of the 2D-DFT without the constant scaling factor:
[TABLE]
This makes some of the proof easier, but it is not considered relevant in practical implementations.
II-A Hash Function
The 2D-SFFT algorithm firstly constructs and utilizes a hash function to extract useful information of an image. The hash function consists of random spectrum permutation, filtering and subsampling in frequency domain.
II-A1 Random Spectrum Permutation
Normally, we do not have access to the input images’ Fourier spectrum since it would involve performing DFT. The spectrum permutation is the primary component of the 2D-SFFT, which is defined in Definition 1. It aims to tear apart the nearby coefficients to reorder the image’s frequency-domain :
Definition 1
Let and be invertible modulo , i.e. , , and , . Then, and are permutations on . The associated permutation on a matrix x is then given by
[TABLE]
When a permutation is applied to an image in space domain, the image’s frequency domain is also permuted. This interesting property is derived in Lemma 1.
Lemma 1
Let be a permutation and be an two-dimensional vector. Then
[TABLE]
For ,
[TABLE]
with ,
[TABLE]
The Lemma follows by substituting , . Note that changes the phase, but does not change the magnitude of .
The permutation in the 2D-SFFT algorithm allows to permute the image’s Fourier spectrum by modifying the image’s space-domain .
II-A2 Window Function
In order to achieve substantial performance improvement, the 2D-SFFT only uses partial input image for computation. The standard window function acts like a filter, it supplies the sparse Fourier transform algorithm with a subset of the Fourier coefficients. Ideally, however, we would like the pass region of the filter to be as flat as possible to avoid spectral leakage. Specifically, two-dimensional flat Guassian window functions are used in 2D-SFFT.
The two-dimensional flat Guassian window function can be obtained from a 2D Gaussian standard window function which is shown in Figure 1 by convolving it with a two-dimensional ”box car” window function which can be presented as:
[TABLE]
where .
The 2D Gaussian window function is defined as
[TABLE]
By applying convolution of (8) and (9), we have the 2D Gaussian flat window function . Figure 2 shows the function in time domain and frequency domain.
Using 2D Gaussian flat window function , part of size can be extracted out from by multiplying with and neglecting the coefficients with value of zero. According to the convolution theorem, the multiplication is equivalent to a convolution of and . The filtering process can expand the area of non-zero coefficients. This step is to prepare for the subsequent sub-sampling and reverse steps, and further increase the probability of detection of non-zero coefficients.
II-A3 Fast Subsampling and DFT
Lemma 2
Let divide , be an two-dimensional matrix and be a two-dimensional matrix with for , . Then,
Lemma 2 effectively reduces dimension by subsampling image in time domain and summing up the result. Since image is sparse in frequency domain, dimension reduction can reduce the complexity of position searching and amplitudes of non-zero elements.
An example of an image in frequency domain with sparsity is show in Figure 3(a). The process of random spectrum permutation, filtering and subsampling are shown in Figure 3. Permutation can separate nearby coefficients so that the non-zero coefficients can be approximately uniform distributed. Filtering process can expand the area of non-zero coefficients to increase the detection probability. Subsampling effectively reduces complexity.
Random spectrum permutation, filtering and subsampling define the hash function
[TABLE]
Hash function maps each of the coordinates of the input image to one of bins.
II-B Two-dimensional Sparse Fourier Transform Algorithm
The 2D-SFFT consists multiple executions of two kinds of operations: seek location and estimate coefficient. The seek location operation is to generate a list of candidate coordinates which have certain probability of being indices of non-zero coefficients in frequency domain. While the estimate coefficient operation is used to exactly determine the frequency coefficients. The implementation of the estimate coefficient also uses hash function. Given a set of coordinates , can be estimated by
[TABLE]
which basically removes the phase change due to the permutation and the filtering.
A simplified workflow diagram of 2D-SFFT is shown in Figure 5. After running multiple iterations of the seek location operation we only keep coordinates emerge in at least half of the seek location loops. For the coordinates , the median of the corresponding outputs of the rounds of the estimate coefficient operation is set to be the frequency coefficient.
III Adaptive Tuning Sparse Fast Fourier Transform
The drawback of the SFFT algorithm is that it only works reliably with prior knowledge of signal sparsity . This drawback prevent it to be utilized by the wide range of applications. Although it is well known that most signals possess the characteristics of sparsity, it is almost impossible to foreknow the sparsity of the signals. Therefore, we propose a innovative Adaptive Tuning Sparse Fast Fourier Transform (ATSFFT) algorithm. By adaptive dynamic tuning, the ATSFFT can predict the sparsity and execute the Fourier transform. Experimental results show that the ATSFFT outperforms the SFFT, it also can have a better control of the error.
III-A Adaptive Tuning Iteration
The basic idea behind hash function is to hash the coefficients of the input image into a small number of bins. In SFFT, is determined by , which is set to . From these bins, SFFT selects and only keeps coordinates of top points with the largest magnitudes. The actual locations of the Fourier coefficients in the frequency domain are approximated based on these coordinates. We find that after the execution of the hash function, the number of local maximum points is the same with the number of original image’s non-zero coefficients in frequency domain. Specifically, the hash function hashes points of the image shown in Figure 3(a) into bins. The number of local maximum points is which is the same with the image sparsity(). Therefore, by finding the local maximum points, we can avoid prior knowledge sparsity .
ATSFFT initially sets a small value to and . After hashing, we can get by counting the number of local maximum values in matrix. Next, can be updated by analyzing the relationship between and . For the convenience of description, the change ratio factor of is defined as follows,
[TABLE]
The iterative process is shown as follows
[TABLE]
where and . When approaches within a very small range of , we consider adapts to the full scatter point set where non-zero elements can adequately distributed, so need to be decreased to find the better size. When approaches within a appropriate range between and , we consider adapts to the appropriate scatter point set. If we further reduce the size of , it will lead to large area overlap. Therefore, is kept the same with . When fluctuates within a large range of , we consider is too small to lead large area overlap, so we need to continue to increase the value of . Since is a power of 2, and can be divisible by . ATSFFT sets , , , .
[TABLE]
III-B Adaptive Tuning Sparse Fast Fourier Transform Algorithm
A simplified workflow diagram of ATSFFT is shown in Figure 6. Similar to the SFFT, ATSFFT consists two kinds of operations: seek location and estimate coefficient. In the operation of seek location, by running multiple adaptive tuning iterations, it is able to identify the sparsity and locate candidate coordinates with a high probability of being one of the non-zero coordinates. Given the set of candidate coordinates , the ATSFFT can use coefficient estimation to precisely determine the frequency coefficients, which basically remove the phase change due to the permutation and the effect of the filtering.
IV Numerical Experiments
In this section, we present numerical experimental results that compare runtime, speedup and error of ATSFFT, SFFT and FFTW, which is a FFT algorithms implementation known to be one of the fastest FFT libraries [19]. For the experiments, frequencies are randomly selected and assigned with magnitude of 1, the rest frequencies are set to 0. Each data point in the result graphs is the average over 100 runs with different images. All experiments were carried out on the system that is equiped with 8 Intel Xeon E7-8830 2.13GHz CPU total of 64 cores and 1TB memory.
IV-A Runtime
IV-A1 Runtime vs. Signal Size
The sparsity parameter is fixed to constant and , there are 6 different image matrix size from to . The average runtime are shown in Figure 7. We can see that SFFT runs faster than FFTW in most cases. However, ATSFFT outperforms its competitors by an order of magnitude. It is no surprise to see that the runtime of the three algorithms are approximately linear in the log scale with respect to problem size. Furthermore, the runtime of ATSFFT grows with the smallest slope than the others as the problem size increases.
In Figure 7(a), it shows that SFFT is faster than FFTW while recovering the exact 50 non-zero coefficients for bigger problem size, and is the breaking dimension size. When signal size is less than, SFFT is slower than FFTW. ATSFFT is the fastest among the three algorithms for all cases. Similarly, Figure 7(b) shows that for signal dimension size SFFT is faster than FFTW while recovering the exact 100 non-zero coefficients. When signal size is less than , SFFT is slower than FFTW. Again, ATSFFT is the fastest for all cases. The results show that the ATSFFT significantly extends the range of applications of sparse FFT where sparse approximation is applicable.
IV-A2 Runtime vs. Number of Non-zero Frequency
The image matrix size is fixed to constant and and the runtime of the comparing algorithms for sparsity are shown in Figure 8. For each value of , the experiment is repeated 100 times. As the sparsity increases, ATSFFT and SFFT take more time to complete, while the runtime of FFTW which depends on image size but not sparsity is essentially constant.
Figure 8(a) shows that SFFT runs faster than FFTW when sparsity , and SFFT presents disadvantage when sparsity . While the runtime of ATSFFT for all cases keeps under 0.1 second, ATSFFT outperforms SFFT and FFTW. Similarly, Figure 8(b) shows SFFT is faster than FFTW when sparsity , and runs slower otherwise. ATSFFT appears to be the fastest where the runtimes for all cases are under 0.1 seconds as well. The above experimental results show that ATSFFT significantly extends the range of applications for which sparse approximation of SFFT is practical.
IV-B Speedup
An important question we would like to address is that, performance wise, how does ATSFFT compare with SFFT and FFT.
IV-B1 Speedup vs. Signal Size
Table I shows the speedup of ATSFFT to SFFT and SFFT to FFTW where the sparsity is set to be and . For sparsity , except that SFFT runs slower than FFTW for the case of , SSFT achieves more speedup when image size increases. However, ATSFFT achieves better performance across the board, and by average a magnitude of speedup than SFFT. For sparsity , similar observation is obtained. In conclusion, ATSFFT exhibits strong performance and stability over its peers.
IV-B2 Speedup vs. Number of Non-zero Frequency
In this section, we compare the performance with regard to different number of non-zero frequencies when the input image size is fixed. Table II shows the speedup of ATSFFT to SFFT and SFFT to FFTW for image matrix size of and . For both image sizes, we can see that SFFT performs the best when the sparsity is the smallest, and the speedup over FFTW reduces when the sparsity number increasing. However, ATSFFT could maintain performance superiority more consistently. For image size , when sparsity is 1000, ATSFFT is about 29 times faster than FFTW while SFFT runs slightly slower than FFTW. Again, the ATSFFT demonstrates robustness over sparsity variation.
IV-C Error
We compute the error metric per as the average error between the output sparse approximation and the fft of referred to as .
[TABLE]
IV-C1 Error vs. Signal Size
Tab. III shows the error of the compared algorithms ATSFFT and SFFT where the sparsity parameter is fixed to constant and and the image matrix size is from to . Smaller is better. For sparsity , the error of ATSFFT and SFFT decreased with the image size increasing. The error of ATSFFT is smaller than SFFT. Similar results appear in the experiments for sparsity . This shows the sparser the image signal, the smaller the error of ATSFFT and SFFT. Morever, the error of ATSFFT is smaller than SFFT, which indicate ATSFFT can control the error better than SFFT.
IV-C2 Error vs. Number of Non-zero Frequency
In this section, we compare the error with regard to different number of non-zero frequencies and different image size. Tab. IV shows the error of ATSFFT and SFFT increased with the image sparsity increasing. The error of ATSFFT is smaller than SFFT. We can draw the conclusion the sparser the image signal, the smaller the error of ATSFFT and SFFT. Morever, ATSFFT can control the error better than SFFT.
V Conclusion
The Sparse Fast Fourier Transform (SFFT) is a novel algorithm for discrete Fourier transforms on signals with the sparsity in frequency domain. However, the SFFT implementation has the drawback that it only works reliably for very specific input parameters, especially signal sparsity . This drawback hinders the extensive applications of SFFT. we propose an Adaptive Tuning Sparse Fast Fourier Transform (ATSFFT), which is a novel sparse fast fourier transform enabled with sparsity detection. In the case of unknown sparsity , ATSFFT can probe the sparsity via adaptive dynamic tuning technology and then complete the Fourier transform of signal. We present some numerical experiments comparing runtime, speedup and error of ATSFFT, SFFT and FFT in FFTW algorithms library. Experimental results show that ATSFFT not only can control the error better than SFFT, but also performs faster than SFFT, which computes more efficiently than the state-of-the-art FFTW.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] C.F.Beckmann and S.M.Smith, ”Probabilistic independent component analysis for functional magnetic resonance imaging,” IEEE Transactions on Medical Imaging, vol.23,no.2,pp.137-152,2004.
- 2[2] Shota Taki, Fumihiko Sakaue, and Jun Sato, ”High resolution light field photography from split ray imaging and coded aperture,” in VISAPP 2014-Proceedings of the 9th International Conference on Computer Vision Theory and Applications, Volume 2, Lisbon, Portugal, 5-8 January, 2014, pp.605-612.
- 3[3] Rik Jongerius, Strfan J. Wihnholds. Ronald Nijboer, and Henk Corporal, ”An end-to-end computing model for the square kilometre array,” IEEE Computer, vol. 47, no.9,pp.48-54, 2014.
- 4[4] Jon Atli Benediktsson, Martino Pesaresi, and Kolbeinn Amason, ”Classsfication and feature extraction for remote sensing images from urban areas based on morphological transformations,” IEEE Trans. Geoscience and Remote Sensing, vol. 41, no.9,pp.1940-1949, 2003.
- 5[5] S. Grace Chang, Bin Yu, and Martin Vetterli, ”Adaptive wavelet thresholding for image denoising and compression,” IEEE Trans. Image Processing, vol.0, no.9,pp.1532-1546, 2000.
- 6[6] X. Zhang, R. Xiong, W. Lin, S. Ma, J. Liu and W. Gao, ”Video Compression Artifact Reduction via Spatio-Temporal Multi-Hypothesis Prediction,” in IEEE Transactions on Image Processing, vol. 24, no. 12, pp. 6048-6061, Dec. 2015.
- 7[7] B. S. Reddy and B. N. Chatterji, ”An FFT-based technique for translation, rotation, and scale-invariant image registration,” in IEEE Transactions on Image Processing, vol. 5, no. 8, pp. 1266-1271, Aug 1996.
- 8[8] X. Zhang; R. Xiong; W. Lin; J. Zhang; S. Wang; S. Ma; W. Gao, ”Low-Rank based Nonlocal Adaptive Loop Filter for High Efficiency Video Compression,” in IEEE Transactions on Circuits and Systems for Video Technology , vol.27,no.10, pp.2177-2188, Oct. 2017.
