aspcol.soundfieldcontrol.spatial_cov

aspcol.soundfieldcontrol.spatial_cov(ir, source, filt_len, num_samples, margin=None)

Computes time-domain spatial covariance matrix from room impulse responses

The spatial covariance matrix is $R = begin{bmatrix} = $

Parameters:
  • ir (ndarray of shape (num_ls, num_mic, ir_len)) – room impulse responses from loudspeakers to microphones

  • source (Source object) – source object that generates the audio that should be reproduced in the sound zones. The only requirement is that it is an object with a get_samples(num_samples) method, returning a ndarray of shape (num_ls, num_samples).

  • filt_len (int) – The length of the desired filter impulse response

  • num_samples (int) – The number of samples to use for the spatial covariance matrix. Higher will give a more accurate estimate, but take longer to compute.

  • margin (int, optional) – by default the function will use as many samples as possible, which means only removing rir_len-1 samples in the beginning of the filtered source signal, since those samples haven’t had time to propagate properly. margin can be supplied if a specific number of samples should be removed instead. might give questionable result if you set margin to less than rir_len-1.

Returns:

R – The spatial covariance matrix

Return type:

ndarray of shape (num_ls*filt_len, num_ls*filt_len)

Notes

begin{equation}

bm{R}_{zi} = expect bigl[ mathbb{X}_i^top (n) bm{H}_z bm{H}_z^{top} mathbb{X}_i(n)bigr] in mathbb{R}^{LItimes LI}

end{equation}