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

Fixed bug throwing error when 5 output arguments were asked for and output...

Fixed bug throwing error when 5 output arguments were asked for and output argument order in winSincFracDel function
parent a82ee57a
No related branches found
No related tags found
No related merge requests found
...@@ -87,7 +87,7 @@ function [delFilt, intDel, causalFilt, delSig, causalSig] = winSincFracDel(delay ...@@ -87,7 +87,7 @@ function [delFilt, intDel, causalFilt, delSig, causalSig] = winSincFracDel(delay
% Check for number of arguments % Check for number of arguments
% ==================================================== % ====================================================
narginchk(1, 5); narginchk(1, 5);
nargoutchk(0, 4); nargoutchk(0, 5);
% ==================================================== % ====================================================
% Validate input arguments % Validate input arguments
...@@ -152,21 +152,19 @@ function [delFilt, intDel, causalFilt, delSig, causalSig] = winSincFracDel(delay ...@@ -152,21 +152,19 @@ function [delFilt, intDel, causalFilt, delSig, causalSig] = winSincFracDel(delay
% ==================================================== % ====================================================
% Filter the signals % Filter the signals
% ==================================================== % ====================================================
% Return the shifted filter
if nargout > 2 if nargout > 2
for idx = size(sig, 2):-1:1 causalFilt = delFilt(intDel:end);
delSig(:, idx) = conv(sig, delFilt, "full");
end
else
delSig = [];
end end
% Return the shifted filter
if nargout > 3 if nargout > 3
causalFilt = delFilt(intDel:end); for idx = size(sig, 2):-1:1
delSig(:, idx) = conv(sig, delFilt, "full");
end
end end
% Shift signal to the left by the amount of the "causal" delay of the filter % Shift signal to the left by the amount of the "causal" delay of the filter
if nargout > 3 if nargout > 4
causalSig = delSig(intDel:end, :); causalSig = delSig(intDel:end, :);
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment