SpatialInterpolator#
- class acoular.tprocess.SpatialInterpolator(*args, **kwargs)
Bases:
TimeOutBase class for spatial interpolation of microphone data.
Deprecated since version :class:`SpatialInterpolator`: is deprecated and will be removed in version 27.01.
This class retrieves samples from a specified source and performs spatial interpolation to generate output at virtual microphone positions. The interpolation is executed using various methods such as linear, spline, radial basis function (RBF), and inverse distance weighting (IDW).
See also
SpatialInterpolatorRotationSpatial interpolation class for rotating sound sources.
SpatialInterpolatorConstantRotationPerforms spatial linear interpolation for sources undergoing constant rotation.
- source
The input data source. It must be an instance of a
SamplesGenerator-derived class. It provides the time-domain pressure samples from microphones.
- mics
The physical microphone geometry. An instance of
MicGeomthat defines the positions of the real microphones used for measurement.
- mics_virtual
The virtual microphone geometry. This property defines the positions of virtual microphones where interpolated pressure values are computed. Default is the physical microphone geometry (
mics).
- method
Interpolation method used for spatial data estimation.
Options:
'linear': Uses NumPy linear interpolation.'spline': Uses SciPy’s CubicSpline interpolator'rbf-multiquadric': Radial basis function (RBF) interpolation with a multiquadric kernel.'rbf-cubic': RBF interpolation with a cubic kernel.'IDW': Inverse distance weighting interpolation.'custom': Allows user-defined interpolation methods.'sinc': Uses sinc-based interpolation for signal reconstruction.
- array_dimension
Defines the spatial dimensionality of the microphone array.
Possible values:
'1D': Linear microphone arrays.'2D': Planar microphone arrays.'ring': Circular arrays where rotation needs to be considered.'3D': Three-dimensional microphone distributions.'custom': User-defined microphone arrangements.
- sample_freq
Sampling frequency of the output signal, inherited from the
source. This defines the rate at which microphone pressure samples are acquired and processed.
- num_channels
Number of channels in the output data. This corresponds to the number of virtual microphone positions where interpolated pressure values are computed. The value is ´determined based on the
mics_virtualgeometry.
- num_samples
Number of time-domain samples in the output signal, inherited from the
source.
- interp_at_zero
Whether to interpolate a virtual microphone at the origin. If set to
True, an additional virtual microphone position at the coordinate origin \((0,0,0)\) will be interpolated.
- Q
Transformation matrix for coordinate system alignment.
This 3x3 orthogonal matrix is used to align the microphone coordinates such that rotations occur around the z-axis. If the original coordinates do not conform to the expected alignment (where the x-axis transitions into the y-axis upon rotation), applying this matrix modifies the coordinates accordingly. The transformation is defined as
\[\begin{split}\begin{bmatrix}x'\\y'\\z'\end{bmatrix} = Q \cdot \begin{bmatrix}x\\y\\z\end{bmatrix}\end{split}\]where \(Q\) is the transformation matrix and \((x', y', z')\) are the modified coordinates. If no transformation is needed, \(Q\) defaults to the identity matrix.
- num_IDW
Number of neighboring microphones used in IDW interpolation. This parameter determines how many physical microphones contribute to the weighted sum in inverse distance weighting (IDW) interpolation.
- p_weight
Weighting exponent for IDW interpolation. This parameter controls the influence of distance in inverse distance weighting (IDW). A higher value gives more weight to closer microphones.
- digest
Unique identifier for the current configuration of the interpolator. (read-only)
- sinc_mic(r)
Compute a modified sinc function for use in Radial Basis Function (RBF) approximation.
This function is used as a kernel in sinc-based interpolation methods, where the sinc function serves as a basis function for reconstructing signals based on spatially distributed microphone data. The function is scaled according to the number of virtual microphone positions, ensuring accurate signal approximation.
- Parameters:
- Returns:
numpy.ndarrayEvaluated sinc function values at the given radial distances.
- result(num)
Generate interpolated microphone data over time.
This method retrieves pressure samples from the physical microphones and applies spatial interpolation to estimate the pressure at virtual microphone locations. The interpolation method is determined by
method.- Parameters:
- num
int Number of samples per block.
- num
- Yields:
numpy.ndarrayAn array of shape (
num, n), where n is the number of virtual microphones, containing interpolated pressure values for the virtual microphones at each time step. The last block may contain fewer samples if the total number of samples is not a multiple ofnum.