From 02b5e91cd09c64664542fde153417addd67c56f4 Mon Sep 17 00:00:00 2001 From: zymon Date: Sun, 19 May 2024 14:27:06 +0200 Subject: [PATCH] ISMConfig struct small rewrite --- src/types.jl | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/src/types.jl b/src/types.jl index c6ee723..1967a45 100644 --- a/src/types.jl +++ b/src/types.jl @@ -19,29 +19,16 @@ abstract type AbstractRIRConfig end """ """ -struct ISMConfig{T<:Real,I<:Integer,R<:AbstractRNG} <: AbstractRIRConfig - 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) - lrng::R +@kwdef struct ISMConfig{T<:Real,I<:Integer,R<:AbstractRNG} <: AbstractRIRConfig + order::Tuple{I,I} = (0, -1) # Order of reflection [low, high] + fs::T = 16e3 # Sampling frequency + N::I = 4000 # Number of samples in impulse response + Wd::T = 8e-3 # Single impulse width + hp::Bool = true # High pass filter + isd::T = 0.0 # Image source distortion (randomized image method) + lrng::R = GLOBAL_RNG # Local randon number generator end -function ISMConfig( - order=(0, -1), - fs=16000.0, - N=4000, - Wd=8e-3, - hp=true, - isd=0.0, - lrng=GLOBAL_RNG -) - ISMConfig(order, fs, N, Wd, hp, isd, lrng) -end - - struct Node{T<:Real} rx::TxRxArray{T} fs::T