MovingLineSource¶
- class acoular.sources.MovingLineSource¶
Bases:
LineSource
,MovingPointSource
A moving
line source
with an arbitrary signal.The
MovingLineSource
class models aline source
composed of multiple monopoles that move along atrajectory
. It supportscoherent and incoherent
sources and considers Doppler effects due to motion.- Key Features:
Specify the
trajectory
and rotation of theline source
.Compute emission times considering motion and source
direction
.Generate block-wise microphone output with moving source effects.
See also
acoular.sources.LineSource
For
line sources
consisting ofcoherent or incoherent
monopoles.acoular.sources.MovingPointSource
For moving point sources without dipole characteristics.
- digest = Property( …¶
A unique identifier for the current state of the source, based on its properties. (read-only)
- rvec = CArray(dtype=float, shape=(3,), value=array((0, 0, 0)), desc='reference vector')¶
A reference vector, perpendicular to the x and y-axis of moving source, defining the axis of rotation for the line source directivity. If set to
(0, 0, 0)
, the line source is only translated along thetrajectory
without rotation. Default is(0, 0, 0)
.
- get_moving_direction(direction, time=0)¶
Calculate the moving direction of the line source along its trajectory.
This method computes the updated direction vector for the line source, considering both translation along the
trajectory
and rotation defined by thereference vector
. If thereference vector
is (0, 0, 0), only translation is applied. Otherwise, the method incorporates rotation into the calculation.- Parameters:
- direction
numpy.ndarray
The initial direction vector of the line source, specified as a 3-element array representing the orientation of the line.
- time
float
, optional The time at which the
trajectory
position and velocity are evaluated. Defaults to0
.
- direction
- Returns:
numpy.ndarray
The updated direction vector of the line source after translation and, if applicable, rotation. The output is a 3-element array.
Notes
The method computes the translation direction vector based on the
trajectory
’s velocity at the specified time.If the
reference vector
is non-zero, the method constructs a rotation matrix to compute the new line 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.
- get_emission_time(t, direction)¶
Calculate the emission time for a moving line source based on its trajectory.
This method computes the time at which sound waves are emitted from the line source at a specific point along its
trajectory
. It also determines the distances from the source to each microphone and calculates the radial Mach number, which accounts for the Doppler effect due to the motion of the source.- Parameters:
- t
float
The current receiving time at the microphones, specified in seconds.
- direction
numpy.ndarray
The current direction vector of the line source, specified as a 3-element array representing the orientation of the line.
- t
- Returns:
- te
numpy.ndarray
The computed emission times for each microphone, specified as an array of floats.
- rm
numpy.ndarray
The distances from the line source to each microphone, represented as an array of absolute distances.
- Mr
numpy.ndarray
The radial Mach number, which accounts for the Doppler effect, calculated for each microphone.
- xs
numpy.ndarray
The position of the line source at the computed emission time, returned as a 3-element array.
- te
Notes
This method performs Newton-Raphson iteration to find the emission time where the sound wave from the source reaches the microphones.
The distance between the line source and microphones is computed using Euclidean geometry.
The radial Mach number (
Mr
) is calculated using the velocity of the source and the speed of sound in the medium (c
).The method iterates until the difference between the computed emission time and the current time is sufficiently small (within a defined threshold).
- 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.ndarray
A 2D array of shape (
num
,num_channels
) containing the signal detected at the microphones. The last block may have fewer samples ifnum_samples
is not a multiple ofnum
.