In another thread someone was asking about the knock sensor system in the ECU. JJ gave a nice answer, but I wanted to go over a few finer details.
As noted, the knock sensors are just microphones and looking at the resulting signal on a scope just looks like a lot of noise. The ECU has a dedicated processor that gates and filters the knock sensor inputs. The main processor in the ECU talks to the knock processor and tells it which crank sector it is in (each crank sector is 30 degree interval, so we have TDC, TDC+30deg, TDC+60 deg, TDC+90deg, and then back to TDC again). Depending on the crank sector, the knock signal is analyzed over specific frequency bands to look for either knock events, or normal combustion sounds. This took enough processing 20 years ago that a dedicated CPU needed to be used. If knock is detected, the data is fed back to the main processor for further crunching.
The ECU does not respond to knock for all loads and rpm. Instead, it defines three zones of interest, and keeps track of the knock response separately in these zones. The maximum timing retard for each zone is stored in permanent memory, so it learns the knock sensitivity of the engine over time, and this is used for faster correction when knock is detected.
The maximum amount of timing pulled when knock is detected is fixed by a 2D map of load and rpm. The maximum knock that can be pulled is 15 degrees. Generally speaking, it does not go to the max value right away, but responds proportionally depending on the knock strength.
A timer is used to maintain the timing retard well after the knock event has stopped. This means that once knock is detected, the timing pulled lingers on the assumption that going back to base timing is just going to cause the knock to return. I'll discuss the algorithm and show a datalog example on my next post.
For now, I'll just post the max timing that can be pulled dependent on load and rpm. This map is at address DDC8h and has 13 rpm columns (1600 to 6400) and 7 load rows (36% to 78%). This is from a 7MGTE A/T gray plug ECU.