Sounds like detonation to me. What grade gas are you running? If it is detonation, you will definitely see a power loss when the knock sensor tells the computer about it, and the computer retards the timing to try and stop it.
If you are not running high octane try a tankful to see it it helps. That is not the correct fix, but its a good easy way to test for knock.
If it goes away or gets better with the high octane gas, you need to find out why its doing it.
Timing is off, its running real lean for some reason, or maybe an EGR problem.