function [out]=shiftingDownsample(signal,frequency,windowEEG,shift,noSamples)
% shiftingDownsample downsamples in shifting windows
    signalShift=frequency*shift;
    signalWindow=frequency*windowEEG;
    shiftProp=windowEEG/shift;
    noOfWindows=fix(floor(size(signal,1)/signalWindow-1)*shiftProp+1);
    out=zeros([noOfWindows,noSamples]);
    for j=1:noOfWindows
        out(j,:)=myDownsample(signal((j-1)*signalShift+1:(j-1)*signalShift+signalWindow),noSamples);
    end
end