Professional Documents
Culture Documents
How Can I Plot SNR Measured by UE - NetSim Support Portal
How Can I Plot SNR Measured by UE - NetSim Support Portal
SNR measured by UE can be logged into a single or a separate file and then be plotted as per your requirement.
Following is one such example where we log the SNR for each UE in a separate file with respect to each ENB along
with the event time.
i.Open NetSim source code in Visual Studio 2015 by double clicking on the NetSim.sln file present in
“<NetSim_Install_Directory>/src/Simulation” folder.
ii.Go to LTE project through the solution explorer and open the file LTE_Phy.c. Add the lines of code highlighted in
red as shown below:
#include "main.h"
#include "LTE.h"
#define devid(id) fn_NetSim_GetDeviceIdByConfigId(id)
NETSIM_ID fn_NetSim_LTE_FindNearesteNB(NETSIM_ID nDeviceId);
FILE* fp;
char snrlog[100];
int fn_NetSim_LTE_CalculateReceivedPower()
{
NETSIM_ID i;
//fp = fopen("LTE_UE_SNR.txt", "w+");
for(i=0;i<NETWORK->nDeviceCount;i++)
{
…………………………………………………………
if(ber<TARGET_BER)
break;
else
{
info->DLInfo[j].nCQIIndex--;
info->ULInfo[j].nCQIIndex--;
}
}
sprintf(snrlog, "LTE_UE_%d_SNR.csv", devid(info->nUEId));
fp = fopen(snrlog, "w+");
if (fp)
{
fprintf(fp, "UE_ID,ENB_ID,Time,SNR");
fclose(fp);
}
}
info=(LTE_ASSOCIATEUE_INFO*)LIST_NEXT(info);
}
}
}
https://support.tetcos.com/support/solutions/articles/14000072645-how-can-i-plot-snr-measured-by-ue-
How can I plot SNR measured by UE? : NetSim Support Portal
return 1;
}
iii.In the file NAS.c add the lines of code highlighted in red as shown below:
if(ber<TARGET_BER)
break;
else
{
info->DLInfo[j].nCQIIndex--;
info->ULInfo[j].nCQIIndex--;
}
}
temp->nCQIIndex_DL[j]=info->DLInfo[j].nCQIIndex;
temp->dSNR_DL[j]=info->DLInfo[j].dSNR;
sprintf(snrlog, "LTE_UE_%d_SNR.csv", devid(info->nUEId));
fp = fopen(snrlog, "a+");
dETime = pstruEventDetails->dEventTime;
if (fp)
{
fprintf(fp, "\n%d,%d,%lf,%lf",devid(info->nUEId), devid(i+1), dETime, info->ULInfo[j].dSNR);
fclose(fp);
}
}
LIST_FREE((void**)&info,info);
LIST_ADD_LAST((void**)&report,temp);
}
}
iv.Now right click on LTE module in the solution explorer and select rebuild.
v.Upon successful build, you will get a new libLTE.dll file in the “<NetSim_Install_Directory>/src/Simulation/DLL”
folder.
https://support.tetcos.com/support/solutions/articles/14000072645-how-can-i-plot-snr-measured-by-ue-
How can I plot SNR measured by UE? : NetSim Support Portal
vi.Copy this newly built DLL file and replace it in the bin folder of NetSim after you rename the original libLTE.dll
file which is already existing there(as a backup).
vii.Now on running any simulation in LTE, you will get individual SNR logs with respect to time for each UE, in the
bin folder of NetSim (“<NetSim_Install_Directory>/bin”) as shown below:
viii.These log files can be used to further plot the SNR of each UE with respect to time using excel plots.
https://support.tetcos.com/support/solutions/articles/14000072645-how-can-i-plot-snr-measured-by-ue-
How can I plot SNR measured by UE? : NetSim Support Portal
https://support.tetcos.com/support/solutions/articles/14000072645-how-can-i-plot-snr-measured-by-ue-