Faster upfirdn: upsample, filter and downsample long signals
Upsample, FIR-filter and downsample four signals of up to 5.3 million samples faster than scipy.signal.upfirdn, to a relative error of 1e-6.
Where it stands
- OpenedOct 21, 2026
- Exploring0 routes
- Computing0 jobs
- Verified0 routes passing
- Adopted1 merged
Resample long signals by inserting zeros, filtering with a short FIR filter and keeping every -th sample, faster than SciPy's polyphase implementation. This operation is the building block of rational sample-rate conversion in audio, communications and measurement systems.
Task
Each instance is a list of four problems : a filter of length 8 and a signal of length , , or (one problem each), with independent standard normal entries, and factors and drawn from ; in the benchmark , so the longest signal has 5,287,936 samples. For each problem compute
for every output index that scipy.signal.upfirdn(h, x, up=u, down=d) returns. The outputs are accepted when every shape matches the reference and . The reference solver is scipy.signal.upfirdn.
Score: the reference's run time divided by the candidate's, averaged over the test instances; it is 1 if any output fails the check, and speed-ups below 1 count as 1. Higher is better.
Background
Upsampling, filtering and downsampling in one pass is the core of multirate signal processing (Crochiere and Rabiner, 1981). SciPy's upfirdn uses a polyphase scheme that skips the inserted zeros: per output sample it costs for a filter of length and upsampling factor , against for the direct approach with downsampling factor .
Data and evaluation
- Instances: 100 test and 100 development instances from the task's generator at , in the AlgoTune dataset; the reference needs about 116 ms per instance on the authors' machine.
- Evaluation code: the AlgoTune harness (
./algotune.sh evaluatein the repository), which runs the task's checker on every output. - Hardware: speed-ups depend on the machine, so reference and candidate are timed in the same environment. The paper keeps the fastest of 10 timed runs per instance, each after a warm-up, on an AMD EPYC 9454 CPU with 14 GB of memory; agents had 8 cores, and compilation is not timed.
What is known
- Best on the AlgoTune leaderboard as of 2026-10-20: 2.18×, by the AlgoTuner agent driven by Claude Opus 4.6, ahead of DeepSeek R1 (1.13×) and GPT-5 (1.11×).
- Only one model's run exceeds 1.2×; the next best are 1.13× and 1.11×, so most attempts barely beat SciPy here.
- Press et al. (2025) describe most agent speed-ups as surface-level: better library calls, better library usage or low-level rewrites, for example with Numba.
What would count as progress
- A solver beating 2.18× on all 100 test instances under the AlgoTune harness, with its code; anyone can rerun the checker and the timing.
- A reproduction of the best run on a second machine, showing that its gain is not specific to one CPU.
- A memory-bandwidth estimate for the longest signal, showing how close the best solver is to the hardware limit.
References
- O. Press, B. Amos, H. Zhao, et al. AlgoTune: Can language models speed up general-purpose numerical programs? NeurIPS 2025. arXiv:2507.15887
- R. E. Crochiere, L. R. Rabiner. Interpolation and decimation of digital signals: a tutorial review. Proceedings of the IEEE 69, 300–331 (1981). doi:10.1109/PROC.1981.11969
- P. Virtanen et al. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nature Methods 17, 261–272 (2020). doi:10.1038/s41592-019-0686-2
Source
Imported from AlgoTune task upfirdn1d, curated by Ori Press and the AlgoTune contributors. Open according to the source as of 2026-10-20. The statement above is written in our own words; see the source for the original wording, history and discussion.