Skip to content

Commit

Permalink
Merge pull request #40 from bionanoimaging/updated_main_for_pullrequest
Browse files Browse the repository at this point in the history
to update the make-cuda-work branch
  • Loading branch information
roflmaostc authored Dec 13, 2023
2 parents e090308 + 576ff70 commit cafdc41
Show file tree
Hide file tree
Showing 5 changed files with 351 additions and 138 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FourierTools"
uuid = "b18b359b-aebc-45ac-a139-9c0ccbb2871e"
authors = ["Felix Wechsler (roflmaostc) <[email protected]>", "rheintzmann <[email protected]>"]
version = "0.4.1"
version = "0.4.2"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
9 changes: 6 additions & 3 deletions docs/src/czt.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# CZTs
Chirp Z Transformations: Allows Fourier-transformation and at the same time zooming into the result,
which is why it is also called the Zoomed-FFT algorithm.
The algorithm is loosely based on a publication [Rabiner, Schafer, Rader, The Cirp z-Transform Algorithm, IEEE Trans AU 17(1969) p. 86] and a 2D Matlab Version written by N.G. Worku & H. Gross, with their consent (28. Oct. 2020) to make it openly available. It currently needs three FFTs to perform its work.
As one of these FFTs only depends on the datasize and zoom parameters, it can be moved to a plan in future implementations.

The algorithm is loosely based on a publication [Rabiner, Schafer, Rader, The Chirp z-Transform Algorithm, IEEE Trans AU 17(1969) p. 86]. It needs three FFTs to perform its work but one can be precalculated by using `plan_czt`.
Variable zooms, transform dimensions, array center positions as well as output sizes are supported along wiht a low-level interface by specifingy `a` and `w`.
```@docs
FourierTools.czt
FourierTools.plan_czt
FourierTools.iczt
FourierTools.czt_1d
FourierTools.plan_czt_1d
FourierTools.CZTPlan_1D
FourierTools.CZTPlan_ND
```
21 changes: 0 additions & 21 deletions src/convolutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,6 @@ function conv_psf(u::AbstractArray{T, N}, psf::AbstractArray{D, M}, dims=ntuple(
return conv(u, ifftshift(psf, dims), dims)
end

# define custom adjoint for conv
# so far only defined for the derivative regarding the first component
function ChainRulesCore.rrule(::typeof(conv), u::AbstractArray{T, N}, v::AbstractArray{D, M},
dims=ntuple(+, min(N, M))) where {T, D, N, M}
Y = conv(u, v, dims)
function conv_pullback(barx)
z = zero(eltype(u))
return NoTangent(), conv(barx, conj(v), dims), z, z
end
return Y, conv_pullback
end



"""
Expand Down Expand Up @@ -219,15 +207,6 @@ function p_conv_aux(P, P_inv, u, v_ft)
return (P_inv.p * ((P * u) .* v_ft .* P_inv.scale))
end

function ChainRulesCore.rrule(::typeof(p_conv_aux), P, P_inv, u, v)
Y = p_conv_aux(P, P_inv, u, v)
function conv_pullback(barx)
z = zero(eltype(u))
= p_conv_aux(P, P_inv, barx, conj(v))
return NoTangent(), z, z, ∇, z
end
return Y, conv_pullback
end

"""
fft_or_rfft(T)
Expand Down
Loading

0 comments on commit cafdc41

Please sign in to comment.