function [EMG]=waveformLengthAll(sig,bci_sf,windowEMG,shiftEMG)
% waveformLengthAll computes waveformlength after filtering sig

    %Filter around 50Hz and below 2 Hz
    [A,B]= butter(2,[48 52]/(bci_sf/2),'stop');
    [C,D]= butter(2,1/(bci_sf/2),'high');
    [E,F]= butter(2,[148 152]/(bci_sf/2),'stop');

    signalWindow=bci_sf*windowEMG;
    shiftProp=windowEMG/shiftEMG;
    EMG=zeros((floor(size(sig,1)/signalWindow)-1)*shiftProp+1,size(sig,2));
    parfor i=1:size(sig,2)
        EMG(:,i)=waveformLength(filtfilt(double(E),double(F),filtfilt(double(C),double(D),filtfilt(double(A),double(B),double(sig(:,i))))),bci_sf,windowEMG,shiftEMG);
    end
end