Tool/software:
Q1) How many cycles does CFAR operation take on the HWA?
Comment) The CFAR operation also works in a streaming mode. The number of cycles it would take would be in the order of ACNT * BCNT along with some added latency.
Q2) How is local max used in the OOB demo? / How to configure input and output formatter for Local Max operation:
Comment) A local maxima is performed on the Azimuth FFT samples during the azimuth stage of the doppler processing in both range and doppler dimension to obtain the approximate peak index of the angle FFT. Row-wise as well as column-wise comparison is performed, and "0 1 0 1 0 1 0 1", i.e., a "+" shaped comparison is utilized.
Only the registers in the table below need to be programmed for proper local max functionality – the other bits in the param-set should all be kept 0.
Q3) How and why to use per stage butterfly scaling for FFT operations on the HWA / How to choose scaling configurations on the HWA? / How to check for clipping or saturation in the HWA?
Comment) Some pointers need to be considered when choosing the appropriate scale setting for the data in an actual
use case which will be discussed in this article.
The data bit width of typical radar ADC data is 16 bits, and the internal data bit width of the HWA is 24 bits. This allows for bit growth up to 8 bits without saturation for any of the processing performed which can be controlled by the user. Scaling options available in the HWA with respect to the input and output are as follows:
•Input formatter can scale the input data streamed into the engine.
•Output formatter can scale the output data streamed out of the engine before placing the samples on to the
memory.
•The FFT engine has scaling control over each stage of the butterfly used where the scale of 0.5 can be applied.
•CMULT operations could apply a scaling based on which mode is being used and how the user has configured it.
•It is very important that the user is aware of the scaling applied on the data at any given time of the processing chain in order to understand what level of output to expect, adjust other parameters such as thresholds that heavily relies on the exact scale of the data accordingly.
Need for FFT scaling:
- From the definition of the DFT, the maximum value X(K) can have when taking an N point FFT will be N*X(t). This can be derived from sum up to N numbers and X(t) sample will have a max value of 2^16 based on the ADC bit width.
- E.g.: A 256 point FFT, can grow as much as 2^8 times the input. In terms of the HWA, the register bit width is 24 bits. Therefore, if there is no input scaling performed, the FFT output can grow all the way up to 24 bits after its 8 stages. (2^16 * 2^8 = 2^24).
- Now, based on this, if the user goes for an FFT size N greater than 256, there is a chance that the FFT data could get clipped and saturate as the HWA bit width still remains to be 24 bits.
- Hence, a per stage scaling could be applied in the successive butterfly stages after the initial 8 bit growth to retain the level of the data at 24 bits.
- Note: If the FFT is done after the first dimension, the output can be either 16 bit or 32 bit and if it’s 32 bit, then there won’t be any bits to grow. Therefore, scaling would have to be done for all stages here.
- The same can be seen in the table (This is considering that there is no scaling applied previously in any input or pre processing stage).
FFT stages to scale based on FFT size:
FFT Size | Num Stages to scale |
Less than 256 (2^8) | 0 |
256 (2^8) | 0 |
512 (2^9) | Last 1 stage |
1024 (2^10) | Last 2 stages |
2048 (2^11) | Last 3 stages |
When to program the FFT BFLY Scale regs:
- Based on factors such as Tx/Rx gain, Tx output power, acquired target power etc. there might not even be a need to perform mandatory butterfly scaling as the data would not saturate.
- The FFT butterfly scaling is supposed to be performed once the sensor is deployed and feedback from the experiments are evaluated. The feedback can be with respect to the CLIP registers getting hit.
- Here are some read only registers that can indicate clipping in a typical FFT chain:
•IP_OP_FORMATTER_CLIP_STATUS : This particular register can indicate if the data being scaled by the input or output formatter gets clipped.
•FFT_CLIP : This register indicates any saturation/clipping events that have happened in the FFT butterfly stages. If raised, this would also have to be cleared each time FFT is performed again. - Some of the internal accumulators such as the DC estimate, Interference stats or CMULT operation regs can also clip which have their own clipping indicator registers. Based on the feedback from the experiments after deploying the sensor, these can also be scaled accordingly (More info is found in the device TRM).