sofar 1.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. docs/Makefile +20 -0
  2. docs/api_reference.rst +20 -0
  3. docs/conf.py +167 -0
  4. docs/contributing.rst +1 -0
  5. docs/history.rst +1 -0
  6. docs/index.rst +4 -0
  7. docs/make.bat +36 -0
  8. docs/readme.rst +1 -0
  9. docs/resources/conventions.py +162 -0
  10. docs/resources/working_with_sofa_HRIR_lateral.png +0 -0
  11. docs/resources/working_with_sofa_source_horizontal.png +0 -0
  12. docs/resources/working_with_sofa_source_lateral.png +0 -0
  13. docs/sofar.rst +82 -0
  14. sofar/__init__.py +28 -0
  15. sofar/io.py +427 -0
  16. sofar/sofa.py +1835 -0
  17. sofar/sofa_conventions/VERSION +1 -0
  18. sofar/sofa_conventions/conventions/AnnotatedEmitterAudio_0.2.csv +46 -0
  19. sofar/sofa_conventions/conventions/AnnotatedEmitterAudio_0.2.json +353 -0
  20. sofar/sofa_conventions/conventions/AnnotatedReceiverAudio_0.2.csv +46 -0
  21. sofar/sofa_conventions/conventions/AnnotatedReceiverAudio_0.2.json +353 -0
  22. sofar/sofa_conventions/conventions/FreeFieldDirectivityTF_1.1.csv +59 -0
  23. sofar/sofa_conventions/conventions/FreeFieldDirectivityTF_1.1.json +444 -0
  24. sofar/sofa_conventions/conventions/FreeFieldHRIR_1.0.csv +43 -0
  25. sofar/sofa_conventions/conventions/FreeFieldHRIR_1.0.json +333 -0
  26. sofar/sofa_conventions/conventions/FreeFieldHRTF_1.0.csv +44 -0
  27. sofar/sofa_conventions/conventions/FreeFieldHRTF_1.0.json +340 -0
  28. sofar/sofa_conventions/conventions/GeneralFIR-E_2.0.csv +37 -0
  29. sofar/sofa_conventions/conventions/GeneralFIR-E_2.0.json +270 -0
  30. sofar/sofa_conventions/conventions/GeneralFIR_1.0.csv +40 -0
  31. sofar/sofa_conventions/conventions/GeneralFIR_1.0.json +295 -0
  32. sofar/sofa_conventions/conventions/GeneralSOS_1.0.csv +40 -0
  33. sofar/sofa_conventions/conventions/GeneralSOS_1.0.json +306 -0
  34. sofar/sofa_conventions/conventions/GeneralTF-E_1.0.csv +38 -0
  35. sofar/sofa_conventions/conventions/GeneralTF-E_1.0.json +277 -0
  36. sofar/sofa_conventions/conventions/GeneralTF_1.0.csv +38 -0
  37. sofar/sofa_conventions/conventions/GeneralTF_1.0.json +277 -0
  38. sofar/sofa_conventions/conventions/GeneralTF_2.0.csv +38 -0
  39. sofar/sofa_conventions/conventions/GeneralTF_2.0.json +277 -0
  40. sofar/sofa_conventions/conventions/SimpleFreeFieldHRIR_1.0.csv +47 -0
  41. sofar/sofa_conventions/conventions/SimpleFreeFieldHRIR_1.0.json +369 -0
  42. sofar/sofa_conventions/conventions/SimpleFreeFieldHRSOS_1.0.csv +43 -0
  43. sofar/sofa_conventions/conventions/SimpleFreeFieldHRSOS_1.0.json +349 -0
  44. sofar/sofa_conventions/conventions/SimpleFreeFieldHRTF_1.0.csv +44 -0
  45. sofar/sofa_conventions/conventions/SimpleFreeFieldHRTF_1.0.json +340 -0
  46. sofar/sofa_conventions/conventions/SimpleFreeFieldSOS_1.0.csv +43 -0
  47. sofar/sofa_conventions/conventions/SimpleFreeFieldSOS_1.0.json +349 -0
  48. sofar/sofa_conventions/conventions/SimpleHeadphoneIR_1.0.csv +51 -0
  49. sofar/sofa_conventions/conventions/SimpleHeadphoneIR_1.0.json +396 -0
  50. sofar/sofa_conventions/conventions/SingleRoomMIMOSRIR_1.0.csv +78 -0
  51. sofar/sofa_conventions/conventions/SingleRoomMIMOSRIR_1.0.json +601 -0
  52. sofar/sofa_conventions/conventions/SingleRoomSRIR_1.0.csv +78 -0
  53. sofar/sofa_conventions/conventions/SingleRoomSRIR_1.0.json +601 -0
  54. sofar/sofa_conventions/conventions/deprecated/AnnotatedEmitterAudio_0.1.csv +46 -0
  55. sofar/sofa_conventions/conventions/deprecated/AnnotatedEmitterAudio_0.1.json +351 -0
  56. sofar/sofa_conventions/conventions/deprecated/AnnotatedReceiverAudio_0.1.csv +46 -0
  57. sofar/sofa_conventions/conventions/deprecated/AnnotatedReceiverAudio_0.1.json +351 -0
  58. sofar/sofa_conventions/conventions/deprecated/FreeFieldDirectivityTF_1.0.csv +58 -0
  59. sofar/sofa_conventions/conventions/deprecated/FreeFieldDirectivityTF_1.0.json +437 -0
  60. sofar/sofa_conventions/conventions/deprecated/GeneralFIRE_1.0.csv +37 -0
  61. sofar/sofa_conventions/conventions/deprecated/GeneralFIRE_1.0.json +270 -0
  62. sofar/sofa_conventions/conventions/deprecated/MultiSpeakerBRIR_0.3.csv +48 -0
  63. sofar/sofa_conventions/conventions/deprecated/MultiSpeakerBRIR_0.3.json +376 -0
  64. sofar/sofa_conventions/conventions/deprecated/SimpleFreeFieldHRIR_0.4.csv +43 -0
  65. sofar/sofa_conventions/conventions/deprecated/SimpleFreeFieldHRIR_0.4.json +333 -0
  66. sofar/sofa_conventions/conventions/deprecated/SimpleFreeFieldTF_0.4.csv +44 -0
  67. sofar/sofa_conventions/conventions/deprecated/SimpleFreeFieldTF_0.4.json +340 -0
  68. sofar/sofa_conventions/conventions/deprecated/SimpleFreeFieldTF_1.0.csv +44 -0
  69. sofar/sofa_conventions/conventions/deprecated/SimpleFreeFieldTF_1.0.json +340 -0
  70. sofar/sofa_conventions/conventions/deprecated/SimpleHeadphoneIR_0.1.csv +51 -0
  71. sofar/sofa_conventions/conventions/deprecated/SimpleHeadphoneIR_0.1.json +396 -0
  72. sofar/sofa_conventions/conventions/deprecated/SimpleHeadphoneIR_0.2.csv +51 -0
  73. sofar/sofa_conventions/conventions/deprecated/SimpleHeadphoneIR_0.2.json +396 -0
  74. sofar/sofa_conventions/conventions/deprecated/SingleRoomDRIR_0.2.csv +47 -0
  75. sofar/sofa_conventions/conventions/deprecated/SingleRoomDRIR_0.2.json +360 -0
  76. sofar/sofa_conventions/conventions/deprecated/SingleRoomDRIR_0.3.csv +47 -0
  77. sofar/sofa_conventions/conventions/deprecated/SingleRoomDRIR_0.3.json +360 -0
  78. sofar/sofa_conventions/conventions/deprecated/SingleTrackedAudio_0.1.csv +47 -0
  79. sofar/sofa_conventions/conventions/deprecated/SingleTrackedAudio_0.1.json +366 -0
  80. sofar/sofa_conventions/conventions/deprecated/SingleTrackedAudio_0.2.csv +51 -0
  81. sofar/sofa_conventions/conventions/deprecated/SingleTrackedAudio_0.2.json +397 -0
  82. sofar/sofa_conventions/rules/deprecations.json +13 -0
  83. sofar/sofa_conventions/rules/rules.json +819 -0
  84. sofar/sofa_conventions/rules/unit_aliases.json +11 -0
  85. sofar/sofa_conventions/rules/upgrade.json +226 -0
  86. sofar/sofa_conventions/write_upgrade_rules.py +139 -0
  87. sofar/sofa_conventions/write_verification_data.py +313 -0
  88. sofar/sofa_conventions/write_verification_rules.py +356 -0
  89. sofar/sofastream.py +301 -0
  90. sofar/update_conventions.py +449 -0
  91. sofar/utils.py +316 -0
  92. sofar-1.2.1.dist-info/LICENSE +22 -0
  93. sofar-1.2.1.dist-info/METADATA +136 -0
  94. sofar-1.2.1.dist-info/RECORD +105 -0
  95. sofar-1.2.1.dist-info/WHEEL +5 -0
  96. sofar-1.2.1.dist-info/top_level.txt +3 -0
  97. tests/__init__.py +0 -0
  98. tests/conftest.py +27 -0
  99. tests/test_deprecations.py +19 -0
  100. tests/test_io.py +349 -0
  101. tests/test_sofa.py +353 -0
  102. tests/test_sofa_upgrade_conventions.py +111 -0
  103. tests/test_sofa_verify.py +480 -0
  104. tests/test_sofastream.py +127 -0
  105. tests/test_utils.py +250 -0
