Application of cosmic microwave background techniques to a gravitational wave stochastic background