acoular 24.3__py3-none-any.whl → 24.5__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 +118 -50
- acoular/calib.py +29 -38
- acoular/configuration.py +116 -73
- acoular/demo/__init__.py +10 -4
- acoular/demo/acoular_demo.py +78 -53
- acoular/environments.py +265 -262
- acoular/fastFuncs.py +361 -191
- acoular/fbeamform.py +1460 -1404
- acoular/grids.py +501 -545
- acoular/h5cache.py +50 -59
- acoular/h5files.py +154 -137
- acoular/internal.py +10 -11
- acoular/microphones.py +57 -53
- acoular/sdinput.py +47 -52
- acoular/signals.py +167 -179
- acoular/sources.py +818 -693
- acoular/spectra.py +349 -359
- acoular/tbeamform.py +414 -413
- acoular/tfastfuncs.py +178 -101
- acoular/tools/__init__.py +25 -0
- acoular/tools/aiaa.py +186 -0
- acoular/tools/helpers.py +189 -0
- acoular/tools/metrics.py +165 -0
- acoular/tprocess.py +1201 -1143
- 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.5.dist-info}/METADATA +45 -46
- acoular-24.5.dist-info/RECORD +50 -0
- {acoular-24.3.dist-info → acoular-24.5.dist-info}/WHEEL +1 -1
- acoular-24.5.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.5.dist-info}/licenses/AUTHORS.rst +0 -0
acoular/demo/acoular_demo.py
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
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.
|
|
@@ -16,65 +22,84 @@ pressure signals are sampled at 51200 Hz for a duration of 1 second.
|
|
|
16
22
|
Source location (relative to array center) and levels:
|
|
17
23
|
|
|
18
24
|
====== =============== ======
|
|
19
|
-
Source Location Level
|
|
25
|
+
Source Location Level
|
|
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
|
+
from acoular import (
|
|
40
|
+
BeamformerBase,
|
|
41
|
+
L_p,
|
|
42
|
+
MicGeom,
|
|
43
|
+
Mixer,
|
|
44
|
+
PointSource,
|
|
45
|
+
PowerSpectra,
|
|
46
|
+
RectGrid,
|
|
47
|
+
SteeringVector,
|
|
48
|
+
TimeSamples,
|
|
49
|
+
WNoiseGenerator,
|
|
50
|
+
WriteH5,
|
|
51
|
+
config,
|
|
52
|
+
)
|
|
53
|
+
from acoular import __file__ as bpath
|
|
28
54
|
|
|
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
55
|
# set up the parameters
|
|
36
|
-
sfreq = 51200
|
|
56
|
+
sfreq = 51200
|
|
37
57
|
duration = 1
|
|
38
|
-
nsamples = duration*sfreq
|
|
39
|
-
micgeofile =
|
|
58
|
+
nsamples = duration * sfreq
|
|
59
|
+
micgeofile = Path(bpath).parent / 'xml' / 'array_64.xml'
|
|
40
60
|
h5savefile = 'three_sources.h5'
|
|
41
|
-
|
|
61
|
+
|
|
42
62
|
# 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(
|
|
63
|
+
mg = MicGeom(from_file=micgeofile)
|
|
64
|
+
n1 = WNoiseGenerator(sample_freq=sfreq, numsamples=nsamples, seed=1)
|
|
65
|
+
n2 = WNoiseGenerator(sample_freq=sfreq, numsamples=nsamples, seed=2, rms=0.7)
|
|
66
|
+
n3 = WNoiseGenerator(sample_freq=sfreq, numsamples=nsamples, seed=3, rms=0.5)
|
|
67
|
+
p1 = PointSource(signal=n1, mics=mg, loc=(-0.1, -0.1, 0.3))
|
|
68
|
+
p2 = PointSource(signal=n2, mics=mg, loc=(0.15, 0, 0.3))
|
|
69
|
+
p3 = PointSource(signal=n3, mics=mg, loc=(0, 0.1, 0.3))
|
|
70
|
+
pa = Mixer(source=p1, sources=[p2, p3])
|
|
71
|
+
wh5 = WriteH5(source=pa, name=h5savefile)
|
|
52
72
|
wh5.save()
|
|
53
|
-
|
|
73
|
+
|
|
54
74
|
# analyze the data and generate map
|
|
55
|
-
|
|
56
|
-
ts = TimeSamples(
|
|
57
|
-
ps = PowerSpectra(
|
|
58
|
-
|
|
59
|
-
rg = RectGrid(
|
|
60
|
-
increment=0.01 )
|
|
75
|
+
|
|
76
|
+
ts = TimeSamples(name=h5savefile)
|
|
77
|
+
ps = PowerSpectra(time_data=ts, block_size=128, window='Hanning')
|
|
78
|
+
|
|
79
|
+
rg = RectGrid(x_min=-0.2, x_max=0.2, y_min=-0.2, y_max=0.2, z=0.3, increment=0.01)
|
|
61
80
|
st = SteeringVector(grid=rg, mics=mg)
|
|
62
|
-
|
|
63
|
-
bb = BeamformerBase(
|
|
64
|
-
pm = bb.synthetic(
|
|
65
|
-
Lm = L_p(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
81
|
+
|
|
82
|
+
bb = BeamformerBase(freq_data=ps, steer=st)
|
|
83
|
+
pm = bb.synthetic(8000, 3)
|
|
84
|
+
Lm = L_p(pm)
|
|
85
|
+
|
|
86
|
+
if config.have_matplotlib:
|
|
87
|
+
from pylab import axis, colorbar, figure, imshow, plot, show
|
|
88
|
+
|
|
89
|
+
# show map
|
|
90
|
+
imshow(Lm.T, origin='lower', vmin=Lm.max() - 10, extent=rg.extend(), interpolation='bicubic')
|
|
91
|
+
colorbar()
|
|
92
|
+
|
|
93
|
+
# plot microphone geometry
|
|
94
|
+
figure(2)
|
|
95
|
+
plot(mg.mpos[0], mg.mpos[1], 'o')
|
|
96
|
+
axis('equal')
|
|
97
|
+
|
|
98
|
+
show()
|
|
99
|
+
|
|
100
|
+
else:
|
|
101
|
+
print('Matplotlib not found! Please install matplotlib if you want to plot the results.')
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
if __name__ == '__main__':
|
|
80
105
|
run()
|