diff --git a/preprocessing/binary/trim_dat_all.m b/preprocessing/binary/trim_dat_all.m index a7cb9c0..83c7fa8 100644 --- a/preprocessing/binary/trim_dat_all.m +++ b/preprocessing/binary/trim_dat_all.m @@ -13,7 +13,7 @@ %% User defines intervals of time to remove (in samples interval_i by [start, end] ) -bad_intervals = ... +bad_intervals = [],... [11612.2, 11890.2]; basepath = pwd; @@ -53,25 +53,26 @@ % write auxiliary file d = dir('auxiliary_original.dat'); nChannels = double(int64(d.bytes/2/nSamp)); -data = memmapfile('auxiliary_original.dat', 'Format', {'int16', [nChannels, nSamp], 'x'}); +data = memmapfile('auxiliary_original.dat', 'Format', {'uint16', [nChannels, nSamp], 'x'}); f = fopen('auxiliary.dat', 'w'); -fwrite(f, data.Data.x(:, idx), 'int16'); +fwrite(f, data.Data.x(:, idx), 'uint16'); fclose(f); % write digitalin file d = dir('digitalin_original.dat'); nChannels = double(int64(d.bytes/2/nSamp)); -data = memmapfile('digitalin_original.dat', 'Format', {'int16', [nChannels, nSamp], 'x'}); +data = memmapfile('digitalin_original.dat', 'Format', {'uint16', [nChannels, nSamp], 'x'}); f = fopen('digitalin.dat', 'w'); -fwrite(f, data.Data.x(:, idx), 'int16'); +fwrite(f, data.Data.x(:, idx), 'uint16'); fclose(f); % write time file +error('This part of the script does not reset time') d = dir('time_original.dat'); nChannels = double(int64(d.bytes/2/nSamp)); -data = memmapfile('time_original.dat', 'Format', {'int16', [nChannels, nSamp], 'x'}); +data = memmapfile('time_original.dat', 'Format', {'int32', [nChannels, nSamp], 'x'}); f = fopen('time.dat', 'w'); -fwrite(f, data.Data.x(:, idx), 'int16'); +fwrite(f, data.Data.x(:, idx), 'int32'); fclose(f); %%%%%% Local function below