Rod knock or something else?

The ticking/knocking noise sometimes goes away when idling, almost always gone when revving, sometimes comes back during low rpm and when releasing the gas pedal. I also have a P0420 engine code that came on roughly within the same week of this happening. This is also accompanied by a rattling noise (i am guessing it is a hole in the cat or manifold which I can do both myself) I just haven't fully investigated since it's been 18 degrees outside.