Knock detection is best performed within a pretty small window of crank rotation (to avoid looking at extraneous noise) and within a frequency range appropriate for the bore diameter. For instance, older Toyota shop manuals used to identify the knock sensor frequency (marked on the sensor shell), wherein the smaller bore car engines might have knock sensors for 7.7 kHz or even 8.2kHz, and larger bores could need knock detection down in the 7.2 kHz range.
The problem of knock detection at high rpm is somewhat affected by processor speed. Our older KNK detection typically wouldnt work above about 7200 rpm on a 4-cylinder, about 6200 on a 6-cylinder, and about 5200 on a V8. Gentlemen... I am growing old and may have some errors in my recollections...and newer KNK systems are using much better planar type sensors.
Mechanical noise can be a big problem, certainly. I used to check KNK sensor detection (where a car was showing high knock output signal when there was no reason) by connecting two 2.1V, 1 watt, Zener diodes "back to back" parallel. Small zeners blow open at .5V reverse bias. My simple rig was wired with one end to ground and the other to the KNK signal. This method took everything above .5V (positive or negative of the sensor sine wave) away from the ECU.
If the car ran correctly with the trimming gadget, there was something mechanical going on at KNK frequency for that bore diameter. One time it was a cracked alternator lower bracket, another it was a bad ridge in a cylinder.
This is also how we ran Dan Wagners GBGMR with a solid mounted engine, back in 1998-2000 using a pretty stock Celica All-Trac engine. It gave us an extra 30 mph.
One successful option for spark control of a stock ECU is to take the crankshaft rotation signal through a small processor to offset the trigger output "x" number of degrees. This method has been used on various aftermarket blower kits, where replacng the original ECU is not practical or emissions legal. It is a pretty simple gadget for a hobbyist programmer of PICs. Look for the robotics hobby folks....they are doing magic with small, simple chips. You can probably come up with a cheap and serviceable solution for timing control.
They will need to know your signal durations and RPM to calculate the clock cycle of the required math processes. This may mean youll need to pick a max advance to target (maybe 20-22 degrees?) and then reprogram chips for changes. You will need to calculate the crankshaft TDC indication position and provide that info as well. A decent oscilloscope will tell all.
Dont forget...if your current ECU has a piezo sensor, you will need those two zener diodes along with a signal delay device. Try to keep it simple.