Skip to content

Commit

Permalink
fix sign flip
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbrahms committed May 10, 2023
1 parent bc8f485 commit 2a0ac06
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Maths.jl
Original file line number Diff line number Diff line change
Expand Up @@ -530,17 +530,18 @@ function wigner(t, A::Vector{<:Complex}; downsample=1, crop=1)
Ats = similar(Ao)
Atc = similar(Ao)
for (idx, τi) in enumerate(t)
τshift!(Ats, Af, τi/2, false)
τshift!(Atc, Af, -τi/2, true)
τshift!(Ats, Af, -τi/2, false)
τshift!(Atc, Af, τi/2, true)
Wt[idx, :] .= Ats .* Atc
end

# middle of the time window
τgrid = l*δt/2

ω = fftfreq(t)
Wf = FFTW.fftshift(FFTW.fft(Wt, 1) .* exp.(1im .* FFTW.fftshift(ω) .* τgrid), 1)[:, n:end-n-1]

t, -ω, real(Wf)
t, ω, real(Wf)
end

wigner(t, A::Vector{<:Real}; kwargs...) = wigner(t, hilbert(A); kwargs...)
Expand Down

0 comments on commit 2a0ac06

Please sign in to comment.