diff --git a/+hw/+ptb/Window.m b/+hw/+ptb/Window.m index 1dc909eb..3971a96c 100644 --- a/+hw/+ptb/Window.m +++ b/+hw/+ptb/Window.m @@ -676,6 +676,8 @@ function applyCalibration(obj, cal) % correct the data clock = circshift(clock,[ishift,0]); + upCrossings = find(diff( clock > 1 ) == 1); + dnCrossings = find(diff( clock > 1 ) == -1); %% plot the data if makePlot @@ -684,10 +686,7 @@ function applyCalibration(obj, cal) figure; plot(tt,clock); ylabel('clock signal'); title('Clock'); - - upCrossings = find(diff( clock > 1 ) == 1); - dnCrossings = find(diff( clock > 1 ) == -1); - + figure; clf for iC = 1:length(upCrossings) plot(tt(upCrossings(iC))*[1 1],[0 5],'-', ...