RX timestamp and LDE algorithm

I’m a bit confused about how the DW1000 calculates the RX timestamp. I’m understanding that the DW1000 will detect the SFD in the message frame, then execute the LDE algorithm to output the correct RX timestamp. Is my opinion correct?

If that’s true, I would like to ask about the LDE algorithm. In case of NLOS, DW1000 still get direct path but has weaker power than reflect path, then RX timestamp will calculate with direct path or reflect path? Because I see in this case the calculated distance is larger than in the case of LOS.

You are correct.

The leading edge detection algorithm will calculate a threshold value based on the noise level it is seeing in the environment. The first signal to cross this threshold is considered to be the first path and the Rx time will then be calculated on that signal.

So in the situation you describe the range will either be correct or too long depending upon whether the true first path signal crosses the threshold or not. The issue is that if the threshold is too low then noise or other artifacts from long duration reflections are more likely to give a false trigger and result in a range that is too short.
There are a couple of registers that can be modified to change this threshold value but exactly how they work has never been explained in detail.