Difference of CIR (Channel Impulse Response) between Tag and Anchor during ranging in DS-TWR

Hi all,

I’m currently working with the DWM3001CDK and have modified the firmware to capture CIR (Channel Impulse Response) during DS-TWR ranging.
Specifically, I modified dw3000_mcps_mcu.c, and within the function triggered by mcps_rx_cb, I added a routine to extract and send a fixed number of CIR samples (pairs of real and imaginary values) via USB after reception.

With this setup, when I use the CLI commands initf and respf to start a DS-TWR session, I expect each ranging exchange to produce one set of CIR samples along with the ranging result. I have configured the number of CIR samples to 16 in the firmware. After each successful ranging session, report_cb is triggered and both CIR and ranging results are sent over USB.


The question is:

When I test this setup using two terminals — one running initf (tag) and the other respf (anchor) —

  • The tag (initf) side behaves as expected: it outputs 16 CIR samples per ranging session.
  • But the anchor (respf) side outputs 32 CIR samples per session, which seems to indicate that CIR capture is being triggered twice per session.

Since I’m using DS-TWR, I would expect only one reception per device per round.
So my question is:

Why is the anchor capturing CIR data twice per ranging session, while the tag only captures once?

Is this expected behavior under DS-TWR?

Any clarification or insight would be greatly appreciated.

Thanks in advance!

1 Like

In DS-TWR, three messages are exchanged between the tag and anchor:

  1. Tag → Anchor: Poll message (initiates ranging)
  2. Anchor → Tag: Response message
  3. Tag → Anchor: Final message (contains timing information)

So the expected CIR capture behavior should be:

  • Tag side: Receives 1 message (the Response) → 16 CIR samples
  • Anchor side: Receives 2 messages (Poll + Final) → 32 CIR samples

Your observation is actually correct and expected behaviour. The anchor node receives both the initial Poll message and the Final message from the tag, while the tag only receives the Response message from the anchor.

Why this happens:

  • The anchor must receive both the Poll and Final messages to calculate the time-of-flight, as all timestamp information must be captured at least at the Anchor node to perform the distance calculation
  • Your CIR capture routine in mcps_rx_cb is correctly being triggered twice on the anchor side - once for each received message

This is not a bug in your implementation - it’s the normal DS-TWR protocol behaviour. If you only want to capture CIR once per ranging session, you could modify your code to only capture CIR on specific message types (e.g., only Poll messages), or add logic to track and skip subsequent CIR captures within the same ranging session.

Oz