Skip to content

Commit

Permalink
Bugfix: Convert to LFP could encounter sample rounding issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Cousineau committed Dec 10, 2019
1 parent 1709f81 commit 41028dd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/license.html
Expand Up @@ -3,7 +3,7 @@

</head>
<body alink="#fff000" link="#fff000" vlink="#fff000">
<!-- LICENCE_START -->Version: 3.191209 (09-Dec-2019)<br>
<!-- LICENCE_START -->Version: 3.191210 (10-Dec-2019)<br>
<span style="font-style: italic;">COPYRIGHT &copy; 2000-2019
USC &amp; McGill University.<br>
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/version.txt
@@ -1,2 +1,2 @@
% Brainstorm
% v. 3.191209 (09-Dec-2019)
% v. 3.191210 (10-Dec-2019)
4 changes: 2 additions & 2 deletions toolbox/process/functions/process_convert_raw_to_lfp.m
Expand Up @@ -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);
Expand All @@ -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

Expand Down

0 comments on commit 41028dd

Please sign in to comment.