Upsampling and then Downsampling Causing Sample Read Issues

5 次查看(过去 30 天)
I have a Simulink model trying to push the data payload into the TX buffer by using 4 16-bit TXDMA ports and IIO buffer push and read out the 64-bit words from AXI4-Lite registers via FIFO. In the receiver, we have a filter design that performs 20x upsampling before it and then 20x downsampling after it such it saves the latency. We performed the test in 40 Msps.
The Simulink simulation is fine with the 20x upsampling and downsampling design. However, when we test the hardware (Analog Devices PackRF with ADRV9361-Z7035), we found the following issues:
(a) When the 20x upsampling and downsampling are not implemented, the TX payload FIFO reading is normal like
// From TX Payload FIFO
Upper Word: 07060504, Lower Word: 03020100
Upper Word: 0f0e0d0c, Lower Word: 0b0a0908
Upper Word: 17161514, Lower Word: 13121110
Upper Word: 1f1e1d1c, Lower Word: 1b1a1918
Upper Word: 27262524, Lower Word: 23222120
Upper Word: 2f2e2d2c, Lower Word: 2b2a2928
(b) With the 20x upsampling and downsampling implemented, the TX payload FIFO reading is like
// From TX Payload FIFO
Upper Word: 00000000, Lower Word: 00000000
Upper Word: 2f2e2d2c, Lower Word: 2b2a2928
Upper Word: cfcecdcc, Lower Word: cbcac9c8
Upper Word: 90919293, Lower Word: 94959697
Upper Word: 90919293, Lower Word: 94959697
Upper Word: 90919293, Lower Word: 94959697
from Word No.2 to Word No 3, the difference is 20 64-bit words.
Attached is my payload vector in C code:
uint16_t testPayload[256] = {0x0100, 0x0302, 0x0504, 0x0706, 0x0908, 0x0B0A, 0x0D0C, 0x0F0E,
0x1110, 0x1312, 0x1514, 0x1716, 0x1918, 0x1B1A, 0x1D1C, 0x1F1E,
0x2120, 0x2322, 0x2524, 0x2726, 0x2928, 0x2B2A, 0x2D2C, 0x2F2E,
0x3130, 0x3332, 0x3534, 0x3736, 0x3938, 0x3B3A, 0x3D3C, 0x3F3E,
0x4140, 0x4342, 0x4544, 0x4746, 0x4948, 0x4B4A, 0x4D4C, 0x4F4E,
0x5150, 0x5352, 0x5554, 0x5756, 0x5958, 0x5B5A, 0x5D5C, 0x5F5E,
0x6160, 0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8E8F, 0x8C8D, 0x8A8B, 0x8889, 0x8687, 0x8485, 0x8283, 0x8081,
0x7E7F, 0x7C7D, 0x7A7B, 0x7879, 0x7677, 0x7475, 0x7273, 0x7071,
0x6E6F, 0x6C6D, 0x6A6B, 0x6869, 0x6667, 0x6465, 0x6263, 0x6061,
0x5E5F, 0x5C5D, 0x5A5B, 0x5859, 0x5657, 0x5455, 0x5253, 0x5051,
0x4E4F, 0x4C4D, 0x4A4B, 0x4849, 0x4647, 0x4445, 0x4243, 0x4041,
0x3E3F, 0x3C3D, 0x3A3B, 0x3839, 0x3637, 0x3435, 0x3233, 0x3031,
0x2E2F, 0x2C2D, 0x2A2B, 0x2829, 0x2627, 0x2425, 0x2223, 0x2021,
0x1E1F, 0x1C1D, 0x1A1B, 0x1819, 0x1617, 0x1415, 0x1213, 0x1011,
0x0E0F, 0x0C0D, 0x0A0B, 0x0809, 0x0607, 0x0405, 0x0203, 0x0001};
When you compare 0x2928 and 0xC9C8, this distance is 80 16-bit words, which is equivalent to 20 64-bit words. Even if I removed the RX chain and placed both the 20x upsampling and downsampling block on other places, the 20 64-bit word skip still exists.
I also tried the lower the sampling rate to 3 Msps such that at 20x oversampling, the sampling rate is still under the 61.44 Msps limit, but the 20 64-bit word skip still exists.
How can I fix this issue?

回答(1 个)

SANKALP DEV
SANKALP DEV 2023-12-29
Hello Chao,
I understand that you want to transmit a data payload through the system while implementing up sampling and down sampling processes to manage the data rate effectively.
To resolve the issue, you are facing with 20 64-bit word skip when using 20x up sampling and down sampling in your Simulink model, you can refer to following steps:
  • Synchronise up sampling and down sampling data block properly with the data flow.
  • Overflowing or underflowing of FIFO can cause data loss, as the data rate is being increased due to up sampling.
  • You can use a known data pattern to track and identify exactly where the data is being lost.
  • Increase the sampling rate gradually and find that at which point is the system failing, and accordingly set the coefficients of filters, this can be done by using a known data pattern.
By following the above steps, you can identify, and troubleshoot the issue.
Hope this helps.
Best Regards,
Sankalp dev

类别

Help CenterFile Exchange 中查找有关 Acoustics, Noise and Vibration 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by