Implementation of a phase and amplitude modulated π pulse for coherent optical spectroscopy