From 3de7f6a1d87b3eb9b53ef226bb43e463633f2e5f Mon Sep 17 00:00:00 2001 From: Tobias Hienzsch Date: Sun, 7 Jul 2024 11:28:31 +0200 Subject: [PATCH] Improve Studio model --- data/models/Studio/model.json | 2 +- src/python/Studio_cpu.py | 5 +++-- src/python/Studio_model.py | 29 ++++++++++++++++------------- src/python/Studio_viz.py | 5 +++-- src/python/compare_ir.py | 2 +- 5 files changed, 24 insertions(+), 19 deletions(-) diff --git a/data/models/Studio/model.json b/data/models/Studio/model.json index 34fa8e3..b7e6dd3 100644 --- a/data/models/Studio/model.json +++ b/data/models/Studio/model.json @@ -1 +1 @@ -{"mats_hash": {"Walls": {"tris": [[0, 1, 2], [0, 2, 3], [6, 5, 4], [7, 6, 4], [0, 3, 4], [7, 4, 3], [5, 2, 1], [2, 5, 6]], "pts": [[0.0, 0.0, 0.0], [3.65, 0.0, 0.0], [3.65, 0.0, 3.12], [0.0, 0.0, 3.12], [0.0, 6.0, 0.0], [3.65, 6.0, 0.0], [3.65, 6.0, 3.12], [0.0, 6.0, 3.12]], "color": [255, 255, 255], "sides": [1, 1, 1, 1, 1, 1, 1, 1]}, "Ceiling": {"tris": [[2, 1, 0], [2, 3, 1]], "pts": [[0, 0, 3.12], [0, 6.0, 3.12], [3.65, 0, 3.12], [3.65, 6.0, 3.12]], "color": [200, 200, 200], "sides": [1, 1]}, "Floor": {"tris": [[0, 1, 2], [1, 3, 2]], "pts": [[0, 0, 0], [0, 6.0, 0], [3.65, 0, 0], [3.65, 6.0, 0]], "color": [151, 134, 122], "sides": [1, 1]}, "Absorber": {"tris": [[0, 1, 2], [0, 2, 3], [6, 5, 4], [7, 6, 4], [0, 3, 4], [7, 4, 3], [5, 2, 1], [2, 5, 6], [0, 5, 1], [0, 4, 5], [2, 6, 3], [6, 7, 3], [8, 9, 10], [8, 10, 11], [14, 13, 12], [15, 14, 12], [8, 11, 12], [15, 12, 11], [13, 10, 9], [10, 13, 14], [8, 13, 9], [8, 12, 13], [10, 14, 11], [14, 15, 11], [16, 17, 18], [16, 18, 19], [22, 21, 20], [23, 22, 20], [16, 19, 20], [23, 20, 19], [21, 18, 17], [18, 21, 22], [16, 21, 17], [16, 20, 21], [18, 22, 19], [22, 23, 19], [24, 25, 26], [24, 26, 27], [30, 29, 28], [31, 30, 28], [24, 27, 28], [31, 28, 27], [29, 26, 25], [26, 29, 30], [24, 29, 25], [24, 28, 29], [26, 30, 27], [30, 31, 27], [32, 33, 34], [32, 34, 35], [38, 37, 36], [39, 38, 36], [32, 35, 36], [39, 36, 35], [37, 34, 33], [34, 37, 38], [32, 37, 33], [32, 36, 37], [34, 38, 35], [38, 39, 35], [40, 41, 42], [40, 42, 43], [46, 45, 44], [47, 46, 44], [40, 43, 44], [47, 44, 43], [45, 42, 41], [42, 45, 46], [40, 45, 41], [40, 44, 45], [42, 46, 43], [46, 47, 43]], "pts": [[0.575, 5.7, 0.75], [3.075, 5.7, 0.75], [3.075, 5.7, 2.25], [0.575, 5.7, 2.25], [0.575, 5.8, 0.75], [3.075, 5.8, 0.75], [3.075, 5.8, 2.25], [0.575, 5.8, 2.25], [0.2, 3.0, 0.75], [0.30000000000000004, 3.0, 0.75], [0.30000000000000004, 3.0, 2.25], [0.2, 3.0, 2.25], [0.2, 5.5, 0.75], [0.30000000000000004, 5.5, 0.75], [0.30000000000000004, 5.5, 2.25], [0.2, 5.5, 2.25], [3.3499999999999996, 3.0, 0.75], [3.4499999999999997, 3.0, 0.75], [3.4499999999999997, 3.0, 2.25], [3.3499999999999996, 3.0, 2.25], [3.3499999999999996, 5.5, 0.75], [3.4499999999999997, 5.5, 0.75], [3.4499999999999997, 5.5, 2.25], [3.3499999999999996, 5.5, 2.25], [0.575, 3.5, 2.72], [3.075, 3.5, 2.72], [3.075, 3.5, 2.8200000000000003], [0.575, 3.5, 2.8200000000000003], [0.575, 5.5, 2.72], [3.075, 5.5, 2.72], [3.075, 5.5, 2.8200000000000003], [0.575, 5.5, 2.8200000000000003], [0.575, 1.4, 2.72], [3.075, 1.4, 2.72], [3.075, 1.4, 2.8200000000000003], [0.575, 1.4, 2.8200000000000003], [0.575, 3.4, 2.72], [3.075, 3.4, 2.72], [3.075, 3.4, 2.8200000000000003], [0.575, 3.4, 2.8200000000000003], [0.575, 0.3, 0.75], [3.075, 0.3, 0.75], [3.075, 0.3, 2.25], [0.575, 0.3, 2.25], [0.575, 0.4, 0.75], [3.075, 0.4, 0.75], [3.075, 0.4, 2.25], [0.575, 0.4, 2.25]], "color": [111, 55, 10], "sides": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]}, "Sofa": {"tris": [[0, 1, 2], [0, 2, 3], [6, 5, 4], [7, 6, 4], [0, 3, 4], [7, 4, 3], [5, 2, 1], [2, 5, 6], [0, 5, 1], [0, 4, 5], [2, 6, 3], [6, 7, 3]], "pts": [[0.565, 0.1, 0.05], [3.085, 0.1, 0.05], [3.085, 0.1, 0.53], [0.565, 0.1, 0.53], [0.565, 1.08, 0.05], [3.085, 1.08, 0.05], [3.085, 1.08, 0.53], [0.565, 1.08, 0.53]], "color": [25, 25, 25], "sides": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]}, "Table": {"tris": [[0, 1, 2], [0, 2, 3], [6, 5, 4], [7, 6, 4], [0, 3, 4], [7, 4, 3], [5, 2, 1], [2, 5, 6], [0, 5, 1], [0, 4, 5], [2, 6, 3], [6, 7, 3]], "pts": [[0.9249999999999999, 3.884455543377232, 0.7], [2.725, 3.884455543377232, 0.7], [2.725, 3.884455543377232, 0.72], [0.9249999999999999, 3.884455543377232, 0.72], [0.9249999999999999, 4.684455543377232, 0.7], [2.725, 4.684455543377232, 0.7], [2.725, 4.684455543377232, 0.72], [0.9249999999999999, 4.684455543377232, 0.72]], "color": [130, 75, 25], "sides": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]}}, "sources": [{"name": "Speaker Left", "xyz": [0.95, 5.0, 1.2]}, {"name": "Speaker Right", "xyz": [2.7, 5.0, 1.2]}], "receivers": [{"name": "Engineer", "xyz": [1.8250000000000002, 3.484455543377232, 1.2]}, {"name": "Producer Sitting", "xyz": [1.8250000000000002, 1.0, 0.9]}, {"name": "Producer Standing", "xyz": [1.8250000000000002, 1.0, 1.2]}]} +{"mats_hash": {"Walls": {"tris": [[0, 1, 2], [0, 2, 3], [6, 5, 4], [7, 6, 4], [0, 3, 4], [7, 4, 3], [5, 2, 1], [2, 5, 6]], "pts": [[0.0, 0.0, 0.0], [4.671, 0.0, 0.0], [4.671, 0.0, 3.33], [0.0, 0.0, 3.33], [0.0, 6.3, 0.0], [4.671, 6.3, 0.0], [4.671, 6.3, 3.33], [0.0, 6.3, 3.33]], "color": [255, 255, 255], "sides": [1, 1, 1, 1, 1, 1, 1, 1]}, "Ceiling": {"tris": [[2, 1, 0], [2, 3, 1]], "pts": [[0, 0, 3.33], [0, 6.3, 3.33], [4.671, 0, 3.33], [4.671, 6.3, 3.33]], "color": [200, 200, 200], "sides": [1, 1]}, "Floor": {"tris": [[0, 1, 2], [1, 3, 2]], "pts": [[0, 0, 0], [0, 6.3, 0], [4.671, 0, 0], [4.671, 6.3, 0]], "color": [151, 134, 122], "sides": [1, 1]}, "Absorber M": {"tris": [[0, 1, 2], [0, 2, 3], [6, 5, 4], [7, 6, 4], [0, 3, 4], [7, 4, 3], [5, 2, 1], [2, 5, 6], [0, 5, 1], [0, 4, 5], [2, 6, 3], [6, 7, 3], [8, 9, 10], [8, 10, 11], [14, 13, 12], [15, 14, 12], [8, 11, 12], [15, 12, 11], [13, 10, 9], [10, 13, 14], [8, 13, 9], [8, 12, 13], [10, 14, 11], [14, 15, 11]], "pts": [[0.2, 3.3, 0.75], [0.30000000000000004, 3.3, 0.75], [0.30000000000000004, 3.3, 2.25], [0.2, 3.3, 2.25], [0.2, 5.8, 0.75], [0.30000000000000004, 5.8, 0.75], [0.30000000000000004, 5.8, 2.25], [0.2, 5.8, 2.25], [4.371, 3.3, 0.75], [4.471, 3.3, 0.75], [4.471, 3.3, 2.25], [4.371, 3.3, 2.25], [4.371, 5.8, 0.75], [4.471, 5.8, 0.75], [4.471, 5.8, 2.25], [4.371, 5.8, 2.25]], "color": [111, 55, 10], "sides": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]}, "Absorber L": {"tris": [[0, 1, 2], [0, 2, 3], [6, 5, 4], [7, 6, 4], [0, 3, 4], [7, 4, 3], [5, 2, 1], [2, 5, 6], [0, 5, 1], [0, 4, 5], [2, 6, 3], [6, 7, 3], [8, 9, 10], [8, 10, 11], [14, 13, 12], [15, 14, 12], [8, 11, 12], [15, 12, 11], [13, 10, 9], [10, 13, 14], [8, 13, 9], [8, 12, 13], [10, 14, 11], [14, 15, 11], [16, 17, 18], [16, 18, 19], [22, 21, 20], [23, 22, 20], [16, 19, 20], [23, 20, 19], [21, 18, 17], [18, 21, 22], [16, 21, 17], [16, 20, 21], [18, 22, 19], [22, 23, 19], [24, 25, 26], [24, 26, 27], [30, 29, 28], [31, 30, 28], [24, 27, 28], [31, 28, 27], [29, 26, 25], [26, 29, 30], [24, 29, 25], [24, 28, 29], [26, 30, 27], [30, 31, 27]], "pts": [[1.0855000000000001, 6.0, 0.75], [3.5855, 6.0, 0.75], [3.5855, 6.0, 2.25], [1.0855000000000001, 6.0, 2.25], [1.0855000000000001, 6.2, 0.75], [3.5855, 6.2, 0.75], [3.5855, 6.2, 2.25], [1.0855000000000001, 6.2, 2.25], [1.0855000000000001, 0.1, 0.75], [3.5855, 0.1, 0.75], [3.5855, 0.1, 2.25], [1.0855000000000001, 0.1, 2.25], [1.0855000000000001, 0.30000000000000004, 0.75], [3.5855, 0.30000000000000004, 0.75], [3.5855, 0.30000000000000004, 2.25], [1.0855000000000001, 0.30000000000000004, 2.25], [1.0855000000000001, 3.8, 3.0300000000000002], [3.5855, 3.8, 3.0300000000000002], [3.5855, 3.8, 3.2300000000000004], [1.0855000000000001, 3.8, 3.2300000000000004], [1.0855000000000001, 5.8, 3.0300000000000002], [3.5855, 5.8, 3.0300000000000002], [3.5855, 5.8, 3.2300000000000004], [1.0855000000000001, 5.8, 3.2300000000000004], [1.0855000000000001, 1.6999999999999997, 3.0300000000000002], [3.5855, 1.6999999999999997, 3.0300000000000002], [3.5855, 1.6999999999999997, 3.2300000000000004], [1.0855000000000001, 1.6999999999999997, 3.2300000000000004], [1.0855000000000001, 3.6999999999999997, 3.0300000000000002], [3.5855, 3.6999999999999997, 3.0300000000000002], [3.5855, 3.6999999999999997, 3.2300000000000004], [1.0855000000000001, 3.6999999999999997, 3.2300000000000004]], "color": [111, 55, 10], "sides": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]}, "Sofa": {"tris": [[0, 1, 2], [0, 2, 3], [6, 5, 4], [7, 6, 4], [0, 3, 4], [7, 4, 3], [5, 2, 1], [2, 5, 6], [0, 5, 1], [0, 4, 5], [2, 6, 3], [6, 7, 3]], "pts": [[1.0755000000000001, 0.4, 0.05], [3.5955000000000004, 0.4, 0.05], [3.5955000000000004, 0.4, 0.53], [1.0755000000000001, 0.4, 0.53], [1.0755000000000001, 1.38, 0.05], [3.5955000000000004, 1.38, 0.05], [3.5955000000000004, 1.38, 0.53], [1.0755000000000001, 1.38, 0.53]], "color": [25, 25, 25], "sides": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]}, "Table": {"tris": [[0, 1, 2], [0, 2, 3], [6, 5, 4], [7, 6, 4], [0, 3, 4], [7, 4, 3], [5, 2, 1], [2, 5, 6], [0, 5, 1], [0, 4, 5], [2, 6, 3], [6, 7, 3]], "pts": [[1.4355000000000002, 4.184455543377233, 0.7], [3.2355, 4.184455543377233, 0.7], [3.2355, 4.184455543377233, 0.72], [1.4355000000000002, 4.184455543377233, 0.72], [1.4355000000000002, 4.984455543377233, 0.7], [3.2355, 4.984455543377233, 0.7], [3.2355, 4.984455543377233, 0.72], [1.4355000000000002, 4.984455543377233, 0.72]], "color": [130, 75, 25], "sides": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]}}, "sources": [{"name": "Speaker Left", "xyz": [1.4605000000000001, 5.3, 1.2]}, {"name": "Speaker Right", "xyz": [3.2105, 5.3, 1.2]}], "receivers": [{"name": "Engineer", "xyz": [2.3355, 3.7844555433772324, 1.2]}, {"name": "Producer Sitting", "xyz": [2.3355, 0.8, 0.9]}, {"name": "Producer Standing", "xyz": [2.3355, 0.8, 1.2]}]} diff --git a/src/python/Studio_cpu.py b/src/python/Studio_cpu.py index 9039363..3b7774b 100644 --- a/src/python/Studio_cpu.py +++ b/src/python/Studio_cpu.py @@ -7,10 +7,11 @@ insig_type='impulse', # for RIR diff_source=True, # for single precision mat_files_dict={ + 'Absorber M': 'absorber_8000_100mm.h5', + 'Absorber L': 'absorber_8000_200mm_gap_100mm.h5', 'Ceiling': 'concrete_painted.h5', 'Floor': 'floor_wood.h5', - 'Absorber': 'absorber_8000_200mm_gap_100mm.h5', - 'Sofa': 'absorber_8000_200mm_gap_100mm.h5', + 'Sofa': 'absorber_8000_200mm.h5', 'Table': 'door_wood.h5', 'Walls': 'concrete_painted.h5', }, diff --git a/src/python/Studio_model.py b/src/python/Studio_model.py index 418aeb5..17ca73b 100644 --- a/src/python/Studio_model.py +++ b/src/python/Studio_model.py @@ -1,8 +1,9 @@ from common.room_builder import RoomBuilder, find_third_vertex -L = 6.0 -W = 3.65 -H = 3.12 +S = 0.90 +L = 7.00*S +W = 5.19*S +H = 3.70*S src_height = 1.2 src_backwall = 1 @@ -14,30 +15,32 @@ listener = l1 if l1[1] < l2[1] else l2 producer_sit = listener.copy() -producer_sit[1] = 1 +producer_sit[1] = 0.8 producer_sit[2] = 0.9 producer_stand = listener.copy() -producer_stand[1] = 1 +producer_stand[1] = 0.8 room = RoomBuilder(W, L, H, wall_color=[255, 255, 255]) room.with_colors({ + "Absorber M": [111, 55, 10], + "Absorber L": [111, 55, 10], "Ceiling": [200, 200, 200], "Floor": [151, 134, 122], - "Absorber": [111, 55, 10], "Table": [130, 75, 25], "Sofa": [25, 25, 25], "Walls": [255, 255, 255], }) -room.add_box("Absorber", [2.5, 0.1, 1.5], [W/2-2.5/2, L-0.3, 0.75]) -room.add_box("Absorber", [0.1, 2.5, 1.5], [0.2, L-2.5-0.5, 0.75]) -room.add_box("Absorber", [0.1, 2.5, 1.5], [W-0.1-0.2, L-2.5-0.5, 0.75]) -room.add_box("Absorber", [2.5, 2.0, 0.1], [W/2-2.5/2, L-2-0.5, H-0.1-0.3]) -room.add_box("Absorber", [2.5, 2.0, 0.1], [W/2-2.5/2, L-2-2.1-0.5, H-0.1-0.3]) -room.add_box("Absorber", [2.5, 0.1, 1.5], [W/2-2.5/2, 0.3, 0.75]) +room.add_box("Absorber M", [0.1, 2.5, 1.5], [0.2, L-2.5-0.5, 0.75]) +room.add_box("Absorber M", [0.1, 2.5, 1.5], [W-0.1-0.2, L-2.5-0.5, 0.75]) -room.add_box("Sofa", [2.52, 0.98, 0.48], [W/2-2.52/2, 0.1, 0.05]) +room.add_box("Absorber L", [2.5, 0.2, 1.5], [W/2-2.5/2, L-0.2-0.1, 0.75]) +room.add_box("Absorber L", [2.5, 0.2, 1.5], [W/2-2.5/2, 0.1, 0.75]) +room.add_box("Absorber L", [2.5, 2.0, 0.2], [W/2-2.5/2, L-2-0.5, H-0.3]) +room.add_box("Absorber L", [2.5, 2.0, 0.2], [W/2-2.5/2, L-2-2.1-0.5, H-0.3]) + +room.add_box("Sofa", [2.52, 0.98, 0.48], [W/2-2.52/2, 0.4, 0.05]) room.add_box("Table", [1.8, 0.8, 0.02], [W/2-1.8/2, listener[1]+0.4, 0.7]) room.add_source("Speaker Left", src_left) diff --git a/src/python/Studio_viz.py b/src/python/Studio_viz.py index 4af9384..57bf304 100644 --- a/src/python/Studio_viz.py +++ b/src/python/Studio_viz.py @@ -7,10 +7,11 @@ insig_type='dhann30', # for viz diff_source=False, mat_files_dict={ + 'Absorber M': 'absorber_8000_100mm.h5', + 'Absorber L': 'absorber_8000_200mm_gap_100mm.h5', 'Ceiling': 'concrete_painted.h5', 'Floor': 'floor_wood.h5', - 'Absorber': 'absorber_8000_200mm_gap_100mm.h5', - 'Sofa': 'absorber_8000_200mm_gap_100mm.h5', + 'Sofa': 'absorber_8000_200mm.h5', 'Table': 'door_wood.h5', 'Walls': 'concrete_painted.h5', }, diff --git a/src/python/compare_ir.py b/src/python/compare_ir.py index f02a8cc..7ea346d 100644 --- a/src/python/compare_ir.py +++ b/src/python/compare_ir.py @@ -53,7 +53,7 @@ def main(): ax[0].set_title('Spectrum') ax[0].set_xlabel('Frequency [Hz]') ax[0].set_ylabel('Amplitude [dB]') - ax[0].set_ylim((30, 80)) + ax[0].set_ylim((10, 80)) ax[0].set_xlim((args.fmin, fmax)) ax[0].xaxis.set_major_formatter(formatter) ax[0].grid(which='minor', color='#DDDDDD', linestyle=':', linewidth=0.5)