exactly that mate. The knock occurs when the piston rattles it's way down the bore thus creating a vibration. This is what the sensor detects.
One thing worth doing is to replace the sensor and tighten the bolt down to the correct torque. Some sensors rely on a certain amount of 'crush' to read correctly. Incorrect torque can result in iffy readings. Once overtightened the sensor should be renewed.