itaSource

-now has sensitivity type that can be used to set a flat frequency response
parent c85b5293
......@@ -14,12 +14,13 @@ classdef itaSource < itaSpatialSimulationInputItem
% </ITA-Toolbox>
properties(Access = protected, Hidden = true)
mWaveTf; %itaSuper
mPressureTf; %itaSuper
mDirectivity; %itaSuper
mDirectivityFile; %Char vector
mType = SourceType.PointSource; %SourceType
mPistonRadius; %Double scalar
mWaveTf; %itaSuper
mPressureTf; %itaSuper
mDirectivity; %itaSuper
mDirectivityFile; %Char vector
mType = SourceType.PointSource; %SourceType
mSensitivityType = SensitivityType.UserDefined %SensitivityType
mPistonRadius; %Double scalar
end
properties(Dependent = true, SetAccess = private)
......@@ -29,6 +30,7 @@ classdef itaSource < itaSpatialSimulationInputItem
end
properties(Dependent = true)
type; %Iindicates what the wave TF represents - PointSource, Piston, SurfaceDistribution (see SourceType)
sensitivityType; %Switch between a flat frequency response and a user-defined one.
volumeFlowTf; %volume flow transfer function of the point source used for wave-based simulations
velocityTf;
......@@ -54,6 +56,19 @@ classdef itaSource < itaSpatialSimulationInputItem
end
end
%% Sensitivity Type
methods
function this = set.sensitivityType(this, sensitivityType)
assert(isa(sensitivityType, 'SensitivityType') && isscalar(sensitivityType), 'Can only assign a single object of type SensitivityType')
if this.mSensitivityType == sensitivityType; return; end
this.mSensitivityType = sensitivityType;
end
function out = get.sensitivityType(this)
out = char(this.mSensitivityType);
end
end
%% GA Properties
%------Set-------------------------------------------------------------
methods
......@@ -232,10 +247,10 @@ classdef itaSource < itaSpatialSimulationInputItem
end
function bool = HasPressureTf(this)
bool = arrayfun(@(x) ~isempty(x.mPressureTf), this);
bool = arrayfun(@(x) ~isempty(x.mPressureTf), this) | this.tfDefinedByType();
end
function bool = HasWaveTf(this)
bool = arrayfun(@(x) ~isempty(x.mWaveTf), this);
bool = arrayfun(@(x) ~isempty(x.mWaveTf), this) | this.tfDefinedByType();
end
function bool = HasDirectivity(this)
bool = arrayfun(@(x) ~isempty(x.mDirectivityFile), this);
......@@ -267,6 +282,11 @@ classdef itaSource < itaSpatialSimulationInputItem
bool = arrayfun(@(x) x.HasVelocityTf() && x.itaSuperHasCoordinates(x.velocityTf), this);
end
end
methods(Access = private)
function bool = tfDefinedByType(this)
bool = arrayfun(@(x) isequal(x.mSensitivityType, SensitivityType.Flat), this);
end
end
methods(Access = private, Static = true)
function bool = itaSuperHasCoordinates(obj)
bool = ~any(any(isnan( obj.channelCoordinates.cart )));
......
classdef SensitivityType
%SensitivityType Summary of this class goes here
% Detailed explanation goes here
enumeration
UserDefined, Flat;
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment