LineSource#
- class acoular.sources.LineSource
Bases:
PointSourceDefine a fixed line source with a signal.
The
LineSourceclass models a fixed line source composed of multiple monopole sources arranged along a specified direction. Each monopole can have its own source strength, and the coherence between them can be controlled.- Key Features:
Specify the
orientation,length, andnumberof monopoles in the line source.Control the
source strengthof individual monopoles.Support for
coherent or incoherentmonopole sources.
The output signals at microphones are generated block-wise using the
result()generator.See also
PointSourceFor modeling stationary point sources.
Notes
For incoherent sources, a unique seed is set for each monopole to generate independent signals.
- direction
Vector to define the orientation of the line source. Default is
(0.0, 0.0, 1.0).
- length
Vector to define the length of the line source in meters. Default is
1.0.
- num_sources
Number of monopole sources in the line source. Default is
1.
- source_strength
Strength coefficients for each monopole source.
- coherence
Coherence mode for the monopoles (
'coherent'or'incoherent').
- digest
A unique identifier for the current state of the source, based on its properties. (read-only)
- 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.
- 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.
- prepadding
Behavior of the signal for negative time indices, i.e. if (
start<start_t):'loop': Repeat thesignalfrom its end.'zeros': Use zeros, recommended for deterministic signals.
Default is
'loop'.
- 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.