Generating periodic signals