From 41028dd1112e518e2b3e825a4b093ee4283a1402 Mon Sep 17 00:00:00 2001 From: Martin Cousineau Date: Tue, 10 Dec 2019 10:47:48 -0500 Subject: [PATCH] Bugfix: Convert to LFP could encounter sample rounding issues --- doc/license.html | 2 +- doc/version.txt | 2 +- toolbox/process/functions/process_convert_raw_to_lfp.m | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/license.html b/doc/license.html index c42197140..34a812009 100644 --- a/doc/license.html +++ b/doc/license.html @@ -3,7 +3,7 @@ -Version: 3.191209 (09-Dec-2019)
+Version: 3.191210 (10-Dec-2019)
COPYRIGHT © 2000-2019 USC & McGill University.
diff --git a/doc/version.txt b/doc/version.txt index d715ac584..3690e5562 100644 --- a/doc/version.txt +++ b/doc/version.txt @@ -1,2 +1,2 @@ % Brainstorm -% v. 3.191209 (09-Dec-2019) \ No newline at end of file +% v. 3.191210 (10-Dec-2019) \ No newline at end of file diff --git a/toolbox/process/functions/process_convert_raw_to_lfp.m b/toolbox/process/functions/process_convert_raw_to_lfp.m index f0011d4fd..18ec91a85 100644 --- a/toolbox/process/functions/process_convert_raw_to_lfp.m +++ b/toolbox/process/functions/process_convert_raw_to_lfp.m @@ -332,7 +332,7 @@ data_deligned_temp = [data_deligned;0]; g = fitLFPpowerSpectrum(data_deligned_temp,filterBounds(1),filterBounds(2),sFile.prop.sfreq); S = zeros(length(data_deligned_temp),1); - iSpk = spkSamples - round(nSegment/2); + iSpk = round(spkSamples - nSegment/2); iSpk = iSpk(iSpk > 0); % Only keep positive indices S(iSpk) = 1; % This assumes the spike starts at 1/2 before the trough of the spike data_derived = despikeLFP(data_deligned_temp,S,Bs,g,opts); @@ -343,7 +343,7 @@ else g = fitLFPpowerSpectrum(data_deligned,filterBounds(1),filterBounds(2),sFile.prop.sfreq); S = zeros(length(data_deligned),1); - iSpk = spkSamples - round(nSegment/2); + iSpk = round(spkSamples - nSegment/2); iSpk = iSpk(iSpk > 0); % Only keep positive indices S(iSpk) = 1; % This assumes the spike starts at 1/2 before the trough of the spike