acoular 24.3__py3-none-any.whl → 24.7__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.
- acoular/__init__.py +119 -54
- acoular/calib.py +29 -38
- acoular/configuration.py +132 -82
- acoular/demo/__init__.py +10 -4
- acoular/demo/acoular_demo.py +73 -55
- acoular/environments.py +270 -264
- acoular/fastFuncs.py +366 -196
- acoular/fbeamform.py +1797 -1934
- acoular/grids.py +504 -548
- acoular/h5cache.py +74 -83
- acoular/h5files.py +159 -142
- acoular/internal.py +13 -14
- acoular/microphones.py +57 -53
- acoular/sdinput.py +57 -53
- acoular/signals.py +180 -178
- acoular/sources.py +920 -724
- acoular/spectra.py +353 -363
- acoular/tbeamform.py +416 -416
- acoular/tfastfuncs.py +180 -104
- acoular/tools/__init__.py +25 -0
- acoular/tools/aiaa.py +185 -0
- acoular/tools/helpers.py +189 -0
- acoular/tools/metrics.py +165 -0
- acoular/tprocess.py +1240 -1182
- acoular/traitsviews.py +513 -501
- acoular/trajectory.py +50 -52
- acoular/version.py +5 -6
- acoular/xml/minidsp_uma-16.xml +20 -0
- acoular/xml/{minidsp_uma16.xml → minidsp_uma-16_mirrored.xml} +3 -0
- {acoular-24.3.dist-info → acoular-24.7.dist-info}/METADATA +58 -39
- acoular-24.7.dist-info/RECORD +50 -0
- {acoular-24.3.dist-info → acoular-24.7.dist-info}/WHEEL +1 -1
- acoular-24.7.dist-info/licenses/LICENSE +28 -0
- acoular/fileimport.py +0 -380
- acoular/nidaqimport.py +0 -273
- acoular/tests/reference_data/BeamformerBase.npy +0 -0
- acoular/tests/reference_data/BeamformerBaseFalse1.npy +0 -0
- acoular/tests/reference_data/BeamformerBaseFalse2.npy +0 -0
- acoular/tests/reference_data/BeamformerBaseFalse3.npy +0 -0
- acoular/tests/reference_data/BeamformerBaseFalse4.npy +0 -0
- acoular/tests/reference_data/BeamformerBaseTrue1.npy +0 -0
- acoular/tests/reference_data/BeamformerBaseTrue2.npy +0 -0
- acoular/tests/reference_data/BeamformerBaseTrue3.npy +0 -0
- acoular/tests/reference_data/BeamformerBaseTrue4.npy +0 -0
- acoular/tests/reference_data/BeamformerCMFLassoLarsBIC.npy +0 -0
- acoular/tests/reference_data/BeamformerCMFNNLS.npy +0 -0
- acoular/tests/reference_data/BeamformerCapon.npy +0 -0
- acoular/tests/reference_data/BeamformerClean.npy +0 -0
- acoular/tests/reference_data/BeamformerCleansc.npy +0 -0
- acoular/tests/reference_data/BeamformerCleant.npy +0 -0
- acoular/tests/reference_data/BeamformerCleantSq.npy +0 -0
- acoular/tests/reference_data/BeamformerCleantSqTraj.npy +0 -0
- acoular/tests/reference_data/BeamformerCleantTraj.npy +0 -0
- acoular/tests/reference_data/BeamformerDamas.npy +0 -0
- acoular/tests/reference_data/BeamformerDamasPlus.npy +0 -0
- acoular/tests/reference_data/BeamformerEig.npy +0 -0
- acoular/tests/reference_data/BeamformerEigFalse1.npy +0 -0
- acoular/tests/reference_data/BeamformerEigFalse2.npy +0 -0
- acoular/tests/reference_data/BeamformerEigFalse3.npy +0 -0
- acoular/tests/reference_data/BeamformerEigFalse4.npy +0 -0
- acoular/tests/reference_data/BeamformerEigTrue1.npy +0 -0
- acoular/tests/reference_data/BeamformerEigTrue2.npy +0 -0
- acoular/tests/reference_data/BeamformerEigTrue3.npy +0 -0
- acoular/tests/reference_data/BeamformerEigTrue4.npy +0 -0
- acoular/tests/reference_data/BeamformerFunctional.npy +0 -0
- acoular/tests/reference_data/BeamformerGIB.npy +0 -0
- acoular/tests/reference_data/BeamformerGridlessOrth.npy +0 -0
- acoular/tests/reference_data/BeamformerMusic.npy +0 -0
- acoular/tests/reference_data/BeamformerOrth.npy +0 -0
- acoular/tests/reference_data/BeamformerSODIX.npy +0 -0
- acoular/tests/reference_data/BeamformerTime.npy +0 -0
- acoular/tests/reference_data/BeamformerTimeSq.npy +0 -0
- acoular/tests/reference_data/BeamformerTimeSqTraj.npy +0 -0
- acoular/tests/reference_data/BeamformerTimeTraj.npy +0 -0
- acoular/tests/reference_data/Environment.npy +0 -0
- acoular/tests/reference_data/Example1_numerical_values_testsum.h5 +0 -0
- acoular/tests/reference_data/FiltFiltOctave__.npy +0 -0
- acoular/tests/reference_data/FiltFiltOctave_band_100_0_fraction_Thirdoctave_.npy +0 -0
- acoular/tests/reference_data/FiltFreqWeight_weight_A_.npy +0 -0
- acoular/tests/reference_data/FiltFreqWeight_weight_C_.npy +0 -0
- acoular/tests/reference_data/FiltFreqWeight_weight_Z_.npy +0 -0
- acoular/tests/reference_data/FiltOctave__.npy +0 -0
- acoular/tests/reference_data/FiltOctave_band_100_0_fraction_Thirdoctave_.npy +0 -0
- acoular/tests/reference_data/Filter__.npy +0 -0
- acoular/tests/reference_data/GeneralFlowEnvironment.npy +0 -0
- acoular/tests/reference_data/OctaveFilterBank__.npy +0 -0
- acoular/tests/reference_data/OpenJet.npy +0 -0
- acoular/tests/reference_data/PointSource.npy +0 -0
- acoular/tests/reference_data/PowerSpectra_csm.npy +0 -0
- acoular/tests/reference_data/PowerSpectra_ev.npy +0 -0
- acoular/tests/reference_data/RotatingFlow.npy +0 -0
- acoular/tests/reference_data/SlotJet.npy +0 -0
- acoular/tests/reference_data/TimeAverage__.npy +0 -0
- acoular/tests/reference_data/TimeCumAverage__.npy +0 -0
- acoular/tests/reference_data/TimeExpAverage_weight_F_.npy +0 -0
- acoular/tests/reference_data/TimeExpAverage_weight_I_.npy +0 -0
- acoular/tests/reference_data/TimeExpAverage_weight_S_.npy +0 -0
- acoular/tests/reference_data/TimeInOut__.npy +0 -0
- acoular/tests/reference_data/TimePower__.npy +0 -0
- acoular/tests/reference_data/TimeReverse__.npy +0 -0
- acoular/tests/reference_data/UniformFlowEnvironment.npy +0 -0
- acoular/tests/reference_data/beamformer_traj_time_data.h5 +0 -0
- acoular/tests/run_tests.sh +0 -18
- acoular/tests/run_tests_osx.sh +0 -16
- acoular/tests/test.npy +0 -0
- acoular/tests/test_beamformer_results.py +0 -213
- acoular/tests/test_classes.py +0 -60
- acoular/tests/test_digest.py +0 -125
- acoular/tests/test_environments.py +0 -73
- acoular/tests/test_example1.py +0 -124
- acoular/tests/test_grid.py +0 -92
- acoular/tests/test_integrate.py +0 -102
- acoular/tests/test_signals.py +0 -60
- acoular/tests/test_sources.py +0 -65
- acoular/tests/test_spectra.py +0 -38
- acoular/tests/test_timecache.py +0 -35
- acoular/tests/test_tprocess.py +0 -90
- acoular/tests/test_traj_beamformer_results.py +0 -164
- acoular/tests/unsupported/SpeedComparison/OvernightTestcasesBeamformer_nMics32_nGridPoints100_nFreqs4_nTrials10.png +0 -0
- acoular/tests/unsupported/SpeedComparison/cythonBeamformer.pyx +0 -237
- acoular/tests/unsupported/SpeedComparison/mainForCython.py +0 -103
- acoular/tests/unsupported/SpeedComparison/mainForParallelJit.py +0 -143
- acoular/tests/unsupported/SpeedComparison/setupCythonOpenMP.py +0 -63
- acoular/tests/unsupported/SpeedComparison/sharedFunctions.py +0 -153
- acoular/tests/unsupported/SpeedComparison/timeOverNMics_AllImportantMethods.png +0 -0
- acoular/tests/unsupported/SpeedComparison/timeOverNMics_faverage.png +0 -0
- acoular/tests/unsupported/SpeedComparison/vglOptimierungFAverage.py +0 -204
- acoular/tests/unsupported/SpeedComparison/vglOptimierungGaussSeidel.py +0 -182
- acoular/tests/unsupported/SpeedComparison/vglOptimierungR_BEAMFULL_INVERSE.py +0 -764
- acoular/tests/unsupported/SpeedComparison/vglOptimierungR_BEAM_OS.py +0 -231
- acoular/tests/unsupported/SpeedComparison/whatsFastestWayFor_absASquared.py +0 -48
- acoular/tests/unsupported/functionalBeamformer.py +0 -123
- acoular/tests/unsupported/precisionTest.py +0 -153
- acoular/tests/unsupported/validationOfBeamformerFuncsPOSTAcoularIntegration.py +0 -254
- acoular/tests/unsupported/validationOfBeamformerFuncsPREeAcoularIntegration.py +0 -531
- acoular/tools.py +0 -422
- acoular-24.3.dist-info/RECORD +0 -148
- acoular-24.3.dist-info/licenses/LICENSE +0 -29
- {acoular-24.3.dist-info → acoular-24.7.dist-info}/licenses/AUTHORS.rst +0 -0
acoular/demo/acoular_demo.py
CHANGED
|
@@ -1,80 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
#pylint: disable-msg=E0611, E1101, C0103, R0901, R0902, R0903, R0904, W0232
|
|
4
|
-
#------------------------------------------------------------------------------
|
|
1
|
+
# ------------------------------------------------------------------------------
|
|
5
2
|
# Copyright (c) Acoular Development Team.
|
|
6
|
-
|
|
7
|
-
"""Demo for Acoular
|
|
3
|
+
# ------------------------------------------------------------------------------
|
|
4
|
+
"""Demo for Acoular.
|
|
5
|
+
|
|
6
|
+
To run the demo, execute the following commands:
|
|
7
|
+
|
|
8
|
+
.. code-block:: python
|
|
9
|
+
|
|
10
|
+
import acoular
|
|
11
|
+
|
|
12
|
+
acoular.demo.acoular_demo.run()
|
|
13
|
+
|
|
8
14
|
|
|
9
15
|
Generates a test data set for three sources, analyzes them and generates a
|
|
10
16
|
map of the three sources.
|
|
11
|
-
|
|
17
|
+
|
|
12
18
|
The simulation generates the sound pressure at 64 microphones that are
|
|
13
19
|
arrangend in the 'array64' geometry, which is part of the package. The sound
|
|
14
20
|
pressure signals are sampled at 51200 Hz for a duration of 1 second.
|
|
15
21
|
|
|
16
|
-
Source location (relative to array center) and
|
|
22
|
+
Source location (relative to array center) and RMS in 1 m distance:
|
|
17
23
|
|
|
18
24
|
====== =============== ======
|
|
19
|
-
Source Location
|
|
25
|
+
Source Location RMS
|
|
20
26
|
====== =============== ======
|
|
21
27
|
1 (-0.1,-0.1,0.3) 1.0 Pa
|
|
22
|
-
2 (0.15,0,0.3) 0.7 Pa
|
|
28
|
+
2 (0.15,0,0.3) 0.7 Pa
|
|
23
29
|
3 (0,0.1,0.3) 0.5 Pa
|
|
24
30
|
====== =============== ======
|
|
31
|
+
|
|
25
32
|
"""
|
|
26
33
|
|
|
34
|
+
|
|
27
35
|
def run():
|
|
36
|
+
"""Run the Acoular demo."""
|
|
37
|
+
from pathlib import Path
|
|
38
|
+
|
|
39
|
+
import acoular as ac
|
|
40
|
+
|
|
41
|
+
ac.config.global_caching = 'none'
|
|
28
42
|
|
|
29
|
-
from os import path
|
|
30
|
-
from acoular import __file__ as bpath, MicGeom, WNoiseGenerator, PointSource,\
|
|
31
|
-
Mixer, WriteH5, TimeSamples, PowerSpectra, RectGrid, SteeringVector,\
|
|
32
|
-
BeamformerBase, L_p
|
|
33
|
-
from pylab import figure, plot, axis, imshow, colorbar, show
|
|
34
|
-
|
|
35
43
|
# set up the parameters
|
|
36
|
-
sfreq = 51200
|
|
44
|
+
sfreq = 51200
|
|
37
45
|
duration = 1
|
|
38
|
-
nsamples = duration*sfreq
|
|
39
|
-
micgeofile =
|
|
46
|
+
nsamples = duration * sfreq
|
|
47
|
+
micgeofile = Path(ac.__file__).parent / 'xml' / 'array_64.xml'
|
|
40
48
|
h5savefile = 'three_sources.h5'
|
|
41
|
-
|
|
49
|
+
|
|
42
50
|
# generate test data, in real life this would come from an array measurement
|
|
43
|
-
mg = MicGeom(
|
|
44
|
-
n1 = WNoiseGenerator(
|
|
45
|
-
n2 = WNoiseGenerator(
|
|
46
|
-
n3 = WNoiseGenerator(
|
|
47
|
-
p1 = PointSource(
|
|
48
|
-
p2 = PointSource(
|
|
49
|
-
p3 = PointSource(
|
|
50
|
-
pa = Mixer(
|
|
51
|
-
wh5 = WriteH5(
|
|
51
|
+
mg = ac.MicGeom(from_file=micgeofile)
|
|
52
|
+
n1 = ac.WNoiseGenerator(sample_freq=sfreq, numsamples=nsamples, seed=1)
|
|
53
|
+
n2 = ac.WNoiseGenerator(sample_freq=sfreq, numsamples=nsamples, seed=2, rms=0.7)
|
|
54
|
+
n3 = ac.WNoiseGenerator(sample_freq=sfreq, numsamples=nsamples, seed=3, rms=0.5)
|
|
55
|
+
p1 = ac.PointSource(signal=n1, mics=mg, loc=(-0.1, -0.1, 0.3))
|
|
56
|
+
p2 = ac.PointSource(signal=n2, mics=mg, loc=(0.15, 0, 0.3))
|
|
57
|
+
p3 = ac.PointSource(signal=n3, mics=mg, loc=(0, 0.1, 0.3))
|
|
58
|
+
pa = ac.Mixer(source=p1, sources=[p2, p3])
|
|
59
|
+
wh5 = ac.WriteH5(source=pa, name=h5savefile)
|
|
52
60
|
wh5.save()
|
|
53
|
-
|
|
61
|
+
|
|
54
62
|
# analyze the data and generate map
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
63
|
+
|
|
64
|
+
ps = ac.PowerSpectra(time_data=pa, block_size=128, window='Hanning')
|
|
65
|
+
|
|
66
|
+
rg = ac.RectGrid(x_min=-0.2, x_max=0.2, y_min=-0.2, y_max=0.2, z=0.3, increment=0.01)
|
|
67
|
+
st = ac.SteeringVector(grid=rg, mics=mg)
|
|
68
|
+
|
|
69
|
+
bb = ac.BeamformerBase(freq_data=ps, steer=st)
|
|
70
|
+
pm = bb.synthetic(8000, 3)
|
|
71
|
+
spl = ac.L_p(pm)
|
|
72
|
+
|
|
73
|
+
if ac.config.have_matplotlib:
|
|
74
|
+
from pylab import axis, colorbar, figure, imshow, plot, show
|
|
75
|
+
|
|
76
|
+
# show map
|
|
77
|
+
imshow(spl.T, origin='lower', vmin=spl.max() - 10, extent=rg.extend(), interpolation='bicubic')
|
|
78
|
+
colorbar()
|
|
79
|
+
|
|
80
|
+
# plot microphone geometry
|
|
81
|
+
figure(2)
|
|
82
|
+
plot(mg.mpos[0], mg.mpos[1], 'o')
|
|
83
|
+
axis('equal')
|
|
84
|
+
|
|
85
|
+
show()
|
|
86
|
+
|
|
87
|
+
else:
|
|
88
|
+
print('Matplotlib not found! Please install matplotlib if you want to plot the results.')
|
|
89
|
+
print('For consolation we do an ASCII map plot of the results here.')
|
|
90
|
+
grayscale = '@%#*+=-:. '[::-1]
|
|
91
|
+
ind = ((spl.T - spl.max() + 9).clip(0, 9)).astype(int)[::-1]
|
|
92
|
+
print(78 * '-')
|
|
93
|
+
print('|\n'.join([' '.join(['|'] + [grayscale[i] for i in row[2:-1]]) for row in ind]) + '|')
|
|
94
|
+
print(7 * '-', ''.join([f'{grayscale[i]}={int(spl.max())-9+i}dB ' for i in range(1, 10)]), 6 * '-')
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
if __name__ == '__main__':
|
|
80
98
|
run()
|