function subtractBaselineAllChannels(baseline, average) {
    let absBaseline = [];

    baseline.forEach(function(baselineSample) {
        let element = Math.abs(mathFunctions.getAverage(baselineSample));
        absBaseline.push(element);
    });

    let result = [];

    absBaseline.forEach(function(absSample, index) {
        if (average[index] > 0) {
            result.push(average[index] - absSample);
        } else {
            result.push(average[index] + absSample);
        }
    });
    return result;
}
/**
 * returns average minus baseline averages for all Channels
 *
 */
returns average minus baseline averages for all Channels
returns average minus baseline averages for all Channels
function subtractBaselineAllChannels(baseline, average) {
    let absBaseline = [];
    baseline.forEach(function(baselineSample) {
        let element = Math.abs(mathFunctions.getAverage(baselineSample));
        absBaseline.push(element);
    });
    let result = [];
    absBaseline.forEach(function(absSample, index) {
        if (average[index] > 0) {
            result.push(average[index] - absSample);
        } else {
            result.push(average[index] + absSample);
        }
    });
    return result;
}
function subtractBaselineAllChannels ( baseline , average ) { let absBaseline = [ ] ; baseline . forEach ( function ( baselineSample ) { let element = Math . abs ( mathFunctions . getAverage ( baselineSample ) ) ; absBaseline . push ( element ) ; } ) ; let result = [ ] ; absBaseline . forEach ( function ( absSample , index ) { if ( average [ index ] > 0 ) { result . push ( average [ index ] - absSample ) ; } else { result . push ( average [ index ] + absSample ) ; } } ) ; return result ; }
returns average minus baseline averages for all Channels
returns average minus baseline averages for all Channels