From 46e4409b067764defa19db267e3e2dc3f3ea4eed Mon Sep 17 00:00:00 2001 From: zymon Date: Sun, 27 Aug 2023 15:41:10 +0200 Subject: [PATCH] README update --- Project.toml | 1 - README.md | 40 +++++++++++++++++----------------------- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/Project.toml b/Project.toml index 9ad56a5..692380f 100644 --- a/Project.toml +++ b/Project.toml @@ -10,4 +10,3 @@ LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" -TxRxModels = "b3a66cf7-5ddc-45c2-8bf6-0600270461a1" diff --git a/README.md b/README.md index 7537bfa..2264e38 100644 --- a/README.md +++ b/README.md @@ -9,38 +9,32 @@ Currently, supported methods: -* Image Source for rectangular (shoebox) rooms +* Fast Image Source method for rectangular (shoebox) rooms +* Transmitter and receiver directivity pattern support # Example ```julia -using StaticArrays -using LinearAlgebra - using RoomAcoustics +using RoomAcoustics.TxRxModels +sampling_rate = 16e3 +c = 343.0 # Wave propagation velocity -c = 343.0; -fs = 16000.0; -rir_Nsamples = 4000; -β = 0.75; -room_β = (β, β, β, β, β, β); -room_L = (10., 10., 3.); +room = let + L = (10.0, 5.0, 3.0) + β = fill(0.55, 6) |> Tuple + RectangularRoom(c, L, β) +end +rir_config = let + h_len = convert(Int, sampling_rate * 0.50) + ISMConfig((0, -1), sampling_rate, h_len) +end -mic = SVector{3}([5., 5., 1.]); -source = SVector{3}([1., 9., 2.]); - - -# Setup configuration -room = RectangularRoom(c, room_L, room_β); -rir_config = ISMConfig((0, -1), fs, rir_Nsamples, 8e-3, true, 0.0); -rx = TxRx(mic); -tx = TxRx(source); - -# Compute transfer function using Image Source Method -h = ISM(rx, tx, room, rir_config); - +rx = [2.2, 4.1, 1.6] |> TxRx +tx = [2.2, 4.1, 1.7] |> TxRx +h = ISM(tx, rx, room, rir_config) ```