Sounds like the knock sensor retarding ignition. So, either the knock sensor is crapping out which is moderately common OR you are running dud fuel and the knock sensor is doing it's job.
Pull the sensor to test or pull the sensor off the block (cabled tied off the rear valence for example) but still plugged into the loom....that way it won't hear the knock and won't retard. just be careful though as you'll have to pick the knock yourself