Skip to content

Commit 2b52917

Browse files
authored
Merge pull request #40 from slimgroup/fix-dft
fix iffshift in centered apply_ifft
2 parents fb62a9b + 44e716a commit 2b52917

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Diff for: Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "JOLI"
22
uuid = "bb331ad6-a1cf-11e9-23da-9bcb53c69f6f"
33
authors = ["Henryk Modzelewski <[email protected]>"]
4-
version = "0.8.0"
4+
version = "0.8.1"
55

66
[deps]
77
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"

Diff for: src/joLinearFunctionConstructors/joDFT.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module joDFT_etc
4545
mp=prod(ms)
4646
rv=reshape(v,msc)
4747
pf=plan_ifft(rv,dims)
48-
if centered rv=fftshift(rv,dims) end
48+
if centered rv=ifftshift(rv,dims) end
4949
rv=(pf*rv)*sqrt(mp)
5050
rv=reshape(rv,(prod(ms),nvc))
5151
rv=jo_convert(rdt,rv,false)
@@ -92,7 +92,7 @@ module joDFT_etc
9292
mp=prod(ms)
9393
rv=reshape(v,msc)
9494
pf=plan_ifft(rv,dims)
95-
if centered rv=fftshift(rv,dims) end
95+
if centered rv=ifftshift(rv,dims) end
9696
rv=(pf*rv)*sqrt(mp)
9797
rv=reshape(rv,(prod(ms),nvc))
9898
rv=jo_convert(rdt,rv,false)

Diff for: test/test_joDFT.jl

+5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ for t=1:T # start test loop
4242
@test norm((adjoint(A2)*A2)*vmv2-vmv2)<joTol
4343
end
4444

45+
### test https://github.com/slimgroup/JOLI.jl/issues/39
46+
A1=joDFT(m;DDT=ComplexF64,centered=true)
47+
verbose && println("$tsname ($m[,$m]) - centered")
48+
@test A1 * v1 == vec(A1 * reshape(v1, :, 1))
49+
4550
A1=joDFT(m;planned=false,DDT=ComplexF64)
4651
A2=joDFT(m,m;planned=false,DDT=ComplexF64)
4752
verbose && println("$tsname ($m[,$m]) - not planned")

0 commit comments

Comments
 (0)