Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate multi-arg and tuple nextfastfft #578

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/deprecated.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# deprecations after 0.6
# deprecations in 0.8
import .Util.nextfastfft
@deprecate nextfastfft(ns::Tuple) nextfastfft.(ns) false
@deprecate nextfastfft(ns...) nextfastfft.(ns) false

# deprecations in 0.7
@deprecate freqz(filter::FilterCoefficients{:z}) freqresp(filter, range(0, stop=π, length=250))
@deprecate freqz(filter::FilterCoefficients{:z}, w) freqresp(filter, w)
@deprecate freqs(filter::FilterCoefficients{:s}, w) freqresp(filter, w)
Expand Down
4 changes: 2 additions & 2 deletions src/dspbase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ function _conv_kern_fft!(out::AbstractArray{T, N},
u::AbstractArray{<:Real, N},
v::AbstractArray{<:Real, N}) where {T<:Real, N}
outsize = size(output_indices)
nffts = nextfastfft(outsize)
nffts = nextfastfft.(outsize)
padded = _zeropad!(similar(u, T, nffts), u)
p = plan_rfft(padded)
uf = p * padded
Expand All @@ -628,7 +628,7 @@ function _conv_kern_fft!(out::AbstractArray{T, N},
end
function _conv_kern_fft!(out::AbstractArray{T}, output_indices, u, v) where {T}
outsize = size(output_indices)
nffts = nextfastfft(outsize)
nffts = nextfastfft.(outsize)
upad = _zeropad!(similar(u, T, nffts), u)
vpad = _zeropad!(similar(v, T, nffts), v)
p! = plan_fft!(upad)
Expand Down
4 changes: 2 additions & 2 deletions src/periodograms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ end
# DTFT of the signal S if radialsum and radialavg are both false (default),
# a radial sum if radialsum=true, or a radial averave if radialavg=true
"""
periodogram(s::AbstractMatrix; nfft::NTuple{2,Int}=nextfastfft(size(s)), fs=1, radialsum=false, radialavg=false)
periodogram(s::AbstractMatrix; nfft::NTuple{2,Int}=nextfastfft.(size(s)), fs=1, radialsum=false, radialavg=false)

Computes periodogram of a 2-d signal using the 2-d FFT and returns a
[`Periodogram2`](@ref) or [`Periodogram`](@ref) object.
Expand Down Expand Up @@ -471,7 +471,7 @@ DSP.Periodograms.Periodogram{Float64, AbstractFFTs.Frequencies{Float64}, Vector{
```
"""
function periodogram(s::AbstractMatrix{T};
nfft::NTuple{2,Int}=nextfastfft(size(s)),
nfft::NTuple{2,Int}=nextfastfft.(size(s)),
fs::Real=1,
radialsum::Bool=false, radialavg::Bool=false) where T<:Real
size(s,1)<=nfft[1] && size(s,2)<=nfft[2] || throw(ArgumentError("nfft must be >= size(s)"))
Expand Down
3 changes: 0 additions & 3 deletions src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ computes Fourier transforms of input that is a product of these
sizes faster than for input of other sizes.
"""
nextfastfft(n) = nextprod(FAST_FFT_SIZES, n)
nextfastfft(ns::Tuple) = nextfastfft.(ns)
nextfastfft(ns...) = nextfastfft(ns)


## COMMON DSP TOOLS

Expand Down
2 changes: 0 additions & 2 deletions test/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ end
@test nextfastfft(64) == 64
@test nextfastfft(65) == 70
@test nextfastfft(127) == 128
@test nextfastfft((64,65,127)) == (64,70,128)
@test nextfastfft(64,65,127) == nextfastfft((64,65,127))
end

## COMMON DSP TOOLS
Expand Down
Loading