Acoustic propagation in ducts with varying cross sections