function [QRSwidthSig, QRSwidth] = genQRSwidth(ChunkBeatVecOTHR)
ChunkBeatVecOTHR = mean(ChunkBeatVecOTHR,2);
Rleft = ChunkBeatVecOTHR(64:-1:20);
Rright = ChunkBeatVecOTHR(66:110);

Lbound = find(abs(Rleft)<0.2);
if(numel(Lbound)==0)
    idL = length(Rleft);
else
    LboundSort = sort(Lbound, 'ascend');
    idL = Lbound(1);
end
Rbound = find(abs(Rright)<0.2);
if(numel(Rbound)==0)
    idR = length(Rright);
else
    RboundSort = sort(Rbound, 'ascend');
    idR = Rbound(1);
end
QRSwidth = idR+idL;

QRSwidthSig = zeros(size(ChunkBeatVecOTHR));
QRSwidthSig(65-idL+1:65+idR-1) = 1;
end