Skip to content

Commit

Permalink
Filter non printable event markers (#43)
Browse files Browse the repository at this point in the history
* Pre-filter events from LUFR files to exclude ASCII < 32
  • Loading branch information
samuelpowell authored Nov 18, 2022
1 parent 150fdab commit 3d8b84d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions +lumofile/read_lufr.m
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,23 @@
events = [];
end

% Filter events (remove non printable characters)
evfilt = true(ne,1);
for i = 1:ne
if(length(events(i).mark) == 1)
if events(i).mark < char(32)
evfilt(i) = false;
end
end
end

events = events(evfilt);

if(sum(~evfilt) > 0)
fprintf('Filtering %d/%d invalid event markers from recording\n', sum(~evfilt), length(evfilt));
end


% Build data output structure
data = struct('chn_dat', chdat, ...
'chn_dt', tchdat*1e3, ...
Expand Down
2 changes: 1 addition & 1 deletion +lumomat/ver.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function [ver] = ver()
%LMVER Return the hard coded version of the package
ver = '1.6.0-dev';
ver = '1.5.1';
end

0 comments on commit 3d8b84d

Please sign in to comment.