Aside from the fact that "knocking" is used for gasoline motors (not diesel), you may want to try a "knock sensor" (the device used in gasoline motors - typically a piezo-electric pickup) to get an electrical 'representation' of the vibrations.
From past experience: most of diesel noise is from a change in the pressure incline when combustion starts. Splitting the fuel quantity injected into several smaller amounts can help reducing noise, effectively counteracting any changes in pressure incline - as good as possible.
Diesel engines also knock. The noise generated can be heard as a dull thud. It is caused by high rate of pressure rise created due to a long delay period during which fuel accumulates and burns at a very high rate when combustion starts. This phase of combustion is called the pre-mixed combustion phase. The sound can be identified by human ear or by knock sensors as mentioned above.