Note
Go to the end to download the full example code.
Cross-spectral matrix import¶
This example demonstrates how to import a cross-spectral matrix from a external source by means of
the acoular.spectra.PowerSpectraImport
class. The CSM is created numerically for a
frequency of 8 kHz.
from pathlib import Path
import acoular as ac
import numpy as np
Define the source positions and rms values of three sources as well as the microphone positions
loc1 = (-0.1, -0.1, -0.3)
loc2 = (0.15, 0, -0.3)
loc3 = (0, 0.1, -0.3)
rms = np.array([1, 0.7, 0.5])
micgeofile = Path(ac.__file__).parent / 'xml' / 'array_64.xml'
mg = ac.MicGeom(file=micgeofile)
Obtain the transfer function of the monopole sources by using the SteeringVector object
Calculate the cross-spectral matrix for the three sources without noise
Import the cross-spectral matrix using the PowerSpectraImport object
Calculate the Beamforming result for the imported cross-spectral matrix
Show the source map
import matplotlib.pyplot as plt
plt.figure()
plt.imshow(Lm.T, origin='lower', vmin=Lm.max() - 10, extent=rg.extend(), interpolation='bicubic')
plt.colorbar()
plt.show()

Total running time of the script: (0 minutes 0.101 seconds)