IQ sampling

nRF5340 Product Specification

RADIO uses DMA to write IQ samples recorded during the CTE to RAM. Alternatively, the magnitude and phase of the samples can be recorded using the DFECTRL1.SAMPLETYPE field. The samples are written to the location in RAM specified by DFEPACKET.PTR. The maximum number of samples to transfer are specified by DFEPACKET.MAXCNT and the number of samples transferred are given in DFEPACKET.AMOUNT. The IQ samples are recorded with respect to the RX carrier frequency. The format of the samples is provided in the following table.

Table 6. Format of samples
SAMPLETYPE Field Bits Description
0: I_Q (default) Q 31:16 12 bits signed, sign extended to 16 bits. Out of range samples are saturated at value -32768.
I 15:0
1: MagPhase reserved 31:29 Always zero
magnitude 28:16 13 bits unsigned. Equals 1.646756*sqrt(I2 + Q2).
phase 15:0 9 bits signed, sign extended to 16 bits. Equals 64*atan2(Q, I) in the range [-201,201].

Oversampling is configured separately for the reference period and for the time after the reference period. During the reference period, the sample spacing is determined by DFECTRL1.TSAMPLESPACINGREF. DFECTRL2.TSAMPLEOFFSET allows fine tuning the position of the samples in steps of 16 MHz periods (62.5 ns)

For the time after the reference period, if CTEINLINECONF.CTEINLINECTRLEN is disabled, the sample spacing is set in DFECTRL1.TSAMPLESPACING. However, when CTEINLINECONF.CTEINLINECTRLEN is enabled, the sample spacing is determined by two different registers, depending on whether the device is in AoA or AoD RX-mode.

For AoD RX mode, the sample spacing after the reference period is determined by the CTEType in the packet, as listed in the following table.
Table 7. Sample spacing when CTEINLINECONF.CTEINLINECTRLEN is set and the device is in AoD RX mode
CTEType Sample spacing
AoD 1 µs slots CTEINLINECONF.CTEINLINERXMODE1US
AoD 2 µs slots CTEINLINECONF.CTEINLINERXMODE2US
Other DFECTRL1.TSAMPLESPACING
For AoA RX mode, the sample spacing after the reference period is determined by DFECTRL1.TSWITCHSPACING, as listed in the following table.
Table 8. Sample spacing when CTEINLINECONF.CTEINLINECTRLEN is set and the device is in AoA RX mode
DFECTRL1.TSWITCHSPACING Sample spacing
2 µs CTEINLINECONF.CTEINLINERXMODE1US
4 µs CTEINLINECONF.CTEINLINERXMODE2US
Other DFECTRL1.TSAMPLESPACING

For the reference and switching periods, DFECTRL1.TSAMPLESPACINGREF and DFECTRL1.TSAMPLESPACING can be used to achieve oversampling.