Skip to content

Commit 8555750

Browse files
committed
Change signal to measure spf_sig to match time reference vector.
1 parent b06e7fc commit 8555750

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

toolbox/examples/demo_phase_prediction_error_simple.m

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
%% Configuring an instrument buffer to acquire data
2727
instObj = slrealtime.Instrument;
28-
instObj.addSignal('spf_sig');
28+
instObj.addSignal('spf_sig_500Hz');
2929
instObj.addSignal('osc','BusElement','alpha.ip');
3030
instObj.BufferData = true;
3131

@@ -42,21 +42,15 @@
4242

4343
% Extract data and downsample fast signal
4444
osc_alpha_ipData = sigData{1}.data;
45-
spf_sigData = downsample(squeeze(sigData{2}.data)',2);
45+
spf_sigData = squeeze(sigData{2}.data)';
4646

4747
% Compute sample frequency
4848
fs = 1/mean(diff(sigData{1}.time));
4949

5050
% Compensante offset in instantaneous predicted phase
5151
numSamples = 3;
5252
osc_alpha_ipData = osc_alpha_ipData(1+numSamples:end,:);
53-
54-
% Use same number of samples from SPF
55-
if size(osc_alpha_ipData,1) > size(spf_sigData,1)
56-
osc_alpha_ipData = osc_alpha_ipData(1:size(spf_sigData,1),:);
57-
else
58-
spf_sigData = spf_sigData(1:size(osc_alpha_ipData,1),:);
59-
end
53+
spf_sigData = spf_sigData(1:size(osc_alpha_ipData,1),:);
6054

6155

6256
%% Phase error using standard non-causal methods

0 commit comments

Comments
 (0)