Skip to content

Commit 1e30c9a

Browse files
authored
Deprecate only multi-arg nextfastfft (#580)
1 parent 817c53f commit 1e30c9a

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

src/deprecated.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# deprecations in 0.8
2+
import .Util.nextfastfft
3+
@deprecate nextfastfft(ns...) nextfastfft.(ns) false
4+
15
# deprecations after 0.6
26
@deprecate freqz(filter::FilterCoefficients{:z}) freqresp(filter, range(0, stop=π, length=250))
37
@deprecate freqz(filter::FilterCoefficients{:z}, w) freqresp(filter, w)

src/util.jl

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,32 @@ fftabs2type(::Type{T}) where {T<:Union{Real,Complex}} = Float64
107107
const FAST_FFT_SIZES = (2, 3, 5, 7)
108108

109109
"""
110-
nextfastfft(n)
110+
nextfastfft(n::Integer)
111+
nextfastfft(ns::Tuple)
111112
112-
Return the closest product of 2, 3, 5, and 7 greater than or equal
113-
to `n`. FFTW contains optimized kernels for these sizes and
114-
computes Fourier transforms of input that is a product of these
115-
sizes faster than for input of other sizes.
113+
Return an estimate for the padded size of an array that
114+
is optimal for the performance of an n-dimensional FFT.
115+
116+
For `Tuple` inputs, this returns a `Tuple` that is the size
117+
of the padded array.
118+
119+
For `Integer` inputs, this returns the closest product of 2, 3, 5, and 7
120+
greater than or equal to `n`.
121+
FFTW contains optimized kernels for these sizes and computes
122+
Fourier transforms of inputs that are a product of these
123+
sizes faster than for inputs of other sizes.
124+
125+
!!! warning
126+
127+
Currently, `nextfastfft(ns::Tuple)` is implemented as
128+
`nextfastfft.(ns)`. This may change in future releases if
129+
a better estimation model is found.
130+
131+
It is recommended to use `nextfastfft.(ns)` to obtain
132+
a tuple of padded lengths for 1D FFTs.
116133
"""
117-
nextfastfft(n) = nextprod(FAST_FFT_SIZES, n)
118-
nextfastfft(ns::Tuple) = nextfastfft.(ns)
119-
nextfastfft(ns...) = nextfastfft(ns)
134+
nextfastfft(n::Integer) = nextprod(FAST_FFT_SIZES, n)
135+
nextfastfft(ns::Tuple{Vararg{Integer}}) = nextfastfft.(ns)
120136

121137

122138
## COMMON DSP TOOLS

0 commit comments

Comments
 (0)