Skip to content

Commit

Permalink
fix(pm): fix transmission loss computation and improve API
Browse files Browse the repository at this point in the history
  • Loading branch information
mchitre committed Jan 5, 2025
1 parent 658ffee commit 7167505
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pm_api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ scalar. If `rxs` is an `AbstractArray`, the result is an array of transmission
losses (in dB) with the same shape as `rxs`.
"""
function transmission_loss(pm, tx, rxs; kwargs...)
20 * log10.(abs.(acoustic_field(pm, tx, rxs; kwargs...))) .- spl(tx)
spl(tx) .- 20 * log10.(abs.(acoustic_field(pm, tx, rxs; kwargs...)))
end

"""
Expand Down Expand Up @@ -164,13 +164,16 @@ Superclass for all boundary conditions.
abstract type AbstractAcousticBoundary end

"""
reflection_coef(bc::AbstractAcousticBoundary, frequency, θ)
reflection_coef(bc::AbstractAcousticBoundary, frequency, θ, ρ, c)
Compute the complex reflection coefficient at a fluid-fluid boundary of type
`bc` at incidence angle `θ` and `frequency`. The density and sound speed in
the water are given by `ρ` and `c`, respectively.
"""
function reflection_coef(bc::AbstractAcousticBoundary, frequency, θ, ρ, c) end
function reflection_coef(bc::AbstractAcousticBoundary, frequency, θ)
reflection_coef(bc::AbstractAcousticBoundary, frequency, θ, water_density(), soundspeed())
end

"""
FluidBoundary(ρ, c, δ)
Expand Down

0 comments on commit 7167505

Please sign in to comment.