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)tx(eNodeBOutput);
There is a maximum bound on the samples you can transmit without modify HDL and the linux kernel. The bound we pre-set in the system object is conservative (2^20). You can try increasing this changing the value on this line: https://github.com/analogdevicesinc/MathWorks_tools/blob/master/%2Badi/%2BAD9371/Base.m#L66
It may be possible to extend this to 2^23.
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-hpcError using matlabshared.libiio.base/cstatusFailed to configure device and buffers.Error in matlabshared.libiio.base/cstatusidError in matlabshared.libiio.base/setupImplError in adi.AD9371.Tx/setupImpl (line 74) setupImpl@matlabshared.libiio.base(obj);Error in ad9371_LTE_adi_Tx_3 (line 216)tx(eNodeBOutput);