Computing the Fourier transform of a -ary function , which maps -ary sequences to real numbers, is an important problem in mathematics with wide-ranging applications in biology, signal processing, and machine learning. Previous studies have shown that, under the sparsity assumption, the Fourier transform can be computed efficiently using fast and sample-efficient algorithms. However, in most practical settings, the function is defined over a more general space -- the space of generalized -ary sequences -- where each corresponds to integers modulo . Herein, we develop GFast, a coding theoretic algorithm that computes the -sparse Fourier transform of with a sample complexity of , computational complexity of , and a failure probability that approaches zero as with for some . We show that a noise-robust version of GFast computes the transform with a sample complexity of and computational complexity of under the same high probability guarantees. Additionally, we demonstrate that GFast computes the sparse Fourier transform of generalized -ary functions faster using fewer samples on synthetic experiments, and enables explaining real-world heart disease diagnosis and protein fitness models using up to fewer samples compared to existing Fourier algorithms applied to the most efficient parameterization of the models as -ary functions.
View on arXiv@article{tsui2025_2501.12365, title={ Efficient Algorithm for Sparse Fourier Transform of Generalized $q$-ary Functions }, author={ Darin Tsui and Kunal Talreja and Amirali Aghazadeh }, journal={arXiv preprint arXiv:2501.12365}, year={ 2025 } }