Estimating the DOA with MUSIC - circular array

15 views (last 30 days)
Yui Harayama
Yui Harayama on 24 Feb 2024
Edited: Anay on 21 Feb 2025
Hi everyone,
I am very new to this and am trying to obtain the Direction of Arrival (DOA) of my signal of interest, which is a heart sound. I have a circular array of 4 microphones and am trying to estimate the DOA using the MUSIC algorithm. This is what I have written, however I get this error below. Does anyone know how to resolve this and can please confirm that my method of using pmusic to obtain the DOA from 4 microphone outputs is correct? Please let me know if there is any further description I should add, it is my first time asking a question on this community.
Error using musicOptions
Options must be character vectors or real, numeric, scalar or vector values.
[spectrum, angles_est] = pmusic([signal1 signal2 signal3 signal4], num_mics, array_response_circular, angles);
%% Estimating DOA
num_mics = 4; % Number of microphones
radius = 4.5; % Radius of the circular array
d = 4.5; % distance between mics
signal1 = filtered_signal_array{2}
signal2 = filtered_signal_array{3}
signal3 = filtered_signal_array{4}
signal4 = filtered_signal_array{5}
% Define polar coordinates for the microphones
% theta = linspace(0, 2*pi, num_mics + 1);
theta = [0, pi/2, pi, 3*pi/2];
mic_positions = [radius * cos(theta(1:end)); radius * sin(theta(1:end)); zeros(1, num_mics)].';
c = physconst('LightSpeed');
fs = 44100;
lambda = c / fs; % Wavelength corresponding to 1 kHz
% Array response function for a circular array
array_response_circular = @(theta) exp(-1i * 2 * pi * d * (0:num_mics-1).' * sind(theta) / lambda);
angles = 0:1:360; % Specify the range of possible angles
[spectrum, angles_est] = pmusic([signal1 signal2 signal3 signal4], num_mics, array_response_circular, angles);
% Plot the spectrum
figure;
plot(angles_est, 10 * log10(spectrum));
xlabel('Angle (degrees)');
ylabel('Power/Frequency (dB/Hz)');
title('MUSIC Spectrum');
% Identify peaks to estimate DOA
[peaks, locs] = findpeaks(10 * log10(spectrum), 'MinPeakHeight', -20); % Adjust threshold as needed
estimated_DOA = angles_est(locs);

Answers (1)

Anay
Anay on 21 Feb 2025
Edited: Anay on 21 Feb 2025
Hi Yui,
I understand that you are facing an issue while using the “pmusic” function to determine the Direction Of Arrival (DOA) of your desired signal. The issue you are facing is due to incorrect arguments passed to the “pmusic” function.
The error “Options must be character vectors or real, numeric, scalar or vector values.” arises because array_response_circular” is a function handle and “pmusic” has no definition which accepts input in such format.
The “pmusic” function can be called in several ways by specifying different set of options. You can use the following command in the MATLAB command window to take look at the “pmusic” documentation for determining what options are the most optimal for your case:
>> doc pmusic
I hope this solves the issue!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!