On the reflection of waves from a stratum of gradually varying properties, with application to sound