core: move excitation generation in a separate function to make it easier to switch to other excitation models