The occurrence of stress waves with complex waveforms serves as a critical inducing factor and energy transmission carrier in various underground dynamic disasters. Therefore, the development of testing methods and equipment that excites complex stress waveforms, and application in laboratory and field tests, are crucial in advancing our understanding of rock dynamics. In this study, a split Hopkinson pressure bar (SHPB) impact testing system has been used as excitation equipment for complex stress waves and an effective excitation scheme to generate an arbitrary waveform is established. Large random data sets of striker outlines and the corresponding waveform data sets are generated using an efficient discrete bead-string model. In addition, a BPNN-RNN scheme is designed to train the inversion model from waveform set to striker outline set. The results of numerical and laboratory impact tests have shown that the training algorithm delivered excellent inversion accuracy for complex stress waveforms, and the turn-milled striker bars based on the inversion results excited the requisite waveforms in the SHPB system. Stress waves with equal energy and different waveforms result in significantly different impact failure patterns in sandstone samples.