fastfocal: accelerating moving-window raster operations through the Fast Fourier Transform in R

Moving-window (focal) operations are central to spatial statistics and image processing but become computationally prohibitive for large rasters or wide neighborhoods. fastfocal is an open-source R package that accelerates additive focal calculations (i.e., sum and mean) using the Fast Fourier Transform (FFT). The software preserves computational accuracy while substantially reducing runtime and energy use for large rasters and wide neighborhoods. Because FFT-based convolution is most advantageous for large kernels, fastfocal includes an adaptive “smart switch” that automatically selects between direct spatial-domain computation and FFT-based convolution depending on raster and kernel size, ensuring comparable performance for small neighborhoods and substantial gains for larger ones. Benchmark results indicate that performance gains begin to emerge for kernel radii of approximately 400–500 m (i.e., 13 to 17 cells in radius at 30 m resolution), with increasingly larger gains for wider neighborhoods and larger rasters. For large rasters and wide kernels, fastfocal reduced computation time by roughly 75% and energy consumption by ∼75% compared with widely used reference implementations. By enabling rapid, large-scale focal operations in standard R workflows, fastfocal makes multi-scale spatial analysis more practical and energy efficient.

Authors

Institutions

Publication Details

Journal
SoftwareX
Published
2026-03-13
DOI
https://doi.org/10.1016/j.softx.2026.102604
Primary Topic
Data Analysis with R
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

fastfocal: accelerating moving-window raster operations through the Fast Fourier Transform in R

Ho Yi Wan
SoftwareX
Data Analysis with R
article

fastfocal: accelerating moving-window raster operations through the Fast Fourier Transform in R

Ho Yi Wan
article en

Abstract

Moving-window (focal) operations are central to spatial statistics and image processing but become computationally prohibitive for large rasters or wide neighborhoods. fastfocal is an open-source R package that accelerates additive focal calculations (i.e., sum and mean) using the Fast Fourier Transform (FFT). The software preserves computational accuracy while substantially reducing runtime and energy use for large rasters and wide neighborhoods. Because FFT-based convolution is most advantageous for large kernels, fastfocal includes an adaptive “smart switch” that automatically selects between direct spatial-domain computation and FFT-based convolution depending on raster and kernel size, ensuring comparable performance for small neighborhoods and substantial gains for larger ones. Benchmark results indicate that performance gains begin to emerge for kernel radii of approximately 400–500 m (i.e., 13 to 17 cells in radius at 30 m resolution), with increasingly larger gains for wider neighborhoods and larger rasters. For large rasters and wide kernels, fastfocal reduced computation time by roughly 75% and energy consumption by ∼75% compared with widely used reference implementations. By enabling rapid, large-scale focal operations in standard R workflows, fastfocal makes multi-scale spatial analysis more practical and energy efficient.

SoftwareXVol. 34
Cal Poly Humboldt (US), University of Florida (US)
Affordable and clean energy
Openalex Percentile: Top 28%
Data Analysis with R
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.