Skip to content

Commit

Permalink
Fixes example by defining IIR Butterworth filter for comparison with …
Browse files Browse the repository at this point in the history
…non-causal method.
  • Loading branch information
temertylab authored and temertylab committed Jan 16, 2025
1 parent 4645e5a commit f3ef50a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions toolbox/examples/demo_phase_prediction_error_simple.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@
%% Phase error using standard non-causal methods
disp('Determining phase using standard non-causal methods...');

% Obtain applied filter
oscBPFcoeffs = bd.getparam('OSC/alpha', 'bpf_fir_coeffs');
% Prepare IIR Butterworth filter
peakFrequency = 10;
oscBPFfilter = designfilt('bandpassiir','FilterOrder',12,'HalfPowerFrequency1',peakFrequency-2,...
'HalfPowerFrequency2',peakFrequency+2,'SampleRate',osc_alpha_ip.Properties.SampleRate,'DesignMethod','butter');

% Compute phase prediction error
[phaseError, meanError, meanDev] = bossapi.boss.computePhasePredictionError(oscBPFcoeffs,...
[phaseError, meanError, meanDev] = bossapi.boss.computePhasePredictionError(oscBPFfilter,...
syncedData.spf_sig_idx1(1+numSamples:end-1), syncedData.osc_idx1(2:end-numSamples));

disp('Done.');
Expand Down

0 comments on commit f3ef50a

Please sign in to comment.