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?
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 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?