function [ANN_WABP, BeatQ] = getWABPjSQI(BP, Fs)

for i=1:10
    if mod(Fs*i, 1)==0 %if integer
        break;
    end
end

BP125 = resample(BP, 125*i, Fs*i);

OnsetTimes = wabp2(BP125);
if length(OnsetTimes)>2
    features = abpfeature(BP125,OnsetTimes);
    [BeatQ, r] = jSQI(features, OnsetTimes, BP125);
    
    if isempty(BeatQ)
        ANN_WABP = nan;
        BeatQ = nan;
    else
        ANN_WABP = round(OnsetTimes/125*Fs);
        BeatQ = BeatQ(:,1);
    end
else
    ANN_WABP = nan;
    BeatQ = nan;
end
