Here are some codes (Python, and Fortran) to analyze multiply reflected P waves