Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…pleScattering.jl

Merging with local branch
  • Loading branch information
pivaps committed Sep 18, 2024
2 parents ea96351 + 26fccd4 commit 3c14b30
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/time_simulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ function firstnonzero(arr::AbstractArray{T}) where T <: AbstractFloat
end

"""
frequency_to_time(field_mat::AbstractArray, ω_vec::AbstractVector,
t_vec::AbstractArray = ω_to_t(ω_vec);
method = :DFT,
impulse::ContinuousImpulse = TimeDiracImpulse(zero(T)),
discrete_impulse::DiscreteImpulse = continuous_to_discrete_impulse(impulse, t_vec, ω_vec))
See also: [`DiscreteImpulse`](@ref), [`ContinuousImpulse`](@ref)
Calculates the time response from the frequency response by approximating an
Expand Down Expand Up @@ -143,6 +149,13 @@ function frequency_to_time(field_mat::AbstractArray{Complex{T}}, ω_vec::Abstrac
end

"""
function time_to_frequency(field_mat::AbstractArray, t_vec::AbstractVector,
ω_vec::AbstractArray = t_to_ω(t_vec);
method = :DFT,
impulse::ContinuousImpulse = TimeDiracImpulse(zero(T)),
discrete_impulse::DiscreteImpulse = continuous_to_discrete_impulse(impulse, t_vec, ω_vec)
)
The inverse of the function frequency_to_time (only an exact inverse when using
:DFT integration). We use the Fourier transform convention:
F(ω) = ∫ f(t)*exp(im*ω*t) dt
Expand Down

0 comments on commit 3c14b30

Please sign in to comment.