Issues with HDL coder IFFT/FFT Processing with 4x1 Vectors and Data Reordering

3 views (last 30 days)
I have created an OFDM system where, at the transmitter (Tx) side, I perform IFFT, add a cyclic prefix (CP), and then on the receiver (Rx) side, I perform FFT followed by channel estimation and equalization.
However, I encountered an issue. When I pass scalar values through the IFFT and FFT blocks, everything works fine, and the constellation graph appears as expected. However, my goal is to process data in 4x1 vectors to increase the sampling rate. After processing 4x1 vectors, the constellation graph does not appear correctly, and it seems the data is not in the expected order after the IFFT block.
My question is: when converting data to the time domain with IFFT, does the order of the data change? For example, I expect the data to go through as {0,1,2,3}, {4,5,6,7}, {8,9,10,11}, {12,13,14,15}, etc. But after IFFT, should I expect it to be {0,4,8,12}, {1,5,9,13}, and so on? If this is the case, should I introduce a reordering step after the IFFT to restore the data to its original order?
Additionally, could there be issues related to bit-reversed order, or other similar problems such as "output/input in bit-reversed order"? If you could clarify the meaning of this and how it might affect my system, I would greatly appreciate it.
For your reference, I am using HDL Coder and leveraging the HDL optimized IFFT/FFT blocks in my design.
Finally, I would be grateful if you could provide any resources or further explanations on the index order and the steps needed to process data in vector form, including any additional adjustments I need to make for IFFT/FFT operations.
Thank you very much for your time and assistance. I look forward to your response.

Answers (1)

Adit
Adit on 7 Aug 2025
Hi Jina,
A straightforward way to verify if your data ordering is correct is to run your system twice: once with a scalar (single-sample) input and once with a 4×1 vector input. You can log both the input and output data to the MATLAB workspace and compare them directly. This approach helps you identify any discrepancies in the output from the IFFT or FFT block, making it easier to spot where the order might be changing unexpectedly.
When using a 4×1 input to the IFFT block, you are providing four consecutive time samples (not four separate channels). However, the FFT/IFFT block’s settings may affect the output order, especially when vector inputs are involved.
Be sure to check the “Output in bit-reversed order” setting in your FFT/IFFT block parameters (refer https://www.mathworks.com/help/dsphdl/ref/fft.html). If you want the output data in the same, natural order as your input, this setting must be configured properly. Typically, you want this option enabled so that the block outputs data in sequential order. If it’s not set, your output may be in bit-reversed order, which could cause unexpected results in your constellation or data sequence.
Also, double-check that your 4×1 input vector is ordered as four consecutive samples. Sometimes, mixing up sample order and channel order can cause input ordering errors.
You may find the following example regarding FFT Algorithm helpful: https://www.mathworks.com/help/dsphdl/gs/generate-hdl-code-for-fft-hdl-optimized-block.html
For further information, refer to the following MathWorks documentations:

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!