warning("winSincFracDel(): The length of the filter cannot be less than the delay, setting equal to 'delay',");
warning("winSincFracDel(): The length of the filter cannot be less than the delay, setting equal to 'delay',");
len=ceil(delay);
len=ceil(del);
end
end
else
else
len=ceil(delay);
len=ceil(del);
end
end
ifnargin>2&&~isempty(win)
ifnargin>2&&~isempty(winFun)
validateattributes(win,"numeric",{'nonnan','2d','real','finite','nrows',len},mfilename,"Window(s) to be applied",3);
validateattributes(winFun,{'char','string','numeric'},{'nonempty'},mfilename,"Window to be applied to the truncated sinc function (or the alpha parameter for a Kaiser window)",3);
ifischar(winFun)||isStringScalar(winFun)
validatestring(winFun,["Rectangular","Hann","Hamming"],mfilename,"Window to be applied to the truncated sinc function",3);
winFun=string(winFun);
elseifisscalar(winFun)
validateattributes(winFun,{'numeric'},{'nonempty','nonnan','finite','nonnegative','real','scalar'},mfilename,"Alpha parameter for a Kaiser window to be applied to the truncated sinc function",3);
end
else
else
win=ones(len,1);
winFun="rectangular";
end
end
ifnargin>3&&~isempty(sig)
ifnargin>3&&~isempty(sig)
validateattributes(sig,"numeric",{'2d','nonempty','real'},mfilename,"Signal(s) to be delayed",4);
validateattributes(sig,"numeric",{'2d','nonempty','real'},mfilename,"Signal(s) to be delayed",4);
ifsize(win,2)==1
ifsize(winFun,2)==1
win=repmat(win,1,size(sig,2));
winFun=repmat(winFun,1,size(sig,2));
else
else
ifsize(win,2)~=size(sig,2)
ifsize(winFun,2)~=size(sig,2)
error("Number of windows must match the number of signals provided");
error("Number of windows must match the number of signals provided");