aspcol.plot.soundfield_estimation_comparison

aspcol.plot.soundfield_estimation_comparison(pos_est, p_est, p_true, freqs, fig_folder, shape='', center=None, num_ls=1, output_method='pdf', pos_mic=None, images=None, image_true=None, pos_image=None, remove_freqs_below=0, remove_freqs_above=inf, num_examples=4, points_for_errors=None)

Outputs a series of plots comparing a set of sound field estimates to the true sound field.

The function accepts sound field estimates in the frequency domain.

Parameters:
  • pos_est (np.ndarray) – Positions of the estimated sound field. Shape (num_positions, spatial_dim)

  • p_est (np.ndarray) – Estimated sound field. Shape (num_freqs, num_ls, num_positions) or (num_freqs, num_positions)

  • p_true (np.ndarray) – True sound field. Shape (num_freqs, num_ls, num_positions) or (num_freqs, num_positions)

  • freqs (np.ndarray of shape (num_freqs,)) – Frequencies used in the simulation.

  • fig_folder (pathlib Path) – Folder to save the figures in.

  • shape (str, optional) – Shape of the evaluation point array. If any of the valid options “rectangle”, “circle” is used, then a few more plots will be created. The default is “”.

  • center (np.ndarray, optional) – Center of the circle if shape is “circle”. The default is None.

  • num_ls (int, optional) – Number of loudspeakers. The default is 1.

  • output_method (str, optional) – Method for saving the plot. Options are ‘show’, ‘tikz’, ‘pdf’, ‘svg’, ‘none’. If ‘show’, the plot is shown in a window. If ‘tikz’, the plot is saved as a tikz file and a pdf file. Requires tikzplotlib installed. If ‘pdf’, the plot is saved as a pdf file. If ‘svg’, the plot is saved as a svg file. If ‘none’, the plot is not saved. The default is “pdf”.

  • pos_mic (np.ndarray, optional) – Positions of the microphones. Shape (num_mics, spatial_dim) The positions are added to the sound field images if supplied. The default is None.

  • images (np.ndarray, optional) – Estimated sound field on a grid array appropriate for creating a sound field image. Shape (num_freqs, num_image)

  • image_true (np.ndarray, optional) – True sound field on a grid array appropriate for creating a sound field image. Shape (num_freqs, num_image) If supplied along with images, the error between the images and the true value will be shown.

  • pos_image (np.ndarray, optional) – Positions of the image array. Shape (num_image, spatial_dim)

  • remove_freqs_below (float, optional) – Remove frequencies below this value in Hz. The default is 0.

  • remove_freqs_above (float; optional) – Remove frequencies above this value in Hz.

  • points_for_errors (np.ndarray of shape (num_positions,) with Boolean values, optional) – Points which have True values are included in error calculations. The default is None. It also specifies which points to use in setting of colormap limits in the soundfield MSE plots. Useful if a few points are known exactly, which usually leads to useless sound field MSE plots.