function [basemean,baserms] = baselineAna(oldWaves)

    [~,s1w] = size(oldWaves(:,:,1));

    basemean = zeros( 4 , s1w );
    baserms = zeros( 4 , s1w );
    
    for i = 1:s1w
        
        basemean(1,i)= sum(oldWaves(1:100,i,1))/100.;
        basemean(2,i)= sum(oldWaves(1:100,i,2))/100.;
        basemean(3,i)= sum(oldWaves(1:100,i,3))/100.;
        basemean(4,i)= sum(oldWaves(1:100,i,4))/100.;
    
        basemeanSq(1,1)= sum(oldWaves(1:100,i,1).*oldWaves(1:100,i,1))/100.;
        basemeanSq(2,1)= sum(oldWaves(1:100,i,2).*oldWaves(1:100,i,2))/100.;
        basemeanSq(3,1)= sum(oldWaves(1:100,i,3).*oldWaves(1:100,i,3))/100.;
        basemeanSq(4,1)= sum(oldWaves(1:100,i,4).*oldWaves(1:100,i,4))/100.;
    
        baserms(1,i) = sqrt( basemeanSq(1,1) - basemean(1,i)*basemean(1,i) );
        baserms(2,i) = sqrt( basemeanSq(2,1) - basemean(2,i)*basemean(2,i) );
        baserms(3,i) = sqrt( basemeanSq(3,1) - basemean(3,i)*basemean(3,i) );
        baserms(4,i) = sqrt( basemeanSq(4,1) - basemean(4,i)*basemean(4,i) );
    end


end