A wave-envelope technique for wave propagation in non-uniform ducts