aspcol.planewaves.find_matching_plane_wave
- aspcol.planewaves.find_matching_plane_wave(plane_wave_data, freq, pw_dir, pos_mic, c)
Matches a plane wave to the given data
The function returns directly the sound pressure of the matched plane wave, but also enough information for the plane wave to be recreated as gain_adjustment * pw.plane_wave(pos_mic, pw_dir, wave_num, exp_center)
- Parameters:
plane_wave_data (ndarray of shape (num_mic, 1)) – data from a plane wave or plane-wave like sound field that should be matched by the analytic plane wave
freq (float) – frequency of the plane wave
pw_dir (ndarray of shape (1, 3)) – Direction from which the plane wave is incoming. Must be a unit vector
pos_mic (ndarray of shape (num_mic, 3)) – positions of the microphones (the points where the plane wave and the plane_wave_data are measured)
c (float) – speed of sound
- Returns:
p_mic_analytic (ndarray of shape (num_mic, 1)) – the sound pressure at pos_mic of the analytic plane wave that matches the plane_wave_data. If plane_wave_data is a plane wave or very close, then p_mic_analytic should be essentially identical to plane_wave_data
exp_center (ndarray of shape (1, 3)) – the expansion center of the plane wave
gain_adjustment (float) – A gain adjustment that should be applied to the analytic plane wave to match the plane_wave_data
Notes
The gain adjustment is found as the mean amplitude of the plane_wave_data.
The phase adjustment is found as the solution to $lVert e^{i gamma} bm{p} - bm{s} rVert_2^2$, where $bm{p}$ is the vector of analytic pressure values and $bm{s}$ is the vector of plane_wave_data. The solution is found analytically by taking the derivative and setting to zero.
The expansion center is defined by $exp(-ik(r-r_c)^T d) = exp(-i gamma) exp(ikr^T d)$, where r_c is the unknown expansion center and the phase adjustment gamma is found by the algorithm. Since that relationship is not necessarily unique, the expansion center is found as min lVert r_c rVert_2^2 subject to r_c^T d = gamma / wave_num, which is a least squares problem with linear constrained, solved analytically using the Lagrange multiplier method.