Skip to content

Commit

Permalink
Fixed handling of boundary events outside data range
Browse files Browse the repository at this point in the history
  • Loading branch information
widmann committed Feb 13, 2023
1 parent 5f13998 commit 4b2701d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Version 2.6.1
- BUG: fixed handling of boundary events outside data range.

Version 2.6
- BUG: fixed filter order not converted to numeric by GUI.

Expand Down
2 changes: 1 addition & 1 deletion eegplugin_firfilt.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

function vers = eegplugin_firfilt(fig, trystrs, catchstrs)

vers = 'firfilt2.6';
vers = 'firfilt2.6.1';
if nargin < 3
error('eegplugin_firfilt requires 3 arguments');
end
Expand Down
4 changes: 3 additions & 1 deletion firfilt.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@
EEG.data = reshape(EEG.data, [EEG.nbchan EEG.pnts * EEG.trials]);
dcArray = 1 : EEG.pnts : EEG.pnts * (EEG.trials + 1);
else % Continuous data
dcArray = [findboundaries(EEG.event) EEG.pnts + 1];
dcArray = findboundaries(EEG.event);
dcArray = dcArray( dcArray >= 1 & dcArray <= EEG.pnts ); % Assert DC offset events are within data range
dcArray = [ dcArray EEG.pnts + 1 ];
end

% Initialize progress indicator
Expand Down
4 changes: 3 additions & 1 deletion firfiltsplit.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@
EEG.data = reshape(EEG.data, [EEG.nbchan EEG.pnts * EEG.trials]);
dcArray = 1 : EEG.pnts : EEG.pnts * (EEG.trials + 1);
else % Continuous data
dcArray = [findboundaries(EEG.event) EEG.pnts + 1];
dcArray = findboundaries(EEG.event);
dcArray = dcArray( dcArray >= 1 & dcArray <= EEG.pnts ); % Assert DC offset events are within data range
dcArray = [ dcArray EEG.pnts + 1 ];
end

% Loop over continuous segments
Expand Down

0 comments on commit 4b2701d

Please sign in to comment.