% first, load the data data = xff('*.ntt'); % then z-transform the third column (in our case) and take the 4th power pdata = ztrans(data.Data(:, 3)) .^ 4; % pre-detect beats % since we used the 4th power, the skew detection threshold must be lowered % and our signal has short spikes, so the detection length threshold also! bp = heartbeats(pdata, struct( ... 'skewdt', 0.05, ... 'detlength', 0.01, ... 'freq', 500)); % then pass this along with the actual signal back in [bp, bs, bf, bv, cp, wgd, wd] = heartbeats(data.Data(:, 3), struct( ... 'bppre', bp, ... 'cleanup', true, ... 'freq', 500, ... 'plot', true));