Modified create_stimulus to add an offset in the sine function.