Composition of propagated, reflected and transmitted waves in arbitrary and continuously stratified environments