The noise is a combination of things, starting with a supersonic shock
wave at the combustion front. Fixed timing engines also suffer from
excessively early injection at idle, contributing to the noise in the
same way spark knock does.
The high speed swirl in the prechamber breaks up the shock wave,
resulting in both better combustion and less noise -- alas, it also
reduces efficiency somewhat.
Noisy Benz engines are usually as Marshall describes -- some carbon on
the nozzle will disrupt the spray pattern enough at idle, when very
little fuel is injected, enough to make it burn all at once rather than
smoothly. Sticky nozzles result in late or early injection (depending
on when it sticks, open or closed), again, clank.
Diesels cannot detonate, the fuel has to be all present at once for
detonation to occur.
Peter