Resonance spectrum for a continuously stratified layer: application to ultrasonic testing