MovingPointSourceDipole#
- class acoular.sources.MovingPointSourceDipole
Bases:
PointSourceDipole,MovingPointSourceDefine a moving point source with dipole characteristics.
This class extends the functionalities of
PointSourceDipoleandMovingPointSourceto simulate a dipole source that moves along adefined trajectory. It incorporates both rotational and translational dynamics for the dipole lobes, allowing simulation of complex directional sound sources.- Key Features:
Combines dipole characteristics with source motion.
Supports rotation of the dipole directivity via the
rvecattribute.Calculates emission times using Newton-Raphson iteration.
See also
PointSourceDipoleFor stationary dipole sources.
MovingPointSourceFor moving point sources without dipole characteristics.
- digest
A unique identifier for the current state of the source, based on its properties. (read-only)
- rvec
A reference vector, perpendicular to the x and y-axis of moving source, defining the axis of rotation for the dipole directivity. If set to
(0, 0, 0), the dipole is only translated along thetrajectorywithout rotation. Default is(0, 0, 0).
- get_emission_time(t, direction)
Calculate the emission time and related properties for a moving source.
- Parameters:
- t
numpy.ndarray The current receiving time at the microphones.
- direction
floatornumpy.ndarray Direction vector for the source’s dipole directivity.
- t
- Returns:
- tuple
A tuple containing:
- te
numpy.ndarray Emission times for each microphone.
- te
- rm
numpy.ndarray Distances from the source to each microphone.
- rm
- Mr
numpy.ndarray Radial Mach numbers for the source’s motion.
- Mr
- xs
numpy.ndarray Source coordinates at the calculated emission times.
- xs
Warning
Ensure that the maximum iteration count (
100) is sufficient for convergence in all scenarios, especially for high Mach numbers or long trajectories.Notes
The emission times are computed iteratively using the Newton-Raphson method. The iteration terminates when the time discrepancy (
eps) is below a threshold (epslim) or after 100 iterations.
- result(num=128)
Generate the output signal at microphones in blocks.
- Parameters:
- num
int, optional Number of samples per block to yield. Default is
128.
- num
- Yields:
numpy.ndarrayA 2D array of shape (
num,num_channels) containing the signal detected at the microphones. The last block may have fewer samples ifnum_samplesis not a multiple ofnum.
Notes
Radial Mach number adjustments are applied if
conv_ampis enabled.
- get_moving_direction(direction, time=0)
Calculate the moving direction of the source along its trajectory.
This method computes the updated direction vector for the moving source, considering both translation along the
trajectoryand rotation defined by thereference vector. If thereference vectoris (0, 0, 0), only translation is applied. Otherwise, the method incorporates rotation into the calculation.- Parameters:
- direction
numpy.ndarray The initial orientation of the source, specified as a three-dimensional array.
- time
float, optional The time at which the
trajectoryposition and velocity are evaluated. Defaults to0.
- direction
- Returns:
numpy.ndarrayThe updated direction vector of the moving source after translation and, if applicable, rotation. The output is a three-dimensional array.
Notes
The method computes the translation direction vector based on the
trajectory’s velocity at the specified time.If the
reference vectoris non-zero, the method constructs a rotation matrix to compute the new source direction based on thetrajectory’s motion and thereference vector.The rotation matrix ensures that the new orientation adheres to the right-hand rule and remains orthogonal.
- 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.0or smaller for best results. Default is(0.0, 0.0, 1.0)(z-axis orientation).Note: Use vectors with order of magnitude around
1.0or less for good results.
- prepadding
Behavior of the signal for negative time indices. Currently only supports
'loop'. Default is'loop'.
- conv_amp
Determines whether convective amplification is considered. When
True, the amplitude of the signal is adjusted based on the relative motion between the source and microphones. Default isFalse.
- trajectory
Instance of the
Trajectoryclass specifying the source’s motion. The trajectory defines the source’s position and velocity at any given time.
- signal
Instance of the
SignalGeneratorclass defining the emitted signal.
- loc
Coordinates
(x, y, z)of the source. Default isnp.array([[0.0], [0.0], [1.0]]).
- num_channels
Number of output channels, automatically set based on the
microphone geometry.
- mics
MicGeomobject defining the positions of the microphones.
- env
An
Environmentor derived object providing sound propagation details, such asspeed of sound in the medium. Default isEnvironment.
- 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
signalgenerator.
- sample_freq
Sampling frequency of the signal, derived from the
signalgenerator.