You'll likely need a shop manual or a detailed diagram specific to your year and engine to pinpoint it precisely. A picture search online for "2003 Impala 3.4L knock sensor location" might also be helpful. Be cautious when searching, as some diagrams might be for different engine variations.
Remember to consult a repair manual before attempting any repairs, as working on the engine can be complex.