Skip to content
Snippets Groups Projects
Commit 5dc9385d authored by Achilles Kappis's avatar Achilles Kappis
Browse files

Added different DMA desings for 2D and 3D diffuse sound fields

parent 771e83fe
No related branches found
No related tags found
No related merge requests found
......@@ -27,15 +27,23 @@
% - Omni, Omnidirectional,
% Monopole
% - Dipole, Figure-of-Eight
% - Cardioid
% - Hypercardioid
% - Supercardioid
% - Cardioid, Cardio
% - Hypercardioid, Hyper,
% Hypercardioid2D, Hyper2D,
% Hypercardioid3D, Hyper3D
% - Supercardioid, Super,
% Supercardioid2D, Super2D,
% Supercardioid3D, Super3D
% It can also be a numeric value
% representing the angle for
% which the response is
% specified (input parameter
% "beta") in degrees.
% [Default: Dipole]
% "beta") in degrees. For more
% information on the differences
% between the 2D and 3D versions
% of the Hyper- and
% Super-cardioids see the notes
% below. [Default: Dipole]
%
% beta [numeric] (Optional): The (normalised to unity) response at the
% angle specified with teh parameter "pPattern".
......@@ -63,6 +71,18 @@
% --------------------------------------------------
% Notes
%
% - 2D and 3D versions: The directional patterns of the Hypercardioid and
% Supercardioid are based on the optimisation of the
% Directivity Index/Factor (DI/DF) and the
% Front-to-Back Ratio (FBR). However, the results
% depend on the type of the considered noise field.
% Thus, the desings that optimise these metrics are
% different for the spherically (3D) and
% the cylindrically (2D) diffuse fields. The
% available values without a dimension (either 2D or
% 3D) correspond to the spherically diffuse sound
% field (3D case).
%
% --------------------------------------------------
function [h, output] = firstOrderDma(freq, d, pPattern, beta, input)
% ====================================================
......@@ -100,6 +120,11 @@ function [h, output] = firstOrderDma(freq, d, pPattern, beta, input)
if nargin > 2 && ~isempty(pPattern)
if isstring(pPattern) || ischar(pPattern)
validateattributes(pPattern, {'char', 'string'}, {'scalartext', 'nonempty'}, mfilename, 'Polar pattern', 3);
validatestring(pPattern, ["Omni", "Omnidirectional", "Monopole", ...
"Dipole", "Figure-of-Eight", ...
"Cardioid", "Cardio", ...
"Hypercardioid", "Hyper", "Hypercardoid2d", "Hyper2d", "Hypercardoid3d", "Hyper3d", ...
"Supercardioid", "Super", "Supercardoid2d", "Super2d", "Supercardoid3d", "Super3d"])
elseif isnumeric(pPattern)
validateattributes(pPattern, {'numeric'}, {'scalar', 'real', 'nonnan', 'finite', 'nonempty'}, mfilename, 'Angle of null', 3);
end
......@@ -129,13 +154,19 @@ function [h, output] = firstOrderDma(freq, d, pPattern, beta, input)
case {'dipole', 'figure-of-eight'}
pPattern = pi/2;
beta = 0;
case 'cardioid'
case {'cardioid', 'cardio'}
pPattern = -pi;
beta = 0;
case 'hypercardioid'
case {'hypercardioid', 'hyper', 'hypercardioid3d', 'hyper3d'}
pPattern = acos(-1/3);
beta = 0;
case {'hypercardioid2d', 'hyper2d'}
pPattern = (2 * pi/3);
beta = 0;
case 'supercardioid'
case {'supercardioid', 'super', 'supercardioid3d', 'super3d'}
pPattern = deg2rad(125);
beta = 0;
case {'supercardioid2d', 'super2d'}
pPattern = (3 * pi/4);
beta = 0;
otherwise
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment