MCPcopy
hub / github.com/LCAV/pyroomacoustics / test_issue_22

Function test_issue_22

tests/test_issue_22.py:23–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22
23def test_issue_22():
24 np.random.seed(0)
25
26 n_mics = 1
27 n_src = 1
28 n_times = 25000
29 dim = 3
30 mic_pos = np.random.rand(dim, n_mics)
31 abs_coeff = 0.1
32 e_abs = 1.0 - (1.0 - abs_coeff) ** 2
33 fs = 16000
34 wall_max_len = 15
35
36 room_dim = np.random.rand(dim) * wall_max_len
37
38 shoebox = pyroomacoustics.ShoeBox(
39 room_dim,
40 materials=pyroomacoustics.Material(e_abs),
41 fs=fs,
42 max_order=0,
43 )
44
45 src_pos = np.random.rand(dim, n_src) * room_dim[:, None]
46 for src in src_pos.T:
47 shoebox.add_source(src)
48
49 shoebox.add_microphone_array(pyroomacoustics.MicrophoneArray(mic_pos, fs))
50
51 for i in range(n_times):
52 shoebox.image_source_model()
53
54 if i != 0 and i % 1000 == 0:
55 print(i)
56
57
58if __name__ == "__main__":

Callers 1

test_issue_22.pyFile · 0.85

Calls 3

add_sourceMethod · 0.80
add_microphone_arrayMethod · 0.80
image_source_modelMethod · 0.80

Tested by

no test coverage detected