BeamformerGridlessOrth#

class acoular.fbeamform.BeamformerGridlessOrth

Bases: BeamformerAdaptiveGrid

Orthogonal beamforming without predefined grid.

See [15] for details.

eva_list

List of components to consider, use this to directly set the eigenvalues used in the beamformer. Alternatively, set n.

n

Number of components to consider, defaults to 1. If set, eva_list will contain the indices of the n largest eigenvalues. Setting eva_list afterwards will override this value.

bounds

Geometrical bounds of the search domain to consider. bound is a list that contains exactly three tuple of (min,max) for each of the coordinates x, y, z. Defaults to [(-1.,1.),(-1.,1.),(0.01,1.)]

shgo

options dictionary for the SHGO solver, see scipy docs. Default is Sobol sampling Nelder-Mead local minimizer, 256 initial sampling points and 1 iteration

r_diag_norm

If diagonal of the csm is removed, some signal energy is lost. This is handled via this normalization factor. For this class, normalization is not implemented. Defaults to 1.0.

digest

A unique identifier for the beamformer, based on its properties. (read-only)

export_gpos(filename)

Export the grid positions to an XML file.

This method generates an XML file containing the positions of all grid points. Each point is represented by a <pos> element with Name, x, y, and z attributes. The generated XML is formatted to match the structure required for importing into the ImportGrid class.

Parameters:
filenamestr

The path to the file to which the grid positions will be written. The file extension must be .xml.

Raises:
OSError

If the file cannot be written due to permissions issues or invalid file paths.

Notes

  • The file will be saved in UTF-8 encoding.

  • The Name attribute for each point is set as "Point {i+1}", where i is the index of the grid point.

  • If subgrids are defined, they will be included as the subgrid attribute.

Examples

Export a grid with 100 points to an XML file:

>>> import acoular as ac
>>> import numpy as np
>>> grid = ac.ImportGrid()
>>> # Create some grid points
>>> points = np.arange(9).reshape(3, 3)
>>> grid.pos = points
>>> grid.export_gpos('grid_points.xml')

The generated grid_points.xml file will look like this:

<?xml version="1.1" encoding="utf-8"?><Grid name="grid_points">
  <pos Name="Point 1" x="0" y="1" z="2"/>
  <pos Name="Point 2" x="3" y="4" z="5"/>
  <pos Name="Point 3" x="6" y="7" z="8"/>
</Grid>
integrate(sector)

Integrates result map over a given sector.

Parameters:
sector: :class:`~acoular.grids.Sector` or derived

Gives the sector over which to integrate

Returns:
array of floats

The spectrum (all calculated frequency bands) for the integrated sector.

sig_loss_norm()

If the diagonal of the CSM is removed one has to handle the loss of signal energy.

Done via a normalization factor.

subdomain(sector)

Return the indices for a subdomain in the grid.

Allows arbitrary subdomains of type Sector.

Parameters:
sectorSector object

Sector describing the subdomain.

Returns:
tuple

A 2-tuple of arrays of integers or numpy.s_ objects that can be used to mask or select the specified subdomain from a grid-shaped array.

Notes

The numpy.where() method is used to determine the the indices.

synthetic(f, num=0)

Evaluates the beamforming result for an arbitrary frequency band.

Parameters:
f: float

Band center frequency.

numinteger

Controls the width of the frequency bands considered; defaults to 0 (single frequency line).

num

frequency band width

0

single frequency line

1

octave band

3

third-octave band

n

1/n-octave band

Returns:
array of floats

The synthesized frequency band values of the beamforming result at each grid point . Note that the frequency resolution and therefore the bandwidth represented by a single frequency line depends on the sampling frequency and used FFT block size.

steer

Instance of SteeringVector or its derived classes that contains information about the steering vector. This is a private trait. Do not set this directly, use steer trait instead.

freq_data

PowerSpectra object that provides the cross spectral matrix and eigenvalues

r_diag

Boolean flag, if ‘True’ (default), the main diagonal is removed before beamforming.

precision

Floating point precision of property result. Corresponding to numpy dtypes. Default = 64 Bit.

cached

Boolean flag, if ‘True’ (default), the result is cached in h5 files.

result

The beamforming result as squared sound pressure values at all grid point locations (readonly). Returns a (number of frequencies, number of gridpoints) array-like of floats. Values can only be accessed via the index operator [].

size

The total number of grid points. This property is automatically calculated based on other defining attributes of the grid. (read-only)

shape

The shape of the grid, represented as a tuple. Primarily useful for Cartesian grids. (read-only)

pos

The grid positions represented as a (3, size) array of floats. (read-only) All positions’ coordinates are in meters by default (see here).