I tried to plot the CIR data -sqrt(Imag^2 + Real^2). TX and RX are connected through a SMA cable with a 50dB attenuation.
I cannot understand the results i’m getting. can anyone explain or share any documents related to accumulation of preamble symbols to estimate CIR ?
My TX/RX configuration is as below. the result plot is attached !
4, /* Channel number. /
DWT_PRF_16M, / Pulse repetition frequency. /
DWT_PLEN_1024, / Preamble length. Used in TX only. /
DWT_PAC32, / Preamble acquisition chunk size. Used in RX only. /
7, / TX preamble code. Used in TX only. /
7, / RX preamble code. Used in RX only. /
1, / 0 to use standard SFD, 1 to use non-standard SFD. /
DWT_BR_110K, / Data rate. /
DWT_PHRMODE_STD, / PHY header mode. /
(1025 + 64 - 32) / SFD timeout (preamble length + 1 + SFD length - PAC size). Used in RX only. */
Are the two boards able to communicate with each other? Are you running the standard TWR program for ranging?
You have too many peaks for this to be correct. Somehow your accumulator is getting polluted. Are you reading the real and the complex part separately, then calculating the magnitude?
Yes I’m reading the accumulator immediately as i receive a valid frame. my confusion is why there are many peaks in the CIR data when i only have a single path from TX to RX ?
The boards are able to communicate with each other successfully. I’m not using the standard TWR program, instead sending a blink frame and receiving.
I modified the example code ex_02c_rx_diagnostics (main function attached) to get the CIR data to my PC to plot it in matlab.
(dwt_readaccdata function is called to read the accumulator memory. Then calculating and sending the magnitude of each CIR sample for plotting)
I’m using SMA attenuators. i tried without the attenuator as well. the results are the same !
I figured out a mistake. I was calculating the imaginary and real parts as unsigned 16 bit integer. but it’s signed 16 bit integer.
Now my plot seems reasonable. Thanks for the help !
Hello Rajendra,
I am trying to output the CIR data via USB as well, but there are some compilation issues when when using your main.c (BTW thanks for providing).
Can you give me a hint on your compilation environment to get it started?