what is the proper way to deal with the NLOS situation?
Once, NLOS situation can be detected, what should the proper way to avoid the accuracy drop in that situation?
For example, if 4 anchors are utilized and 3. anchor is facing NLOS, the tag position should be estimated by neglecting the output from the 3. anchor? Any better ways you can propose?
If the NLOS situation happens at a static position, you can estimate the additional time of flight delay coming from the blocking object. Otherwise, the only option is to discard the NLOS results from the measurement.
Depending on the type of obstruction in some situations if you look at the CIR it may be possible to determine the LoS reception time manually and so calculate the correct range. It’s the sort of thing you can do intuitively but programming a computer to do well gets very tricky. It would be slow, less accurate and very error prone. But theoretically possible.
For TWR you’d need to do this on both devices.
Personally I put a lot more effort into detecting NLOS situations so they can be excluded than in trying to fix the bad data, any attempts to “fix” the measurements were too prone to false positives than then degraded the accuracy under good conditions. I’d rather exclude a good measurement because I don’t trust it than risk “correcting” an already good number and degrading the system performance.