1% bf = bf_array_circ(bf) 2% 3% Inputs 4% bf.mic_n ... number of microphones 5% bf.mic_r ... radius of circular array [m] 6% 7% Outputs 8% bf.mic_x ... x coordinates [m] 9% bf.mic_y ... y coordinates [m] 10% bf.mic_z ... z coordinates [m] 11 12% SPDX-License-Identifier: BSD-3-Clause 13% 14% Copyright (c) 2020, Intel Corporation. All rights reserved. 15% 16% Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> 17 18function bf = bf_array_circ(bf) 19 20bf.mic_angle = (0:bf.mic_n-1)*360/bf.mic_n; % Mic 1 at 0 deg 21idx = find(bf.mic_angle > 180); % wrap > 180 deg to -180 .. 0 22bf.mic_angle(idx) = bf.mic_angle(idx)-360; 23bf.mic_x = bf.mic_r*cosd(bf.mic_angle); 24bf.mic_y = bf.mic_r*sind(bf.mic_angle); 25bf.mic_z = zeros(1,bf.mic_n); 26bf.mic_d = sqrt((bf.mic_x(1)-bf.mic_x(2))^2+(bf.mic_y(1)-bf.mic_y(2))^2); 27 28end 29