Smoking guns of a bounce in modified theories of gravity through the spectrum of gravitational waves