Skip to content

Commit 26fccd4

Browse files
committed
add docs for signal processing
1 parent 2d48ba6 commit 26fccd4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/time_simulation.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ function firstnonzero(arr::AbstractArray{T}) where T <: AbstractFloat
105105
end
106106

107107
"""
108+
frequency_to_time(field_mat::AbstractArray, ω_vec::AbstractVector,
109+
t_vec::AbstractArray = ω_to_t(ω_vec);
110+
method = :DFT,
111+
impulse::ContinuousImpulse = TimeDiracImpulse(zero(T)),
112+
discrete_impulse::DiscreteImpulse = continuous_to_discrete_impulse(impulse, t_vec, ω_vec))
113+
108114
See also: [`DiscreteImpulse`](@ref), [`ContinuousImpulse`](@ref)
109115
110116
Calculates the time response from the frequency response by approximating an
@@ -143,6 +149,13 @@ function frequency_to_time(field_mat::AbstractArray{Complex{T}}, ω_vec::Abstrac
143149
end
144150

145151
"""
152+
function time_to_frequency(field_mat::AbstractArray, t_vec::AbstractVector,
153+
ω_vec::AbstractArray = t_to_ω(t_vec);
154+
method = :DFT,
155+
impulse::ContinuousImpulse = TimeDiracImpulse(zero(T)),
156+
discrete_impulse::DiscreteImpulse = continuous_to_discrete_impulse(impulse, t_vec, ω_vec)
157+
)
158+
146159
The inverse of the function frequency_to_time (only an exact inverse when using
147160
:DFT integration). We use the Fourier transform convention:
148161
F(ω) = ∫ f(t)*exp(im*ω*t) dt

0 commit comments

Comments
 (0)