aspcol.soundfieldcontrol.spatial_cov_freq_kernel
- aspcol.soundfieldcontrol.spatial_cov_freq_kernel(krr_params, pos_mic, wave_num, integral_pos_func, integral_volume, num_mc_samples, kernel_func=None, kernel_args=None)
Calculates spatial covariance matrices in the frequency domain using kernel interpolation
Assumes that the kernel function is diagonal, i.e. that there are no cross-terms between the sources. Both standard KRR and directionally weighted KRR is therefore supported.
- Parameters:
krr_params (ndarray of shape (num_freq, num_source, num_mic)) – the parameters a that together with a kernel function represents the estimated sound field. Can be calculated by e.g. get_krr_params from the kernelinterpolation module
pos_mic (ndarray of shape (num_mic, 3)) – positions of the microphones
wave_num (ndarray of shape (num_freqs)) – the wavenumbers of all considered frequencies, defined as 2 pi f / c, where c is the speed of sound
integral_pos_func (function or np.ndarray of shape (num_samples, 3)) – function that generates random positions for the Monte Carlo integration. The function should take a single integer argument and return a ndarray of shape (num_samples, 3) with the positions. If an ndarray is provided, it is assumed to be the positions themselves. The argument num_mc_samples is then ignored.
integral_volume (float) – the volume of the region where the Monte Carlo integration is performed
num_mc_samples (int) – the number of samples to use for the Monte Carlo integration
kernel_func (function, optional) – the kernel function to use for the interpolation. If None, the kernel function is assumed to be the Helmholtz kernel
kernel_args (list, optional) – additional arguments to the kernel
- Return type:
spatial_cov