Moves the pitch prefiltering code to a separate function