Skip to content

Commit

Permalink
Merge 656bf68 into 6e8901b
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Jul 5, 2018
2 parents 6e8901b + 656bf68 commit 4488cb4
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
julia 0.6
Compat 0.63
Compat 0.69
Polynomials 0.1.0
Reexport
SpecialFunctions
Expand Down
2 changes: 1 addition & 1 deletion src/Filters/response.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ or frequencies `w` in radians/sample.
"""
function phasez(filter::FilterCoefficients, w = Compat.range(0, stop=π, length=250))
h = freqz(filter, w)
unwrap(-atan2.(imag(h), real(h)); dims=ndims(h))
unwrap(-atan.(imag(h), real(h)); dims=ndims(h))
end


Expand Down
12 changes: 10 additions & 2 deletions src/estimation.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
module Estimation

using Compat.LinearAlgebra: eig, svd
if VERSION < v"0.7.0-DEV.5211"
using Compat.LinearAlgebra: eig, svd
else
using LinearAlgebra: eigen, svd
end

export esprit

Expand Down Expand Up @@ -33,7 +37,11 @@ function esprit(x::AbstractArray, M::Integer, p::Integer, Fs::Real=1.0)
N = length(x)
X = x[ (1:M) .+ (0:N-M)' ]
U,s,V = svd(X)
D,_ = eig( U[1:end-1,1:p] \ U[2:end,1:p] )
@static if VERSION < v"0.7.0-DEV.5211"
D,_ = eig( U[1:end-1,1:p] \ U[2:end,1:p] )
else
D,_ = eigen( U[1:end-1,1:p] \ U[2:end,1:p] )
end
angle.(D)*Fs/2π
end

Expand Down
10 changes: 8 additions & 2 deletions src/windows.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ using ..Util
import SpecialFunctions: besseli
import Compat
using Compat: copyto!, undef
using Compat.LinearAlgebra: Diagonal, SymTridiagonal, eigfact!
if VERSION < v"0.7.0-DEV.5211"
using Compat.LinearAlgebra: Diagonal, SymTridiagonal, eigfact!
else
using LinearAlgebra: Diagonal, SymTridiagonal, eigen!
end
@importffts

export rect,
Expand Down Expand Up @@ -193,8 +197,10 @@ function dpss(n::Int, nw::Real, ntapers::Int=ceil(Int, 2*nw)-1)
# Get tapers
@static if VERSION < v"0.7.0-DEV.3159"
eigvec = eigfact!(mat, n-ntapers+1:n)[:vectors]
else
elseif VERSION < v"0.7.0-DEV.5211"
eigvec = eigfact!(mat, n-ntapers+1:n).vectors
else
eigvec = eigen!(mat, n-ntapers+1:n).vectors
end
v = Compat.reverse(eigvec::Matrix{Float64}, dims=2)

Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ testfiles = [ "dsp.jl", "util.jl", "windows.jl", "filter_conversion.jl",
"periodograms.jl", "resample.jl", "lpc.jl", "estimation.jl", "unwrap.jl"]

for testfile in testfiles
eval(@__MODULE__, :(@testset $testfile begin include($testfile) end))
eval(:(@testset $testfile begin include($testfile) end))
end

0 comments on commit 4488cb4

Please sign in to comment.