2022-10-13 15:50:42 +02:00
|
|
|
# RoomAcoustics.jl
|
|
|
|
|
|
|
|
`RoomAcoustics.jl` is a Julia package for acoustics simulations of the rooms.
|
|
|
|
|
|
|
|
|
|
|
|
```julia
|
2023-11-01 15:28:03 +01:00
|
|
|
] add RoomAcoustics
|
2022-10-13 15:50:42 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Currently, supported methods:
|
2023-08-27 15:41:10 +02:00
|
|
|
* Fast Image Source method for rectangular (shoebox) rooms
|
|
|
|
* Transmitter and receiver directivity pattern support
|
2022-10-13 15:50:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Example
|
|
|
|
|
|
|
|
```julia
|
|
|
|
using RoomAcoustics
|
2023-08-27 15:41:10 +02:00
|
|
|
using RoomAcoustics.TxRxModels
|
2022-10-13 15:50:42 +02:00
|
|
|
|
2023-08-27 15:41:10 +02:00
|
|
|
sampling_rate = 16e3
|
|
|
|
c = 343.0 # Wave propagation velocity
|
2022-10-13 15:50:42 +02:00
|
|
|
|
2023-08-27 15:41:10 +02:00
|
|
|
room = let
|
|
|
|
L = (10.0, 5.0, 3.0)
|
|
|
|
β = fill(0.55, 6) |> Tuple
|
|
|
|
RectangularRoom(c, L, β)
|
|
|
|
end
|
2022-10-13 15:50:42 +02:00
|
|
|
|
2023-08-27 15:41:10 +02:00
|
|
|
rir_config = let
|
|
|
|
h_len = convert(Int, sampling_rate * 0.50)
|
|
|
|
ISMConfig((0, -1), sampling_rate, h_len)
|
|
|
|
end
|
2022-10-13 15:50:42 +02:00
|
|
|
|
2023-08-27 15:41:10 +02:00
|
|
|
rx = [2.2, 4.1, 1.6] |> TxRx
|
|
|
|
tx = [2.2, 4.1, 1.7] |> TxRx
|
2022-10-13 15:50:42 +02:00
|
|
|
|
2023-08-27 15:41:10 +02:00
|
|
|
h = ISM(tx, rx, room, rir_config)
|
2022-10-13 15:50:42 +02:00
|
|
|
```
|