classdef (CaseInsensitiveProperties=true, TruncatedProperties=true) symfir < lwdfilt.abstractfirlinphase
%lwdfilt.symfir class
%   lwdfilt.symfir extends lwdfilt.abstractfirlinphase.

%    lwdfilt.symfir methods:
%       computephasedelay - PHASEDELAY   Calculate the phase delay.
%       reffilter -   Returns the double representation of the filter object.

methods 
    function H = symfir(num)
        %SYMFIR   Construct a SYMFIR object.

        if nargin > 0
            H.Numerator = num;
            H.refnum = num;
        end

    end  % symfir

    %----------------------------------------
    function [P, W] = computephasedelay(this,N,varargin)
        %PHASEDELAY   Calculate the phase delay.

        if nargin < 2
            N = 8192;
        end

        [P, W] = phasedelay(this.Numerator, ones(1,1,'like',this.Numerator), N, varargin{:});
        % Phase delay not defined at W=0
        P(W==0)=NaN;

    end  % computephasedelay

    %----------------------------------------
    function Hd = reffilter(this)
        %REFFILTER   Returns the double representation of the filter object.

        Hd = lwdfilt.symfir;
        Hd.Numerator = this.refnum;
        Hd.refnum = this.refnum;

    end  % reffilter

end
end  % classdef

