First check your owner’s manual for what it says about the octane rating of the gasoline. It it uses the word “required” and names something like 89 or 92 or something then make sure you’re using the right gasoline.
Regardless of what it says you could run a few tanks of higher octane gas to see if the noise goes away.