diff --git a/Project.toml b/Project.toml index 61774cfe8..e78524886 100644 --- a/Project.toml +++ b/Project.toml @@ -4,7 +4,6 @@ version = "0.8.0" [deps] Bessels = "0e736298-9ec6-45e8-9647-e4fc86a2fe38" -Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" @@ -16,7 +15,6 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [compat] Bessels = "0.2" -Compat = "4.1" DelimitedFiles = "1.6" FFTW = "1.8" IterTools = "1.4" diff --git a/src/DSP.jl b/src/DSP.jl index 66e0f1b12..f8aa141bd 100644 --- a/src/DSP.jl +++ b/src/DSP.jl @@ -3,7 +3,6 @@ module DSP using FFTW using LinearAlgebra: mul!, rmul! using IterTools: subsets -using Compat: Compat export conv, deconv, filt, filt!, xcorr diff --git a/src/Filters/Filters.jl b/src/Filters/Filters.jl index ca9a1ec3a..96b295ff9 100644 --- a/src/Filters/Filters.jl +++ b/src/Filters/Filters.jl @@ -9,7 +9,6 @@ using Statistics: middle using SpecialFunctions: ellipk using ..DSP: optimalfftfiltlength, os_fft_complexity, SMALL_FILT_CUTOFF import ..DSP: filt, filt! -using Compat: Compat using FFTW include("coefficients.jl") diff --git a/src/Filters/design.jl b/src/Filters/design.jl index 40ebb04e4..69d06d415 100644 --- a/src/Filters/design.jl +++ b/src/Filters/design.jl @@ -14,7 +14,7 @@ function Butterworth(::Type{T}, n::Integer) where {T<:Real} poles = Vector{Complex{T}}(undef, n) for i = 1:n÷2 w = convert(T, 2i - 1) / 2n - sinpi_w, cospi_w = Compat.@inline sincospi(w) + sinpi_w, cospi_w = @inline sincospi(w) pole = complex(-sinpi_w, cospi_w) poles[2i-1] = pole poles[2i] = conj(pole) @@ -43,7 +43,7 @@ function chebyshev_poles(::Type{T}, n::Integer, ε::Real) where {T<:Real} c = cosh(μ) for i = 1:n÷2 w = convert(T, 2i - 1) / 2n - sinpi_w, cospi_w = Compat.@inline sincospi(w) + sinpi_w, cospi_w = @inline sincospi(w) pole = complex(b * sinpi_w, c * cospi_w) p[2i-1] = pole p[2i] = conj(pole) @@ -94,7 +94,7 @@ function Chebyshev2(::Type{T}, n::Integer, ripple::Real) where {T<:Real} k = one(T) for i = 1:n÷2 w = convert(T, 2i - 1) / 2n - ze = Compat.@inline complex(zero(T), -inv(cospi(w))) + ze = @inline complex(zero(T), -inv(cospi(w))) z[2i-1] = ze z[2i] = conj(ze) k *= abs2(p[2i]) / abs2(ze) @@ -140,8 +140,8 @@ function _ellip(init::Number, landen::Vector{<:Real}) end w = inv(winv) end -@inline cde(u::Number, landen::Vector{<:Real}) = Compat.@inline _ellip(cospi(u / 2), landen) -@inline sne(u::Number, landen::Vector{<:Real}) = Compat.@inline _ellip(sinpi(u / 2), landen) +@inline cde(u::Number, landen::Vector{<:Real}) = @inline _ellip(cospi(u / 2), landen) +@inline sne(u::Number, landen::Vector{<:Real}) = @inline _ellip(sinpi(u / 2), landen) # sne inverse function asne(w::Number, k::Real) diff --git a/src/Filters/response.jl b/src/Filters/response.jl index 5b0a38b04..5a335bcc7 100644 --- a/src/Filters/response.jl +++ b/src/Filters/response.jl @@ -160,7 +160,7 @@ function _freqrange(filter::FilterCoefficients{:s}) filter = convert(ZeroPoleGain, filter) w_interesting = sort!(Float64.(abs.([filter.p; filter.z]))) include_zero = !isempty(w_interesting) && iszero(w_interesting[1]) - w_interesting = collect(Compat.Iterators.dropwhile(iszero, w_interesting)) + w_interesting = collect(Iterators.dropwhile(iszero, w_interesting)) if isempty(w_interesting) # no non-zero poles or zeros if !include_zero || !isfinite(1/filter.k) return [0; 10 .^ (0:6)] # fallback diff --git a/src/dspbase.jl b/src/dspbase.jl index 5f162ccee..1e02288fd 100644 --- a/src/dspbase.jl +++ b/src/dspbase.jl @@ -51,13 +51,13 @@ function filt!(out::AbstractArray, b::Union{AbstractVector, Number}, a::Union{Ab end iszero(size(x, 1)) && return out - isone(sz) && return (k = b[1] / a[1]; Compat.@noinline mul!(out, x, k)) # Simple scaling without memory + isone(sz) && return (k = b[1] / a[1]; @noinline mul!(out, x, k)) # Simple scaling without memory # Filter coefficient normalization if !isone(a[1]) norml = a[1] - a = Compat.@noinline broadcast(/, a, norml) - b = Compat.@noinline broadcast(/, b, norml) + a = @noinline broadcast(/, a, norml) + b = @noinline broadcast(/, b, norml) end # Pad the coefficients with zeros if needed bs