function val = findSupportedArchit(this, architType)
%FINFDSUPPORTEDARCHIT Find out if specified architecture is supported for filtobj.

% Copyright 2010-2023 The MathWorks, Inc.
%

val = [];
filtobj = this.filterObj;

% no options for zero order FIR
if (isa(filtobj, 'dfilt.dffir')...
|| isa(filtobj, 'dfilt.dfsymfir')...
|| isa(filtobj, 'dfilt.dfasymfir')) ...
&& any(strcmpi(fieldnames(get(filtobj)),'Arithmetic')) && strcmpi(filtobj.arithmetic, 'fixed')
% DA only if there is more than 1 coefficient
if length(filtobj.Numerator) < 2
return;
end
end

switch architType
case 'FullySerial'
if isa(filtobj, 'dfilt.dffir')...
|| isa(filtobj, 'dfilt.dfsymfir')...
|| isa(filtobj, 'dfilt.dfasymfir')...
|| isa(filtobj, 'dsp.internal.mfilt.firdecim')...
|| isa(filtobj, 'dsp.internal.mfilt.firinterp')...
|| isa(filtobj, 'dfilt.df1sos')...
|| isa(filtobj, 'dfilt.df2sos')
val = 'Fully serial';
end
case 'PartlySerial'
if isa(filtobj, 'dfilt.dffir')...
|| isa(filtobj, 'dfilt.dfsymfir')...
|| isa(filtobj, 'dfasymfir')...
|| isa(filtobj, 'dsp.internal.mfilt.firdecim') ...
|| isa(filtobj, 'dsp.internal.mfilt.firinterp') ...
|| isa(filtobj, 'dfilt.df1sos') ...
|| isa(filtobj, 'dfilt.df2sos')
val = 'Partly serial';
end
case 'CascadeSerial'
if isa(filtobj, 'dfilt.dffir')...
|| isa(filtobj, 'dfilt.dfsymfir')...
|| isa(filtobj, 'dfasymfir')
val = 'Cascade serial';
end
case 'DA'
if isa(filtobj, 'dfilt.df1sos') || isa(filtobj, 'dfilt.df2sos') ||...
~isreal(filtobj.Numerator)
return;
end
if (isa(filtobj, 'dfilt.dffir')...
|| isa(filtobj, 'dfilt.dfsymfir')...
|| isa(filtobj, 'dfilt.dfasymfir')...
|| isa(filtobj, 'dsp.internal.mfilt.firdecim')...
|| isa(filtobj, 'dsp.internal.mfilt.firinterp'))...
&& any(strcmpi(fieldnames(get(filtobj)),'Arithmetic')) && strcmpi(filtobj.arithmetic, 'fixed')
val = 'Distributed arithmetic (DA)';
end
end

% [EOF]