Transmit and Receive LTE using adrv9371 and ZC706


I am trying to modify the Transmit and Receive LTE MIMO code given in the below link.

This code runs perfectly on AD RF SOM.

Now, I am trying the same example to run on ADRV9371.

ad9361_LTE() ( The code that's in the Legacy folder under LTE_MATLAB) uses IIO hence, I modified this code to 9371 and it works for the dummy data which is used in trData. (I was able to see LTE spectrum on the Spectrum Analyzer). Please note that I upsampled the enodeBOutput by 8 (to match 122.88Mhz) for Transnmission.

But, when I modify it to the above image and try to Transmit, MATLAB crashes. After a bit debugging, I understood that the buffer size that I have pre-allocated,is too large and that could be the reason for my Crash. (Not sure though)

Next, I changed the IIO objects to Adi Objects and used adi.AD9371.Tx and could similarly transmit the dummy Data but, when tried to Transmit the full grid, I get an error.

This error is related to SamplesPerFrame. The Final enodeBOutput is much larger than 2^20, Hence,I always get an error. 

How, do I transmit this whole grid either using IIO objects or ADI objects?

Please suggest any work around.




Error using adi.AD9371.Base/set.SamplesPerFrame (line 65)
Expected SamplesPerFrame to be a scalar with value <= 1.04858e+06.

Error in adi.AD9371.Tx/setupImpl (line 71)
obj.SamplesPerFrame = size(data,1);

Error in ad9371_LTE_adi_Tx_3 (line 216)

Parents Reply Children
  • Hi Travis,

    Thanks for your quick reply.

    I tried to change the value to 2^23 base.m code as suggested

    and got an error as shown below.

    Also, In adi documentation,I found the value  of SamplesPerFrame to be 

    an even positive
        integer from 2 to 16,777,216  ie:(2^24).

    Can you please tell, if there is any other place which has to be modified as well?

    Error :

    ERROR[-1]: Failed to create buffer for: axi-ad9371-tx-hpc
    Error using matlabshared.libiio.base/cstatus
    Failed to configure device and buffers.

    Error in matlabshared.libiio.base/cstatusid

    Error in matlabshared.libiio.base/setupImpl

    Error in adi.AD9371.Tx/setupImpl (line 74)

    Error in ad9371_LTE_adi_Tx_3 (line 216)

  • Hi Travis, also another question.

    How can I modify the HDL and linux kernel? Can you please point me to some documentation?



  • 0
    •  Analog Employees 
    on Jun 19, 2019 7:48 AM over 1 year ago in reply to sravanreddych

    I would first recommend decreasing the sample rate so you don't need such a large buffer. This can be done through this tool:

    If you need to increase the maximum buffer size, first change the CMA of the kernel.


  • Hi Travis,

    I don't think I can reduce the Sampling rate. My goal is to simulate an aggregated LTE signal of 60Mhz,so the sampling rate has to be 122.88Mhz.

    I was not sure how do to the changes in CMA kernel to increase the buffer size to the said 2^23 or 2^24 as per documentation.

    I tried breaking the final waveform into chunks of 5 frames nd transmitted repeatedly in a while loop forever.


    while 1


    tx(signal1);  %% 5 frames worth samples 153600*5


    tx(signal(2); so on..


    Receiver side:

    collect 6 frames worth samples I;e 153600*6 (I need this to run 8 times as the Sampling rate is 122.88Mhz)

    The issue is at the receiver I am not able to reconstruct/decode the original signal. Even the cellID is not getting decoded properly.

    I tried increasing the delay between significant reception of bursts but nothing helped.

    Can you please suggest any alternative?

    If I cannot change buffer size in kernel and don't have the option to reduce Sampling rate, what other options do I have apart from the above said procedure?

    Please suggest.

  • 0
    •  Analog Employees 
    on Jul 17, 2019 8:18 PM over 1 year ago in reply to sravanreddych

    This doesn't appear to be a buffer length issue since you can fit many frames inside the buffers. I assuming (153600*5) is the length of your entire LTE frame here.

    To correctly capture a single frame requires 153600*5*2 samples, which is well within the standard DMA capture size. 2^22 and below worked fine for me with the standard SD card.

    Are you using the same board to capture the transmitted signal? If so, how are you interleaving transmit and receive calls?