Skip to content

Commit

Permalink
Merge pull request #20 from myersm0/patch-1
Browse files Browse the repository at this point in the history
Update dcan_signal_processing.m to include padding for bandpass filter
  • Loading branch information
perronea authored Dec 8, 2022
2 parents 5e76a00 + a80e94e commit 8384531
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion matlab_code/dcan_signal_processing.m
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,12 @@ function dcan_signal_processing(config_path)
BW_Hz = [lp_Hz hp_Hz];
BW_N = BW_Hz/Ny;
[b, a] = butter(ceil(bp_order/2),BW_N);
Y = filtfilt(b,a,Rr_int);
% zero-pad the data for filtering by concatenating rows of zeros on either side of the data
padding = zeros(size(Rr_int));
pad_amt = size(padding,1);
temp = cat(1,padding,Rr_int,padding);
Y = filtfilt(b,a,temp);
Y = Y((pad_amt+1):(end-pad_amt), :);
DVAR_post_all = dvars_from_cifti(Y);

% Quick visualization of results
Expand Down

0 comments on commit 8384531

Please sign in to comment.