@@ -6,6 +6,21 @@ export fft, bfft
6
6
include (" callgraph.jl" )
7
7
include (" algos.jl" )
8
8
9
+ """
10
+ $(TYPEDSIGNATURES)
11
+ Perform a fast Fourier transform of a vector. Preserves types given by the
12
+ user.
13
+
14
+ # Arguments
15
+ x::AbstractVector: The vector to transform.
16
+
17
+ # Examples
18
+ ```julia
19
+ julia> x = rand(ComplexF64, 10)
20
+
21
+ julia> y = fft(x)
22
+ ```
23
+ """
9
24
function fft (x:: AbstractVector{T} ) where {T}
10
25
y = similar (x)
11
26
g = CallGraph {T} (length (x))
@@ -20,6 +35,21 @@ function fft(x::AbstractVector{T}) where {T <: Real}
20
35
y
21
36
end
22
37
38
+ """
39
+ $(TYPEDSIGNATURES)
40
+ Perform a fast Fourier transform of a matrix. Preserves types given by the
41
+ user.
42
+
43
+ # Arguments
44
+ x::AbstractMatrix: The matrix to transform (columnwise then rowwise).
45
+
46
+ # Examples
47
+ ```julia
48
+ julia> x = rand(ComplexF64, 10, 10)
49
+
50
+ julia> y = fft(x)
51
+ ```
52
+ """
23
53
function fft (x:: AbstractMatrix{T} ) where {T}
24
54
M,N = size (x)
25
55
y1 = similar (x)
@@ -54,6 +84,27 @@ function fft(x::AbstractMatrix{T}) where {T <: Real}
54
84
y2
55
85
end
56
86
87
+ """
88
+ $(TYPEDSIGNATURES)
89
+ Perform a backward fast Fourier transform of a vector, where "backward"
90
+ indicates the same output signal down to a constant factor. Preserves types
91
+ given by the user.
92
+
93
+ # Arguments
94
+ x::AbstractVector: The vector to transform
95
+
96
+ # Examples
97
+ ```julia
98
+ julia> x = rand(ComplexF64, 10)
99
+
100
+ julia> y = bfft(x)
101
+
102
+ julia> z = fft(y)
103
+
104
+ julia> x ≈ z/10
105
+ true
106
+ ```
107
+ """
57
108
function bfft (x:: AbstractVector{T} ) where {T}
58
109
y = similar (x)
59
110
g = CallGraph {T} (length (x))
@@ -68,6 +119,27 @@ function bfft(x::AbstractVector{T}) where {T <: Real}
68
119
y
69
120
end
70
121
122
+ """
123
+ $(TYPEDSIGNATURES)
124
+ Perform a backward fast Fourier transform of a matrix, where "backward"
125
+ indicates the same output signal down to a constant factor. Preserves types
126
+ given by the user.
127
+
128
+ # Arguments
129
+ x::AbstractMatrix: The matrix to transform
130
+
131
+ # Examples
132
+ ```julia
133
+ julia> x = rand(ComplexF64, 10, 10)
134
+
135
+ julia> y = bfft(x)
136
+
137
+ julia> z = fft(y)
138
+
139
+ julia> x ≈ z/100
140
+ true
141
+ ```
142
+ """
71
143
function bfft (x:: AbstractMatrix{T} ) where {T}
72
144
M,N = size (x)
73
145
y1 = similar (x)
0 commit comments