@@ -0,0 +1,396 @@
1
+ {
2
+ "GLOBAL:Conventions": {
3
+ "default": "SOFA",
4
+ "flags": "rm",
5
+ "dimensions": null,
6
+ "type": "attribute",
7
+ "comment": ""
8
+ },
9
+ "GLOBAL:Version": {
10
+ "default": "1.0",
11
+ "flags": "rm",
12
+ "dimensions": null,
13
+ "type": "attribute",
14
+ "comment": ""
15
+ },
16
+ "GLOBAL:SOFAConventions": {
17
+ "default": "SimpleHeadphoneIR",
18
+ "flags": "rm",
19
+ "dimensions": null,
20
+ "type": "attribute",
21
+ "comment": "Conventions for IRs with a 1-to-1 correspondence between emitter and receiver. The main application for this convention is to store headphone IRs recorded for each emitter and each ear."
22
+ },
23
+ "GLOBAL:SOFAConventionsVersion": {
24
+ "default": "0.2",
25
+ "flags": "rm",
26
+ "dimensions": null,
27
+ "type": "attribute",
28
+ "comment": ""
29
+ },
30
+ "GLOBAL:APIName": {
31
+ "default": "",
32
+ "flags": "rm",
33
+ "dimensions": null,
34
+ "type": "attribute",
35
+ "comment": ""
36
+ },
37
+ "GLOBAL:APIVersion": {
38
+ "default": "",
39
+ "flags": "rm",
40
+ "dimensions": null,
41
+ "type": "attribute",
42
+ "comment": ""
43
+ },
44
+ "GLOBAL:ApplicationName": {
45
+ "default": "",
46
+ "flags": null,
47
+ "dimensions": null,
48
+ "type": "attribute",
49
+ "comment": ""
50
+ },
51
+ "GLOBAL:ApplicationVersion": {
52
+ "default": "",
53
+ "flags": null,
54
+ "dimensions": null,
55
+ "type": "attribute",
56
+ "comment": ""
57
+ },
58
+ "GLOBAL:AuthorContact": {
59
+ "default": "",
60
+ "flags": "m",
61
+ "dimensions": null,
62
+ "type": "attribute",
63
+ "comment": ""
64
+ },
65
+ "GLOBAL:Comment": {
66
+ "default": "",
67
+ "flags": "m",
68
+ "dimensions": null,
69
+ "type": "attribute",
70
+ "comment": ""
71
+ },
72
+ "GLOBAL:DataType": {
73
+ "default": "FIR",
74
+ "flags": "rm",
75
+ "dimensions": null,
76
+ "type": "attribute",
77
+ "comment": "We will store IRs here"
78
+ },
79
+ "GLOBAL:History": {
80
+ "default": "",
81
+ "flags": null,
82
+ "dimensions": null,
83
+ "type": "attribute",
84
+ "comment": ""
85
+ },
86
+ "GLOBAL:License": {
87
+ "default": "No license provided, ask the author for permission",
88
+ "flags": "m",
89
+ "dimensions": null,
90
+ "type": "attribute",
91
+ "comment": ""
92
+ },
93
+ "GLOBAL:Organization": {
94
+ "default": "",
95
+ "flags": "m",
96
+ "dimensions": null,
97
+ "type": "attribute",
98
+ "comment": ""
99
+ },
100
+ "GLOBAL:References": {
101
+ "default": "",
102
+ "flags": null,
103
+ "dimensions": null,
104
+ "type": "attribute",
105
+ "comment": ""
106
+ },
107
+ "GLOBAL:RoomType": {
108
+ "default": "free field",
109
+ "flags": "m",
110
+ "dimensions": null,
111
+ "type": "attribute",
112
+ "comment": "Room type is not relevant here"
113
+ },
114
+ "GLOBAL:Origin": {
115
+ "default": "",
116
+ "flags": null,
117
+ "dimensions": null,
118
+ "type": "attribute",
119
+ "comment": ""
120
+ },
121
+ "GLOBAL:DateCreated": {
122
+ "default": "",
123
+ "flags": "m",
124
+ "dimensions": null,
125
+ "type": "attribute",
126
+ "comment": ""
127
+ },
128
+ "GLOBAL:DateModified": {
129
+ "default": "",
130
+ "flags": "m",
131
+ "dimensions": null,
132
+ "type": "attribute",
133
+ "comment": ""
134
+ },
135
+ "GLOBAL:Title": {
136
+ "default": "",
137
+ "flags": "m",
138
+ "dimensions": null,
139
+ "type": "attribute",
140
+ "comment": ""
141
+ },
142
+ "GLOBAL:DatabaseName": {
143
+ "default": "",
144
+ "flags": "m",
145
+ "dimensions": null,
146
+ "type": "attribute",
147
+ "comment": "Correspondence to a database"
148
+ },
149
+ "GLOBAL:ListenerShortName": {
150
+ "default": "",
151
+ "flags": "m",
152
+ "dimensions": null,
153
+ "type": "attribute",
154
+ "comment": "Correspondence to a subject from the database"
155
+ },
156
+ "GLOBAL:ListenerDescription": {
157
+ "default": "",
158
+ "flags": "m",
159
+ "dimensions": null,
160
+ "type": "attribute",
161
+ "comment": "Narrative description of the listener (or mannequin)"
162
+ },
163
+ "GLOBAL:SourceDescription": {
164
+ "default": "",
165
+ "flags": "m",
166
+ "dimensions": null,
167
+ "type": "attribute",
168
+ "comment": "Narrative description of the headphones"
169
+ },
170
+ "GLOBAL:SourceManufacturer": {
171
+ "default": "",
172
+ "flags": "m",
173
+ "dimensions": null,
174
+ "type": "attribute",
175
+ "comment": "Name of the headphones manufacturer"
176
+ },
177
+ "GLOBAL:SourceModel": {
178
+ "default": "",
179
+ "flags": "m",
180
+ "dimensions": null,
181
+ "type": "attribute",
182
+ "comment": "Name of the headphone model. Must uniquely describe the headphones of the manufacturer"
183
+ },
184
+ "GLOBAL:SourceURI": {
185
+ "default": "",
186
+ "flags": "m",
187
+ "dimensions": null,
188
+ "type": "attribute",
189
+ "comment": "URI of the headphone specifications"
190
+ },
191
+ "GLOBAL:ReceiverDescription": {
192
+ "default": "",
193
+ "flags": "m",
194
+ "dimensions": null,
195
+ "type": "attribute",
196
+ "comment": "Narrative description of the microphones"
197
+ },
198
+ "GLOBAL:EmitterDescription": {
199
+ "default": "",
200
+ "flags": "m",
201
+ "dimensions": null,
202
+ "type": "attribute",
203
+ "comment": "Narrative description of the headphone drivers"
204
+ },
205
+ "ListenerPosition": {
206
+ "default": [
207
+ 0,
208
+ 0,
209
+ 0
210
+ ],
211
+ "flags": "m",
212
+ "dimensions": "IC, MC",
213
+ "type": "double",
214
+ "comment": ""
215
+ },
216
+ "ListenerPosition:Type": {
217
+ "default": "cartesian",
218
+ "flags": "m",
219
+ "dimensions": null,
220
+ "type": "attribute",
221
+ "comment": ""
222
+ },
223
+ "ListenerPosition:Units": {
224
+ "default": "metre",
225
+ "flags": "m",
226
+ "dimensions": null,
227
+ "type": "attribute",
228
+ "comment": ""
229
+ },
230
+ "ReceiverPosition": {
231
+ "default": [
232
+ [
233
+ 0,
234
+ 0.09,
235
+ 0
236
+ ],
237
+ [
238
+ 0,
239
+ -0.09,
240
+ 0
241
+ ]
242
+ ],
243
+ "flags": "m",
244
+ "dimensions": "rCI, rCM",
245
+ "type": "double",
246
+ "comment": ""
247
+ },
248
+ "ReceiverPosition:Type": {
249
+ "default": "cartesian",
250
+ "flags": "m",
251
+ "dimensions": null,
252
+ "type": "attribute",
253
+ "comment": ""
254
+ },
255
+ "ReceiverPosition:Units": {
256
+ "default": "metre",
257
+ "flags": "m",
258
+ "dimensions": null,
259
+ "type": "attribute",
260
+ "comment": ""
261
+ },
262
+ "SourcePosition": {
263
+ "default": [
264
+ 0,
265
+ 0,
266
+ 0
267
+ ],
268
+ "flags": "m",
269
+ "dimensions": "IC, MC",
270
+ "type": "double",
271
+ "comment": "Default: Headphones are located at the position of the listener"
272
+ },
273
+ "SourcePosition:Type": {
274
+ "default": "spherical",
275
+ "flags": "m",
276
+ "dimensions": null,
277
+ "type": "attribute",
278
+ "comment": ""
279
+ },
280
+ "SourcePosition:Units": {
281
+ "default": "degree, degree, metre",
282
+ "flags": "m",
283
+ "dimensions": null,
284
+ "type": "attribute",
285
+ "comment": ""
286
+ },
287
+ "EmitterPosition": {
288
+ "default": [
289
+ [
290
+ 0,
291
+ 0.09,
292
+ 0
293
+ ],
294
+ [
295
+ 0,
296
+ -0.09,
297
+ 0
298
+ ]
299
+ ],
300
+ "flags": "m",
301
+ "dimensions": "eCI, eCM",
302
+ "type": "double",
303
+ "comment": "Default: Reflects the correspondence of each emitter to each receiver"
304
+ },
305
+ "EmitterPosition:Type": {
306
+ "default": "cartesian",
307
+ "flags": "m",
308
+ "dimensions": null,
309
+ "type": "attribute",
310
+ "comment": ""
311
+ },
312
+ "EmitterPosition:Units": {
313
+ "default": "metre",
314
+ "flags": "m",
315
+ "dimensions": null,
316
+ "type": "attribute",
317
+ "comment": ""
318
+ },
319
+ "SourceManufacturer": {
320
+ "default": [
321
+ ""
322
+ ],
323
+ "flags": null,
324
+ "dimensions": "MS",
325
+ "type": "string",
326
+ "comment": "Optional M-dependent version of the attribute SourceManufucturer"
327
+ },
328
+ "SourceModel": {
329
+ "default": [
330
+ ""
331
+ ],
332
+ "flags": null,
333
+ "dimensions": "MS",
334
+ "type": "string",
335
+ "comment": "Optional M-dependent version of the attribute SourceModel"
336
+ },
337
+ "ReceiverDescription": {
338
+ "default": [
339
+ ""
340
+ ],
341
+ "flags": null,
342
+ "dimensions": "MS",
343
+ "type": "string",
344
+ "comment": "Optional M-dependent version of the attribute ReceiverDescription"
345
+ },
346
+ "EmitterDescription": {
347
+ "default": [
348
+ ""
349
+ ],
350
+ "flags": null,
351
+ "dimensions": "MS",
352
+ "type": "string",
353
+ "comment": "Optional M-dependent version of the attribute EmitterDescription"
354
+ },
355
+ "MeasurementDate": {
356
+ "default": 0,
357
+ "flags": null,
358
+ "dimensions": "M",
359
+ "type": "double",
360
+ "comment": "Optional M-dependent date and time of the measurement"
361
+ },
362
+ "Data.IR": {
363
+ "default": [
364
+ 0,
365
+ 0
366
+ ],
367
+ "flags": "m",
368
+ "dimensions": "mRn",
369
+ "type": "double",
370
+ "comment": ""
371
+ },
372
+ "Data.SamplingRate": {
373
+ "default": 48000,
374
+ "flags": "m",
375
+ "dimensions": "I",
376
+ "type": "double",
377
+ "comment": ""
378
+ },
379
+ "Data.SamplingRate:Units": {
380
+ "default": "hertz",
381
+ "flags": "m",
382
+ "dimensions": null,
383
+ "type": "attribute",
384
+ "comment": ""
385
+ },
386
+ "Data.Delay": {
387
+ "default": [
388
+ 0,
389
+ 0
390
+ ],
391
+ "flags": "m",
392
+ "dimensions": "IR, MR",
393
+ "type": "double",
394
+ "comment": ""
395
+ }
396
+ }
@@ -0,0 +1,47 @@
1
+ Name Default Flags Dimensions Type Comment
2
+ GLOBAL:Conventions SOFA rm attribute
3
+ GLOBAL:Version 1.0 rm attribute
4
+ GLOBAL:SOFAConventions SingleRoomDRIR rm attribute This convention stores arbitrary number of receivers while providing an information about the room. The main application is to store DRIRs for a single room.
5
+ GLOBAL:SOFAConventionsVersion 0.2 rm attribute
6
+ GLOBAL:APIName rm attribute
7
+ GLOBAL:APIVersion rm attribute
8
+ GLOBAL:ApplicationName attribute
9
+ GLOBAL:ApplicationVersion attribute
10
+ GLOBAL:AuthorContact m attribute
11
+ GLOBAL:Comment m attribute
12
+ GLOBAL:DataType FIR rm attribute
13
+ GLOBAL:History attribute
14
+ GLOBAL:License No license provided, ask the author for permission m attribute
15
+ GLOBAL:Organization m attribute
16
+ GLOBAL:References attribute
17
+ GLOBAL:RoomType reverberant m attribute
18
+ GLOBAL:Origin attribute
19
+ GLOBAL:DateCreated m attribute
20
+ GLOBAL:DateModified m attribute
21
+ GLOBAL:Title m attribute
22
+ ListenerPosition [0 0 0] m IC, MC double
23
+ ListenerPosition:Type cartesian m attribute
24
+ ListenerPosition:Units meter m attribute
25
+ ReceiverPosition [0 0 0] m rCI, rCM double
26
+ ReceiverPosition:Type cartesian m attribute
27
+ ReceiverPosition:Units meter m attribute
28
+ SourcePosition [0 0 0] m IC, MC double
29
+ SourcePosition:Type cartesian m attribute
30
+ SourcePosition:Units meter m attribute
31
+ EmitterPosition [0 0 0] m eCI, eCM double
32
+ EmitterPosition:Type cartesian m attribute
33
+ EmitterPosition:Units meter m attribute
34
+ GLOBAL:DatabaseName m attribute
35
+ GLOBAL:RoomDescription m attribute
36
+ ListenerUp [0 0 1] m IC, MC double
37
+ ListenerView [1 0 0] m IC, MC double
38
+ ListenerView:Type cartesian m attribute
39
+ ListenerView:Units metre m attribute
40
+ SourceUp [0 0 1] m IC, MC double
41
+ SourceView [-1 0 0] m IC, MC double
42
+ SourceView:Type cartesian m attribute
43
+ SourceView:Units metre m attribute
44
+ Data.IR [1] m mRn double
45
+ Data.SamplingRate 48000 m I double
46
+ Data.SamplingRate:Units hertz m attribute
47
+ Data.Delay [0] m IR, MR double