Skip to content

Commit

Permalink
sig.envelope.after: 'Smooth' , 'Gauss'
Browse files Browse the repository at this point in the history
Bug in 'Smooth': the output signal was not cropped correctly. 'Gauss' output is cropped so that its length is the same as the input
  • Loading branch information
olivierlar committed Nov 28, 2019
1 parent 45c0104 commit 469769e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions +sig/+envelope/after.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% SIG.ENVELOPE.AFTER
%
% Copyright (C) 2014, 2017-2018 Olivier Lartillot
% Copyright (C) 2014, 2017-2019 Olivier Lartillot
% All rights reserved.
% License: New BSD License. See full text of the license in LICENSE.txt in
% the main folder of the MiningSuite distribution.
Expand Down Expand Up @@ -72,11 +72,12 @@

function x = smooth(x,n)
x = filter(ones(1,n),1,[x;zeros(n,1)]);
x = x(1+ceil(n/2):end-floor(x/2));
x = x(1+ceil(n/2):end-floor(n/2));
end


function x = gausssmooth(x,sigma,gauss)
x = filter(gauss,1,[x;zeros(4*sigma,1)]);
x = x(4*sigma:end);
function y = gausssmooth(x,sigma,gauss)
y = filter(gauss,1,[x;zeros(4*sigma,1)]);
y = y(4*sigma:end);
y = y(1:length(x));
end

0 comments on commit 469769e

Please sign in to comment.