Skip to content

Commit fb5f872

Browse files
committed
Add fft op
1 parent 5bfff9f commit fb5f872

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/src/tutorials/fft.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# # Fourier Operator
2+
include("../../util.jl") #hide
3+
# The Fourier operator and its related operators for the discrete cosine and sine transform are available
4+
# whenever FFTW.jl is loaded together with LinearOperatorCollection:
5+
fop = FFTOp(Complex{eltype(image)}, shape = (N, N))
6+
cop = DCTOp(eltype(image), shape = (N, N))
7+
sop = DSTOp(eltype(image), shape = (N, N))
8+
image_frequencies = reshape(fop * vec(image), N, N)
9+
image_cosine = reshape(cop * vec(image), N, N)
10+
image_sine = reshape(sop * vec(image), N, N)
11+
12+
fig = Figure()
13+
plot_image(fig[1,1], image, title = "Image")
14+
plot_image(fig[1,2], abs.(weighted_frequencies) .+ eps(), title = "Frequency Domain", colorscale = log10)
15+
plot_image(fig[1,3], image_cosine, title = "Cosine")
16+
plot_image(fig[1,4], image_sine, title = "Sine")
17+
resize_to_layout!(fig)
18+
fig

0 commit comments

Comments
 (0)