PointSourceDipole#

class acoular.sources.PointSourceDipole

Bases: PointSource

Define a fixed point source with dipole characteristics.

The PointSourceDipole class simulates a fixed point source with dipole characteristics by superimposing two nearby inversely phased monopoles. This is particularly useful for acoustic simulations where dipole sources are required.

The generated output is available via the result() generator.

See also

PointSource

For modeling stationary point sources.

Notes

The dipole’s output is calculated as the superposition of two monopoles: one shifted forward and the other backward along the direction vector, with inverse phases. This creates the characteristic dipole radiation pattern.

direction

Vector defining the orientation of the dipole lobes and the distance between the inversely phased monopoles. The magnitude of the vector determines the monopoles’ separation:

  • distance = [lowest wavelength in spectrum] * [magnitude] * 1e-5

Use vectors with magnitudes on the order of 1.0 or smaller for best results. Default is (0.0, 0.0, 1.0) (z-axis orientation).

Note: Use vectors with order of magnitude around 1.0 or less for good results.

prepadding

Behavior of the signal for negative time indices. Currently only supports 'loop'. Default is 'loop'.

digest

A unique identifier for the current state of the source, based on its properties. (read-only)

result(num=128)

Generate output signal at microphones in blocks.

Parameters:
numint, optional

Number of samples per block to yield. Default is 128.

Yields:
numpy.ndarray

A 2D array of shape (num, num_channels) containing the signal detected at the microphones. The last block may have fewer samples if num_samples is not a multiple of num.

Raises:
IndexError

If no more samples are available from the source.

Notes

If samples are needed for times earlier than the source’s start_t, the signal is taken from the end of the signal array, effectively looping the signal for negative indices.

signal

Instance of the SignalGenerator class defining the emitted signal.

loc

Coordinates (x, y, z) of the source. Default is np.array([[0.0], [0.0], [1.0]]).

num_channels

Number of output channels, automatically set based on the microphone geometry.

mics

MicGeom object defining the positions of the microphones.

env

An Environment or derived object providing sound propagation details, such as speed of sound in the medium. Default is Environment.

start_t

Start time of the signal in seconds. Default is 0.0.

start

Start time of data acquisition at the microphones in seconds. Default is 0.0.

up

Internal upsampling factor for finer signal resolution. Default is 16.

num_samples

Total number of samples in the emitted signal, derived from the signal generator.

sample_freq

Sampling frequency of the signal, derived from the signal generator.