RoomAcoustics.jl/src/types.jl

45 lines
831 B
Julia
Raw Normal View History

2022-10-13 15:50:42 +02:00
export Room, RectangularRoom
export RIRConfig, ISMConfig
abstract type Room end
2022-12-23 10:41:22 +01:00
struct RectangularRoom{T<:Real} <: Room
2022-10-13 15:50:42 +02:00
c::T
L::Tuple{T, T, T}
β::Tuple{T, T, T, T, T, T}
end
abstract type RIRConfig end
"""
"""
2022-12-23 10:41:22 +01:00
struct ISMConfig{T<:Real, I<:Integer, R<:AbstractRNG} <: RIRConfig
2022-10-13 15:50:42 +02:00
order::Tuple{I, I} # Order of reflection [low, high]
fs::T # Sampling frequency
N::I # Number of samples in impulse response
Wd::T # Single impulse width
hp::Bool # High pass filter
isd::T # Image source distortion (randomized image method)
2022-12-23 10:41:22 +01:00
lrng::R
2022-10-13 15:50:42 +02:00
end
function ISMConfig(
order=(0, -1),
2022-12-23 10:41:22 +01:00
fs=16000.0,
2022-10-13 15:50:42 +02:00
N=4000,
Wd=8e-3,
hp=true,
isd=0.0,
lrng=GLOBAL_RNG
)
ISMConfig(order, fs, N, Wd, hp, isd, lrng)
end