Skip to content

Commit

Permalink
Fix bug in complex QF algorithm.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Bazdresch committed Sep 21, 2023
1 parent d975c51 commit 3c14536
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/estimation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ function quinn(x::Vector{<:Complex}, f0::Real, Fs::Real ; tol = 1e-6, maxiters =
ξ[t] = x[t] + exp(complex(0,ω̂))*ξ[t-1]
end
# step 3
x = let s = 0.0
S = let s = 0.0
for t=2:T
s += x[t]*conj(ξ[t-1])
end
s
end
num = imag(x*exp(complex(0,-ω̂)))
num = imag(S*exp(complex(0,-ω̂)))
den = sum(abs2.(ξ[1:end-1]))
ω̂ += 2*num/den

Expand Down

0 comments on commit 3c14536

Please sign in to comment.