Use FFT-shifted buffer in all PHY receiver functions#240
Use FFT-shifted buffer in all PHY receiver functions#240sakthivelvelumani wants to merge 2 commits into
Conversation
|
CI Build: #509 | Failed on the following stages: |
| { | ||
| const int half = nbins / 2; // half bw | ||
|
|
||
| c16_t tmp[fft_size / 2]; // holds the negative half |
There was a problem hiding this comment.
Is there a reason why this array does not have the size half? If so, I think it should be documented, because it is not obvious...
| c16_t tmp[fft_size / 2]; // holds the negative half | |
| c16_t tmp[half]; // holds the negative half |
There was a problem hiding this comment.
I missed it. thanks.
| { | ||
| const int half = nbins / 2; // # negative-freq bins | ||
|
|
||
| c16_t tmp[fft_size / 2]; // holds the negative half |
There was a problem hiding this comment.
More wrap-around logic
| // The purpose of following if is not clear? So adding assert in else to detect missed reads. | ||
| if ((startRB + numRB) == (start_totalRB + num_totalRB)) { | ||
| int pos_len = 0; | ||
| int neg_len = 0; | ||
|
|
||
| if (start_totalRB < (num_totalRB >> 1)) // there are PRBs left of DC | ||
| neg_len = min((num_totalRB * 6) - (start_totalRB * 12), num_totalRB * N_SC_PER_PRB); | ||
| pos_len = (num_totalRB * N_SC_PER_PRB) - neg_len; | ||
| // Calculation of the pointer for the section in the buffer. | ||
| // positive half | ||
| uint8_t *dst1 = (uint8_t *)(pos + (neg_len == 0 ? ((start_totalRB * N_SC_PER_PRB) - (num_totalRB * 6)) : 0)); | ||
| // negative half | ||
| uint8_t *dst2 = (uint8_t *)(pos + (start_totalRB * N_SC_PER_PRB) + fftsize - (num_totalRB * 6)); | ||
| memcpy((void *)dst2, (void *)local_dst, neg_len * 4); | ||
| memcpy((void *)dst1, (void *)&local_dst[neg_len], pos_len * 4); | ||
| memcpy((void *)pos, (void *)local_dst, num_totalRB * N_SC_PER_PRB * 4); | ||
| } else { | ||
| DevAssert(0); |
There was a problem hiding this comment.
You could avoid this strange part of the code if you changed the code above to write straight into the destination buffer.
There was a problem hiding this comment.
Thanks. I removed the temporary buffer.
make fft shift functions more generic. separate functions to do fft shift inplace and inverse fft shift. Signed-off-by: Sakthivel Velumani <s.velumani@northeastern.edu>
Same as txdataF, now rxdataF buffer is flat with first RB starting at index 0. Signed-off-by: Sakthivel Velumani <s.velumani@northeastern.edu>
2e5bcb1 to
97f4230
Compare
|
In preparation for the full CAT-B support may I suggest that the final fftshift operation (both TX and RX) actually happen in the RU component. For 7.2 we actually undo the fftshift during compression/decompression and we don't actually need it at all. We can put the fftshift in the low-phy variants which are not 7.2. When we will add multiple layer support and multiple sections this will be required anyway since we are not going to transfer a full OFDM symbol between high-PHY and low-PHY. |
|
@RaymondKnopp This PR does fftshift only for non 7.2 scenario and it does immediately after FFT operation inside Speaking of multiple section, in #157 I made some preparation work to pass multiple section information (no of prbs, symbols, beam id) from high-phy to low-phy. |
Similar to the transmit path, this PR changes rxdataF to hold FFT shifted data. So all PRBs are contiguous starting from PRB 0.