function [ChunkStack] = genChunksTest_Seq(ecgSig, RpeaksVM, SC)

RpeaksChunk = RpeaksVM;
totalBeats = sum(RpeaksChunk);
rind = find(RpeaksChunk == 1);


si = find(rind>350);
ei = find(rind+350<length(ecgSig));
tk = 1;
for ind = si(1):ei(end)
    bv = ecgSig(rind(ind)-350:rind(ind)+350);
    
    beatVec(:,tk) = bv;%resample(bv, 200, length(bv));
    tk = tk+1;
end

beatVecr = beatVec;

if(size(beatVec,2)<SC)
    tid = 1;
    ChunkStack = [];
    return;     
%     for fill_id = size(beatVec,2)+1:SC+1
%         beatVecr(:,fill_id) = beatVec(:,tid);
%         tid = tid+1;
%         if(tid > size(beatVec,2))
%              tid = 1;
%         end
%     end
end

ChunkStack = [];

for ind = 1:size(beatVecr,2)-SC
    ChunkStack(:,:,ind) = beatVecr(:,ind:ind+SC)';
end

css = size(ChunkStack, 3);

if(css>90)
    ChunkStack = ChunkStack(:,:,1:3:end);
elseif(css>50)
    ChunkStack = ChunkStack(:,:,1:2:end);
end

end